diff options
| author | Stefan Kangas | 2024-06-23 15:41:23 +0200 |
|---|---|---|
| committer | Stefan Kangas | 2024-06-23 15:45:59 +0200 |
| commit | b9ce39ba809f49fe80d5b9a6d41afe1fe144fc77 (patch) | |
| tree | 9ad0fd3a4ef34393c38576eba6e3208ac47e809c | |
| parent | 39aa286072924ebef68b068fa9d9afc8374ede86 (diff) | |
| download | emacs-b9ce39ba809f49fe80d5b9a6d41afe1fe144fc77.tar.gz emacs-b9ce39ba809f49fe80d5b9a6d41afe1fe144fc77.zip | |
Prefer setq-local in reftex
* lisp/textmodes/reftex-global.el (reftex-find-duplicate-labels)
(reftex-isearch-minor-mode):
* lisp/textmodes/reftex-index.el (reftex-index-mode)
(reftex-display-index, reftex-index-initialize-phrases-buffer)
(reftex-index-phrases-mode):
* lisp/textmodes/reftex-sel.el (reftex-select-label-mode)
(reftex-select-bib-mode, reftex-insert-docstruct, reftex-select-item):
* lisp/textmodes/reftex-toc.el (reftex-toc-mode, reftex-toc):
* lisp/textmodes/reftex.el (reftex-fontify-select-label-buffer):
Prefer setq-local.
| -rw-r--r-- | lisp/textmodes/reftex-global.el | 23 | ||||
| -rw-r--r-- | lisp/textmodes/reftex-index.el | 21 | ||||
| -rw-r--r-- | lisp/textmodes/reftex-sel.el | 18 | ||||
| -rw-r--r-- | lisp/textmodes/reftex-toc.el | 18 | ||||
| -rw-r--r-- | lisp/textmodes/reftex.el | 6 |
5 files changed, 42 insertions, 44 deletions
diff --git a/lisp/textmodes/reftex-global.el b/lisp/textmodes/reftex-global.el index 0eaffec3b54..7b4407ec336 100644 --- a/lisp/textmodes/reftex-global.el +++ b/lisp/textmodes/reftex-global.el | |||
| @@ -152,7 +152,7 @@ No active TAGS table is required." | |||
| 152 | (setq dlist (reftex-uniquify-by-car dlist)) | 152 | (setq dlist (reftex-uniquify-by-car dlist)) |
| 153 | (if (null dlist) (error "No duplicate labels in document")) | 153 | (if (null dlist) (error "No duplicate labels in document")) |
| 154 | (switch-to-buffer-other-window "*Duplicate Labels*") | 154 | (switch-to-buffer-other-window "*Duplicate Labels*") |
| 155 | (set (make-local-variable 'TeX-master) master) | 155 | (setq-local TeX-master master) |
| 156 | (erase-buffer) | 156 | (erase-buffer) |
| 157 | (insert " MULTIPLE LABELS IN CURRENT DOCUMENT:\n") | 157 | (insert " MULTIPLE LABELS IN CURRENT DOCUMENT:\n") |
| 158 | (insert | 158 | (insert |
| @@ -492,17 +492,16 @@ With no argument, this command toggles | |||
| 492 | (with-current-buffer crt-buf | 492 | (with-current-buffer crt-buf |
| 493 | (when reftex-mode | 493 | (when reftex-mode |
| 494 | (if (boundp 'multi-isearch-next-buffer-function) | 494 | (if (boundp 'multi-isearch-next-buffer-function) |
| 495 | (set (make-local-variable | 495 | (setq-local multi-isearch-next-buffer-function |
| 496 | 'multi-isearch-next-buffer-function) | 496 | #'reftex-isearch-switch-to-next-file) |
| 497 | #'reftex-isearch-switch-to-next-file) | 497 | (setq-local isearch-wrap-function |
| 498 | (set (make-local-variable 'isearch-wrap-function) | 498 | #'reftex-isearch-wrap-function) |
| 499 | #'reftex-isearch-wrap-function) | 499 | (setq-local isearch-search-fun-function |
| 500 | (set (make-local-variable 'isearch-search-fun-function) | 500 | (lambda () #'reftex-isearch-isearch-search)) |
| 501 | (lambda () #'reftex-isearch-isearch-search)) | 501 | (setq-local isearch-push-state-function |
| 502 | (set (make-local-variable 'isearch-push-state-function) | 502 | #'reftex-isearch-push-state-function) |
| 503 | #'reftex-isearch-push-state-function) | 503 | (setq-local isearch-next-buffer-function |
| 504 | (set (make-local-variable 'isearch-next-buffer-function) | 504 | #'reftex-isearch-switch-to-next-file)) |
| 505 | #'reftex-isearch-switch-to-next-file)) | ||
| 506 | (setq reftex-isearch-minor-mode t)))) | 505 | (setq reftex-isearch-minor-mode t)))) |
| 507 | (add-hook 'reftex-mode-hook #'reftex-isearch-minor-mode)) | 506 | (add-hook 'reftex-mode-hook #'reftex-isearch-minor-mode)) |
| 508 | (dolist (crt-buf (buffer-list)) | 507 | (dolist (crt-buf (buffer-list)) |
diff --git a/lisp/textmodes/reftex-index.el b/lisp/textmodes/reftex-index.el index a93afd63855..db476ff5c0b 100644 --- a/lisp/textmodes/reftex-index.el +++ b/lisp/textmodes/reftex-index.el | |||
| @@ -387,9 +387,9 @@ Press `?' for a summary of important key bindings, or check the menu. | |||
| 387 | Here are all local bindings. | 387 | Here are all local bindings. |
| 388 | 388 | ||
| 389 | \\{reftex-index-mode-map}" | 389 | \\{reftex-index-mode-map}" |
| 390 | (set (make-local-variable 'revert-buffer-function) #'reftex-index-revert) | 390 | (setq-local revert-buffer-function #'reftex-index-revert) |
| 391 | (set (make-local-variable 'reftex-index-restriction-data) nil) | 391 | (setq-local reftex-index-restriction-data nil) |
| 392 | (set (make-local-variable 'reftex-index-restriction-indicator) nil) | 392 | (setq-local reftex-index-restriction-indicator nil) |
| 393 | (setq mode-line-format | 393 | (setq mode-line-format |
| 394 | (list "---- " 'mode-line-buffer-identification | 394 | (list "---- " 'mode-line-buffer-identification |
| 395 | " " 'global-mode-string | 395 | " " 'global-mode-string |
| @@ -511,9 +511,9 @@ With prefix 3, restrict index to region." | |||
| 511 | ;; If the buffer is currently restricted, empty it to force update. | 511 | ;; If the buffer is currently restricted, empty it to force update. |
| 512 | (when reftex-index-restriction-data | 512 | (when reftex-index-restriction-data |
| 513 | (reftex-erase-buffer)) | 513 | (reftex-erase-buffer)) |
| 514 | (set (make-local-variable 'reftex-last-index-file) calling-file) | 514 | (setq-local reftex-last-index-file calling-file) |
| 515 | (set (make-local-variable 'reftex-index-tag) index-tag) | 515 | (setq-local reftex-index-tag index-tag) |
| 516 | (set (make-local-variable 'reftex-docstruct-symbol) docstruct-symbol) | 516 | (setq-local reftex-docstruct-symbol docstruct-symbol) |
| 517 | (if restriction | 517 | (if restriction |
| 518 | (setq reftex-index-restriction-indicator (car restriction) | 518 | (setq reftex-index-restriction-indicator (car restriction) |
| 519 | reftex-index-restriction-data (cdr restriction)) | 519 | reftex-index-restriction-data (cdr restriction)) |
| @@ -1303,8 +1303,7 @@ If the buffer is non-empty, delete the old header first." | |||
| 1303 | (lambda (a _b) (equal (car a) default-macro)))) | 1303 | (lambda (a _b) (equal (car a) default-macro)))) |
| 1304 | macro entry key repeat) | 1304 | macro entry key repeat) |
| 1305 | 1305 | ||
| 1306 | (if master (set (make-local-variable 'TeX-master) | 1306 | (when master (setq-local TeX-master (file-name-nondirectory master))) |
| 1307 | (file-name-nondirectory master))) | ||
| 1308 | 1307 | ||
| 1309 | (when (> (buffer-size) 0) | 1308 | (when (> (buffer-size) 0) |
| 1310 | (goto-char 1) | 1309 | (goto-char 1) |
| @@ -1387,9 +1386,9 @@ Here are all local bindings. | |||
| 1387 | 1386 | ||
| 1388 | \\{reftex-index-phrases-mode-map}" | 1387 | \\{reftex-index-phrases-mode-map}" |
| 1389 | :syntax-table reftex-index-phrases-syntax-table | 1388 | :syntax-table reftex-index-phrases-syntax-table |
| 1390 | (set (make-local-variable 'font-lock-defaults) | 1389 | (setq-local font-lock-defaults |
| 1391 | reftex-index-phrases-font-lock-defaults) | 1390 | reftex-index-phrases-font-lock-defaults) |
| 1392 | (set (make-local-variable 'reftex-index-phrases-marker) (make-marker))) | 1391 | (setq-local reftex-index-phrases-marker (make-marker))) |
| 1393 | ;; (add-hook 'reftex-index-phrases-mode-hook #'turn-on-font-lock) | 1392 | ;; (add-hook 'reftex-index-phrases-mode-hook #'turn-on-font-lock) |
| 1394 | 1393 | ||
| 1395 | (defun reftex-index-next-phrase (&optional arg) | 1394 | (defun reftex-index-next-phrase (&optional arg) |
diff --git a/lisp/textmodes/reftex-sel.el b/lisp/textmodes/reftex-sel.el index fa36543daf4..aec89448481 100644 --- a/lisp/textmodes/reftex-sel.el +++ b/lisp/textmodes/reftex-sel.el | |||
| @@ -97,7 +97,7 @@ Press `?' for a summary of important key bindings. | |||
| 97 | During a selection process, these are the local bindings. | 97 | During a selection process, these are the local bindings. |
| 98 | 98 | ||
| 99 | \\{reftex-select-label-mode-map}" | 99 | \\{reftex-select-label-mode-map}" |
| 100 | (set (make-local-variable 'reftex-select-marked) nil) | 100 | (setq-local reftex-select-marked nil) |
| 101 | (when (syntax-table-p reftex-latex-syntax-table) | 101 | (when (syntax-table-p reftex-latex-syntax-table) |
| 102 | (set-syntax-table reftex-latex-syntax-table)) | 102 | (set-syntax-table reftex-latex-syntax-table)) |
| 103 | ;; We do not set a local map - reftex-select-item does this. | 103 | ;; We do not set a local map - reftex-select-item does this. |
| @@ -136,7 +136,7 @@ Press `?' for a summary of important key bindings. | |||
| 136 | During a selection process, these are the local bindings. | 136 | During a selection process, these are the local bindings. |
| 137 | 137 | ||
| 138 | \\{reftex-select-label-mode-map}" | 138 | \\{reftex-select-label-mode-map}" |
| 139 | (set (make-local-variable 'reftex-select-marked) nil) | 139 | (setq-local reftex-select-marked nil) |
| 140 | ;; We do not set a local map - reftex-select-item does this. | 140 | ;; We do not set a local map - reftex-select-item does this. |
| 141 | ) | 141 | ) |
| 142 | 142 | ||
| @@ -236,9 +236,9 @@ During a selection process, these are the local bindings. | |||
| 236 | (concat "\\`" (regexp-quote | 236 | (concat "\\`" (regexp-quote |
| 237 | (file-name-directory (reftex-TeX-master-file)))))) | 237 | (file-name-directory (reftex-TeX-master-file)))))) |
| 238 | 238 | ||
| 239 | (set (make-local-variable 'reftex-docstruct-symbol) docstruct-symbol) | 239 | (setq-local reftex-docstruct-symbol docstruct-symbol) |
| 240 | (set (make-local-variable 'reftex-prefix) | 240 | (setq-local reftex-prefix |
| 241 | (cdr (assoc labels reftex-typekey-to-prefix-alist))) | 241 | (cdr (assoc labels reftex-typekey-to-prefix-alist))) |
| 242 | (if (equal reftex-prefix " ") (setq reftex-prefix nil)) | 242 | (if (equal reftex-prefix " ") (setq reftex-prefix nil)) |
| 243 | 243 | ||
| 244 | ;; Walk the docstruct and insert the appropriate stuff | 244 | ;; Walk the docstruct and insert the appropriate stuff |
| @@ -459,7 +459,7 @@ During a selection process, these are the local bindings. | |||
| 459 | (reftex-find-start-point | 459 | (reftex-find-start-point |
| 460 | (point-min) offset reftex-last-data reftex-last-line) | 460 | (point-min) offset reftex-last-data reftex-last-line) |
| 461 | (beginning-of-line 1) | 461 | (beginning-of-line 1) |
| 462 | (set (make-local-variable 'reftex-last-follow-point) (point)) | 462 | (setq-local reftex-last-follow-point (point)) |
| 463 | 463 | ||
| 464 | (unwind-protect | 464 | (unwind-protect |
| 465 | (progn | 465 | (progn |
| @@ -480,9 +480,9 @@ During a selection process, these are the local bindings. | |||
| 480 | (mapc (lambda (c) (delete-overlay (nth 1 c))) | 480 | (mapc (lambda (c) (delete-overlay (nth 1 c))) |
| 481 | reftex-select-marked))))) | 481 | reftex-select-marked))))) |
| 482 | 482 | ||
| 483 | (set (make-local-variable 'reftex-last-line) | 483 | (setq-local reftex-last-line |
| 484 | (+ (count-lines (point-min) (point)) (if (bolp) 1 0))) | 484 | (+ (count-lines (point-min) (point)) (if (bolp) 1 0))) |
| 485 | (set (make-local-variable 'reftex-last-data) reftex--last-data) | 485 | (setq-local reftex-last-data reftex--last-data) |
| 486 | (reftex-kill-buffer "*RefTeX Help*") | 486 | (reftex-kill-buffer "*RefTeX Help*") |
| 487 | (setq reftex-callback-fwd (not reftex-callback-fwd)) ;; ;-))) | 487 | (setq reftex-callback-fwd (not reftex-callback-fwd)) ;; ;-))) |
| 488 | (message "") | 488 | (message "") |
diff --git a/lisp/textmodes/reftex-toc.el b/lisp/textmodes/reftex-toc.el index 1cc6e27e780..fe5a32f15f0 100644 --- a/lisp/textmodes/reftex-toc.el +++ b/lisp/textmodes/reftex-toc.el | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | ;;; reftex-toc.el --- RefTeX's table of contents mode -*- lexical-binding: t; -*- | 1 | ;;; reftex-toc.el --- RefTeX's table of contents mode -*- lexical-binding: t; -*- |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1997-2000, 2003-2024 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 1997-2024 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | ;; Author: Carsten Dominik <dominik@science.uva.nl> | 5 | ;; Author: Carsten Dominik <dominik@science.uva.nl> |
| 6 | ;; Maintainer: auctex-devel@gnu.org | 6 | ;; Maintainer: auctex-devel@gnu.org |
| @@ -125,13 +125,13 @@ Press `?' for a summary of important key bindings. | |||
| 125 | Here are all local bindings. | 125 | Here are all local bindings. |
| 126 | 126 | ||
| 127 | \\{reftex-toc-mode-map}" | 127 | \\{reftex-toc-mode-map}" |
| 128 | (set (make-local-variable 'transient-mark-mode) t) | 128 | (setq-local transient-mark-mode t) |
| 129 | (set (make-local-variable 'revert-buffer-function) #'reftex-toc-revert) | 129 | (setq-local revert-buffer-function #'reftex-toc-revert) |
| 130 | (set (make-local-variable 'reftex-toc-include-labels-indicator) "") | 130 | (setq-local reftex-toc-include-labels-indicator "") |
| 131 | (set (make-local-variable 'reftex-toc-max-level-indicator) | 131 | (setq-local reftex-toc-max-level-indicator |
| 132 | (if (= reftex-toc-max-level 100) | 132 | (if (= reftex-toc-max-level 100) |
| 133 | "ALL" | 133 | "ALL" |
| 134 | (int-to-string reftex-toc-max-level))) | 134 | (int-to-string reftex-toc-max-level))) |
| 135 | (setq mode-line-format | 135 | (setq mode-line-format |
| 136 | (list "---- " 'mode-line-buffer-identification | 136 | (list "---- " 'mode-line-buffer-identification |
| 137 | " " 'global-mode-string " (" mode-name ")" | 137 | " " 'global-mode-string " (" mode-name ")" |
| @@ -241,7 +241,7 @@ When called with a raw \\[universal-argument] prefix, rescan the document first. | |||
| 241 | (switch-to-buffer "*toc*")) | 241 | (switch-to-buffer "*toc*")) |
| 242 | 242 | ||
| 243 | (or (eq major-mode 'reftex-toc-mode) (reftex-toc-mode)) | 243 | (or (eq major-mode 'reftex-toc-mode) (reftex-toc-mode)) |
| 244 | (set (make-local-variable 'reftex-docstruct-symbol) docstruct-symbol) | 244 | (setq-local reftex-docstruct-symbol docstruct-symbol) |
| 245 | (setq reftex-toc-include-labels-indicator | 245 | (setq reftex-toc-include-labels-indicator |
| 246 | (if (eq reftex-toc-include-labels t) | 246 | (if (eq reftex-toc-include-labels t) |
| 247 | "ALL" | 247 | "ALL" |
diff --git a/lisp/textmodes/reftex.el b/lisp/textmodes/reftex.el index 6974a4be4a7..efe38337001 100644 --- a/lisp/textmodes/reftex.el +++ b/lisp/textmodes/reftex.el | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | ;;; reftex.el --- minor mode for doing \label, \ref, \cite, \index in LaTeX -*- lexical-binding: t; -*- | 1 | ;;; reftex.el --- minor mode for doing \label, \ref, \cite, \index in LaTeX -*- lexical-binding: t; -*- |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1997-2000, 2003-2024 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 1997-2024 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | ;; Author: Carsten Dominik <dominik@science.uva.nl> | 5 | ;; Author: Carsten Dominik <dominik@science.uva.nl> |
| 6 | ;; Maintainer: auctex-devel@gnu.org | 6 | ;; Maintainer: auctex-devel@gnu.org |
| @@ -2036,8 +2036,8 @@ IGNORE-WORDS List of words which should be removed from the string." | |||
| 2036 | ;; of font-lock) | 2036 | ;; of font-lock) |
| 2037 | (rename-buffer newname t) | 2037 | (rename-buffer newname t) |
| 2038 | ;; Good: we have the indirection functions | 2038 | ;; Good: we have the indirection functions |
| 2039 | (set (make-local-variable 'font-lock-fontify-region-function) | 2039 | (setq-local font-lock-fontify-region-function |
| 2040 | #'reftex-select-font-lock-fontify-region) | 2040 | #'reftex-select-font-lock-fontify-region) |
| 2041 | (let ((major-mode 'latex-mode)) | 2041 | (let ((major-mode 'latex-mode)) |
| 2042 | (font-lock-mode 1))) | 2042 | (font-lock-mode 1))) |
| 2043 | (rename-buffer oldname)))) | 2043 | (rename-buffer oldname)))) |