From 4d42bcc9b8cea4e820999584c402d3c535fe8d8a Mon Sep 17 00:00:00 2001 From: Jason Rumney Date: Mon, 18 Feb 2008 02:04:38 +0000 Subject: [PATCH] (nxml-mode): Don't add a write-contents-hook. --- lisp/nxml/nxml-mode.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lisp/nxml/nxml-mode.el b/lisp/nxml/nxml-mode.el index 11fadedd531..01637795c6b 100644 --- a/lisp/nxml/nxml-mode.el +++ b/lisp/nxml/nxml-mode.el @@ -550,7 +550,11 @@ Many aspects this mode can be customized using (when nxml-syntax-highlight-flag (add-hook 'fontification-functions 'nxml-fontify nil t)) (add-hook 'after-change-functions 'nxml-after-change nil t) - (add-hook 'write-contents-hooks 'nxml-prepare-to-save) + ;; Emacs 23 handles the encoding attribute on the xml declaration + ;; transparently to nxml-mode, so there is no longer a need for the below + ;; hook. The hook also had the drawback of overriding explicit user + ;; instruction to save as some encoding other than utf-8. +;;; (add-hook 'write-contents-hooks 'nxml-prepare-to-save) (when (not (and (buffer-file-name) (file-exists-p (buffer-file-name)))) (when (and nxml-default-buffer-file-coding-system (not (local-variable-p 'buffer-file-coding-system))) -- 2.39.5