branch: externals/auctex
commit 48d5874a44aed7d916346ac545fc5385c4092aa3
Author: Ikumi Keita <[email protected]>
Commit: Ikumi Keita <[email protected]>
Use `write-file-functions'
* tex.el (VirTeX-common-initialization):
* latex.el (BibTeX-auto-store):
Use `write-file-functions' instead of obsolete
`local-write-file-hooks' and `write-file-hooks'. Also, use local hook.
---
latex.el | 4 +---
tex.el | 6 ++----
2 files changed, 3 insertions(+), 7 deletions(-)
diff --git a/latex.el b/latex.el
index 0165242..cbd3e89 100644
--- a/latex.el
+++ b/latex.el
@@ -1873,9 +1873,7 @@ The value is actually the tail of the list of options
given to PACKAGE."
It will setup BibTeX to store keys in an auto file."
;; We want this to be early in the list, so we do not
;; add it before we enter BibTeX mode the first time.
- (if (boundp 'local-write-file-hooks)
- (add-hook 'local-write-file-hooks 'TeX-safe-auto-write)
- (add-hook 'write-file-hooks 'TeX-safe-auto-write))
+ (add-hook 'write-file-functions #'TeX-safe-auto-write nil t)
(TeX-bibtex-set-BibTeX-dialect)
(set (make-local-variable 'TeX-auto-update) 'BibTeX)
(set (make-local-variable 'TeX-auto-untabify) nil)
diff --git a/tex.el b/tex.el
index f5493a6..044dd22 100644
--- a/tex.el
+++ b/tex.el
@@ -3796,10 +3796,8 @@ The algorithm is as follows:
(funcall TeX-install-font-lock)
;; We want this to be early in the list, so we do not add it before
- ;; we enter TeX mode the first time.
- (if (boundp 'local-write-file-hooks)
- (add-hook 'local-write-file-hooks 'TeX-safe-auto-write)
- (add-hook 'write-file-hooks 'TeX-safe-auto-write))
+ ;; we enter TeX mode the first time.
+ (add-hook 'write-file-functions #'TeX-safe-auto-write nil t)
(set (make-local-variable 'TeX-auto-update) t)
(define-key TeX-mode-map "\C-xng" 'TeX-narrow-to-group)