[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/textmodes/dns-mode.el,v
From: |
Stefan Monnier |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/textmodes/dns-mode.el,v |
Date: |
Fri, 11 Aug 2006 13:56:53 +0000 |
CVSROOT: /sources/emacs
Module name: emacs
Changes by: Stefan Monnier <monnier> 06/08/11 13:56:52
Index: textmodes/dns-mode.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/textmodes/dns-mode.el,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- textmodes/dns-mode.el 10 Aug 2006 20:06:18 -0000 1.6
+++ textmodes/dns-mode.el 11 Aug 2006 13:56:50 -0000 1.7
@@ -147,7 +147,7 @@
(unless (featurep 'xemacs)
(set (make-local-variable 'font-lock-defaults)
'(dns-mode-font-lock-keywords nil nil ((?_ . "w")))))
- (add-hook 'write-contents-functions 'dns-mode-soa-maybe-increment-serial
+ (add-hook 'before-save-hook 'dns-mode-soa-maybe-increment-serial
nil t)
(easy-menu-add dns-mode-menu dns-mode-map))
@@ -211,15 +211,17 @@
(defun dns-mode-soa-maybe-increment-serial ()
"Increment SOA serial if needed.
-This function is run from `write-contents-functions'."
+This function is run from `before-save-hook'."
(when (and (buffer-modified-p)
dns-mode-soa-auto-increment-serial
(or (eq dns-mode-soa-auto-increment-serial t)
(y-or-n-p "Increment SOA serial? ")))
- ;; We must return nil. If `dns-mode-soa-increment-serial' signals
+ ;; If `dns-mode-soa-increment-serial' signals
;; an error saving will fail but that probably means that the
;; serial should be fixed to comply with the RFC anyway! -rfr
- (progn (dns-mode-soa-increment-serial) nil)))
+ (progn (dns-mode-soa-increment-serial)
+ ;; We return nil in case this is used in write-contents-functions.
+ nil)))
;;;###autoload(add-to-list 'auto-mode-alist '("\\.soa\\'" . dns-mode))