I'm trying to configure Emacs to not activate Auto-Fill when editing an XML document.
In my .emacs file, I add a hook so that text mode will have Auto-Fill on by default:
(add-hook 'text-mode-hook 'turn-on-auto-fill)
I have added a directory to my load path:
(add-to-list 'load-path "~/.emacs.d/lisp/")
Inside that directory, I have written a file xml.el for this workstation, and I have tried each of the following in it, to no avail:
(add-hook 'xml-mode-hook 'turn-off-auto-fill)
(add-hook 'xml-mode-hook 'auto-fill-mode)
(remove-hook 'xml-mode-hook 'turn-on-auto-fill)
(remove-hook 'xml-mode-hook 'auto-fill-mode)
How can I disable Auto-Fill in XML mode?
EDIT: It appears this is caused by my text-mode-hook mentioned above. How can I override this hook in nxml-mode?
xml.el"? Did you write your own major mode for editing XML? Does it actually have anxml-mode-hook? Normally I would expect to seenxml-modeused to edit XML files, which has its ownnxml-mode-hook. - Chrisxml.elis in~/.emacs.d/lisp. - 2macnxml-mode-hookdid not work either, though. - 2macnxml-mode. - Chrisxml.elis the name of a standard Emacs library. You shouldn't be putting a conflicting filename under yourload-path, as it may shadow the standard library, breaking anything which depends on it. I recommend using a non-conflicting prefix for all of your custom elisp libraries. I usemy-as a prefix, for example (for both filenames and function names). - phils