(dns-mode): Use before-save-hook.
This commit is contained in:
parent
bad03cfc80
commit
aa7adb2ada
2 changed files with 10 additions and 4 deletions
|
@ -1,3 +1,7 @@
|
|||
2006-08-11 Stefan Monnier <monnier@iro.umontreal.ca>
|
||||
|
||||
* textmodes/dns-mode.el (dns-mode): Use before-save-hook.
|
||||
|
||||
2006-08-11 Thien-Thi Nguyen <ttn@gnu.org>
|
||||
|
||||
* emacs-lisp/bindat.el (bindat-ip-to-string):
|
||||
|
|
|
@ -147,7 +147,7 @@ Turning on DNS mode runs `dns-mode-hook'."
|
|||
(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 @@ Turning on DNS mode runs `dns-mode-hook'."
|
|||
(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))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue