branch: master commit a1fb454702423b3d81910bbe9b26ec929bd25a5a Author: Arash Esbati <ar...@gnu.org> Commit: Arash Esbati <ar...@gnu.org>
Prefer `setq-local' in latex.el * latex.el (BibTeX-auto-store, docTeX-mode) (LaTeX-common-initialization): Prefer `setq-local' over `set' and `make-local-variable' combination. --- latex.el | 46 ++++++++++++++++++++++------------------------ 1 file changed, 22 insertions(+), 24 deletions(-) diff --git a/latex.el b/latex.el index 1fa7cc2f..b9014668 100644 --- a/latex.el +++ b/latex.el @@ -2324,10 +2324,10 @@ It will setup BibTeX to store keys in an auto file." ;; add it before we enter BibTeX mode the first time. (add-hook 'write-contents-functions #'TeX-safe-auto-write nil t) (TeX-bibtex-set-BibTeX-dialect) - (set (make-local-variable 'TeX-auto-untabify) nil) - (set (make-local-variable 'TeX-auto-parse-length) 999999) - (set (make-local-variable 'TeX-auto-regexp-list) BibTeX-auto-regexp-list) - (set (make-local-variable 'TeX-master) t)) + (setq-local TeX-auto-untabify nil) + (setq-local TeX-auto-parse-length 999999) + (setq-local TeX-auto-regexp-list BibTeX-auto-regexp-list) + (setq-local TeX-master t)) ;;; Macro Argument Hooks @@ -8331,8 +8331,8 @@ Run after mode hooks and file local variables application." "Major mode in AUCTeX for editing .dtx files derived from `LaTeX-mode'. Runs `LaTeX-mode', sets a few variables and runs the hooks in `docTeX-mode-hook'." - (set (make-local-variable 'LaTeX-insert-into-comments) t) - (set (make-local-variable 'LaTeX-syntactic-comments) t) + (setq-local LaTeX-insert-into-comments t) + (setq-local LaTeX-syntactic-comments t) (setq TeX-default-extension docTeX-default-extension) ;; Make filling and indentation aware of DocStrip guards. (setq paragraph-start (concat paragraph-start "\\|%<") @@ -8398,12 +8398,12 @@ function would return non-nil and `(match-string 1)' would return (defun LaTeX-common-initialization () "Common initialization for LaTeX derived modes." - (set (make-local-variable 'indent-line-function) #'LaTeX-indent-line) + (setq-local indent-line-function #'LaTeX-indent-line) ;; Filling - (set (make-local-variable 'paragraph-ignore-fill-prefix) t) - (set (make-local-variable 'fill-paragraph-function) #'LaTeX-fill-paragraph) - (set (make-local-variable 'adaptive-fill-mode) nil) + (setq-local paragraph-ignore-fill-prefix t) + (setq-local fill-paragraph-function #'LaTeX-fill-paragraph) + (setq-local adaptive-fill-mode nil) ;; Cater for \verb|...| (and similar) contructs which should not be ;; broken. (add-to-list (make-local-variable 'fill-nobreak-predicate) @@ -8414,11 +8414,11 @@ function would return non-nil and `(match-string 1)' would return (setq TeX-header-end LaTeX-header-end TeX-trailer-start LaTeX-trailer-start) - (set (make-local-variable 'TeX-style-hook-dialect) TeX-dialect) + (setq-local TeX-style-hook-dialect TeX-dialect) (require 'outline) - (set (make-local-variable 'outline-level) #'LaTeX-outline-level) - (set (make-local-variable 'outline-regexp) (LaTeX-outline-regexp t)) + (setq-local outline-level #'LaTeX-outline-level) + (setq-local outline-regexp (LaTeX-outline-regexp t)) (when (boundp 'outline-heading-alist) (setq outline-heading-alist (mapcar (lambda (x) @@ -8443,8 +8443,7 @@ function would return non-nil and `(match-string 1)' would return (setq TeX-verbatim-p-function #'LaTeX-verbatim-p) (setq TeX-search-forward-comment-start-function #'LaTeX-search-forward-comment-start) - (set (make-local-variable 'TeX-search-files-type-alist) - LaTeX-search-files-type-alist) + (setq-local TeX-search-files-type-alist LaTeX-search-files-type-alist) (setq-local beginning-of-defun-function #'LaTeX-find-matching-begin) (setq-local end-of-defun-function #'LaTeX-find-matching-end) @@ -8457,11 +8456,11 @@ function would return non-nil and `(match-string 1)' would return (add-hook 'completion-at-point-functions #'LaTeX--arguments-completion-at-point 5 t) - (set (make-local-variable 'LaTeX-item-list) '(("description" . LaTeX-item-argument) - ("thebibliography" . LaTeX-item-bib) - ("array" . LaTeX-item-array) - ("tabular" . LaTeX-item-array) - ("tabular*" . LaTeX-item-tabular*))) + (setq-local LaTeX-item-list '(("description" . LaTeX-item-argument) + ("thebibliography" . LaTeX-item-bib) + ("array" . LaTeX-item-array) + ("tabular" . LaTeX-item-array) + ("tabular*" . LaTeX-item-tabular*))) (LaTeX-add-environments '("document" LaTeX-env-document) @@ -9166,12 +9165,11 @@ function would return non-nil and `(match-string 1)' would return ;; functions will make sure that the default will get used unless the ;; user overrode it. - (set (make-local-variable 'imenu-create-index-function) - #'LaTeX-imenu-create-index-function) + (setq-local imenu-create-index-function + #'LaTeX-imenu-create-index-function) ;; Initialization of `add-log-current-defun-function': - (set (make-local-variable 'add-log-current-defun-function) - #'TeX-current-defun-name) + (setq-local add-log-current-defun-function #'TeX-current-defun-name) ;; Set LaTeX-specific help messages for error so that it's available ;; in `TeX-help-error'.