I'm using Emacs and trying to edit some *.xml files of FreeBSD Documentation Project. (https://www.freebsd.org/docproj/)
It requires *.xml files to conform following conditions:
- Word wrap set to 70 characters.
- Tab stops set to 2.
- Replace each group of 8 leading spaces with a single tab.
So I added several lines in ~/.emacs as the instruction says:
(defun local-sgml-mode-hook
(setq fill-column 70
indent-tabs-mode nil
next-line-add-newlines nil
standard-indent 4
sgml-indent-data t)
(auto-fill-mode t)
(setq sgml-catalog-files '("/usr/local/share/xml/catalog")))
(add-hook 'psgml-mode-hook
'(lambda () (local-psgml-mode-hook)))
However, it seems not working correctly. When I open *.xml file of FDP in Emacs, sgml-mode is not automatically detected.
I manually enabled this mode via M-x sgml-mode
.
In this mode, tab stops set to 2 and 8 leading spaces->single tab worked fine,
while word wrap set to 70 chars seems not working(this means when I exceeded the limit, there isn't any highlight I can recognize).
So the problems are:
- Not entering sgml-mode automatically
- Word wrap set to 70 chars doesn't working
I'm using Vim right now, but I prefer Emacs for my text editing. What should I do to edit files appropriately(make documents conform to FDP guidelines) with Emacs?
Thanks.
p.s. I posted about this on freebsd-doc mailing list and FreeBSD forum, but my problem is not solved--so I'm asking here.