From ecb867a2fef511fa0d8aa07552f8529532c9382c Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Thu, 8 Mar 2018 20:03:13 -0500 Subject: [PATCH] Replace uses of the obsolete local-write-file-hooks * lisp/net/quickurl.el (quickurl-reread-hook-postfix): * lisp/progmodes/ebrowse.el (ebrowse-tree-mode) (ebrowse-write-file-hook-fn): * lisp/progmodes/glasses.el (glasses-mode): * lisp/progmodes/vhdl-mode.el (vhdl-write-file-hooks-init): * lisp/vc/ediff-merg.el (ediff-set-merge-mode): * lisp/vc/ediff-util.el (ediff-setup): Replace local-write-file-hooks, obsolete since 22.1, with write-file-functions. --- lisp/net/quickurl.el | 2 +- lisp/progmodes/ebrowse.el | 4 ++-- lisp/progmodes/glasses.el | 4 ++-- lisp/progmodes/vhdl-mode.el | 4 ++-- lisp/vc/ediff-merg.el | 2 +- lisp/vc/ediff-util.el | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/lisp/net/quickurl.el b/lisp/net/quickurl.el index abfca383e09..a5ba26bcdc5 100644 --- a/lisp/net/quickurl.el +++ b/lisp/net/quickurl.el @@ -155,7 +155,7 @@ could be used here." (defconst quickurl-reread-hook-postfix " ;; Local Variables: -;; eval: (progn (require 'quickurl) (add-hook 'local-write-file-hooks (lambda () (quickurl-read) nil))) +;; eval: (progn (require 'quickurl) (add-hook 'write-file-functions (lambda () (quickurl-read) nil) nil t)) ;; End: " "Example `quickurl-postfix' text that adds a local variable to the diff --git a/lisp/progmodes/ebrowse.el b/lisp/progmodes/ebrowse.el index ca64af5c915..08b1acd4da0 100644 --- a/lisp/progmodes/ebrowse.el +++ b/lisp/progmodes/ebrowse.el @@ -1107,7 +1107,7 @@ Tree mode key bindings: (and tree (ebrowse-build-tree-obarray tree))) (set (make-local-variable 'ebrowse--frozen-flag) nil) - (add-hook 'local-write-file-hooks 'ebrowse-write-file-hook-fn nil t) + (add-hook 'write-file-functions 'ebrowse-write-file-hook-fn nil t) (modify-syntax-entry ?_ (char-to-string (char-syntax ?a))) (when tree (ebrowse-redraw-tree) @@ -4023,7 +4023,7 @@ If VIEW is non-nil, view else find source files." (defun ebrowse-write-file-hook-fn () "Write current buffer as a class tree. -Installed on `local-write-file-hooks'." +Added to `write-file-functions'." (ebrowse-save-tree) t) diff --git a/lisp/progmodes/glasses.el b/lisp/progmodes/glasses.el index de176019a57..c3e8ac35f32 100644 --- a/lisp/progmodes/glasses.el +++ b/lisp/progmodes/glasses.el @@ -326,10 +326,10 @@ add virtual separators (like underscores) at places they belong to." (if glasses-mode (progn (jit-lock-register 'glasses-change) - (add-hook 'local-write-file-hooks + (add-hook 'write-file-functions 'glasses-convert-to-unreadable nil t)) (jit-lock-unregister 'glasses-change) - (remove-hook 'local-write-file-hooks + (remove-hook 'write-file-functions 'glasses-convert-to-unreadable t))))) diff --git a/lisp/progmodes/vhdl-mode.el b/lisp/progmodes/vhdl-mode.el index a841f87f3c3..f6cb2419de8 100644 --- a/lisp/progmodes/vhdl-mode.el +++ b/lisp/progmodes/vhdl-mode.el @@ -4953,8 +4953,8 @@ Key bindings: (defun vhdl-write-file-hooks-init () "Add/remove hooks when buffer is saved." (if vhdl-modify-date-on-saving - (add-hook 'local-write-file-hooks 'vhdl-template-modify-noerror nil t) - (remove-hook 'local-write-file-hooks 'vhdl-template-modify-noerror t)) + (add-hook 'write-file-functions 'vhdl-template-modify-noerror nil t) + (remove-hook 'write-file-functions 'vhdl-template-modify-noerror t)) (if (featurep 'xemacs) (make-local-hook 'after-save-hook)) (add-hook 'after-save-hook 'vhdl-add-modified-file nil t)) diff --git a/lisp/vc/ediff-merg.el b/lisp/vc/ediff-merg.el index ad72d7570c5..b67f520ca07 100644 --- a/lisp/vc/ediff-merg.el +++ b/lisp/vc/ediff-merg.el @@ -194,7 +194,7 @@ Buffer B." (defun ediff-set-merge-mode () (normal-mode t) - (remove-hook 'local-write-file-hooks 'ediff-set-merge-mode)) + (remove-hook 'write-file-functions 'ediff-set-merge-mode t)) ;; Go over all diffs starting with DIFF-NUM and copy regions into buffer C diff --git a/lisp/vc/ediff-util.el b/lisp/vc/ediff-util.el index 8670ba4603f..be36273592b 100644 --- a/lisp/vc/ediff-util.el +++ b/lisp/vc/ediff-util.el @@ -347,7 +347,7 @@ to invocation.") (goto-char (point-min)) (funcall (ediff-with-current-buffer buf major-mode)) (widen) ; merge buffer is always widened - (add-hook 'local-write-file-hooks 'ediff-set-merge-mode nil t) + (add-hook 'write-file-functions 'ediff-set-merge-mode nil t) ))) (setq buffer-read-only nil ediff-buffer-A buffer-A -- 2.39.2