From: Stefan Kangas Date: Wed, 9 Dec 2020 08:44:38 +0000 (+0100) Subject: Prefer setq-local in most files X-Git-Tag: emacs-28.0.90~4829 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=c50c0a19e3c5478050dba547752105a8e16f3a49;p=emacs.git Prefer setq-local in most files * lisp/apropos.el (apropos-print): * lisp/buff-menu.el (Buffer-menu-mode): * lisp/calc/calc.el (calc-trail-buffer): * lisp/chistory.el (command-history-mode): * lisp/dabbrev.el: * lisp/dframe.el (dframe-frame-mode): * lisp/doc-view.el (doc-view-presentation-mode): * lisp/ebuff-menu.el (electric-buffer-menu-mode) (electric-buffer-update-highlight): * lisp/edmacro.el (edit-kbd-macro): * lisp/face-remap.el (buffer-face-set, buffer-face-toggle): * lisp/files.el: (find-file-noselect-1, hack-local-variables-confirm) (set-visited-file-name, revert-buffer--default): * lisp/filesets.el (filesets-spawn-external-viewer): * lisp/find-dired.el (find-dired): * lisp/find-lisp.el (find-lisp-find-dired-internal): * lisp/finder.el (finder-mode): * lisp/font-core.el (font-lock-default-function): * lisp/format.el (format-annotate-function): * lisp/help-fns.el (describe-variable): * lisp/help-mode.el (help-mode): * lisp/icomplete.el (icomplete-minibuffer-setup) (icomplete--in-region-setup): * lisp/ido.el (ido-completion-help, ido-tidy): * lisp/international/robin.el (robin-activate): * lisp/leim/quail/hangul.el (hangul-input-method-activate): * lisp/leim/quail/uni-input.el (ucs-input-activate): * lisp/man.el (Man-mode): * lisp/master.el (master-set-slave): * lisp/minibuffer.el (minibuffer-completion-help) (read-file-name-default): * lisp/outline.el (outline-minor-mode): * lisp/pcomplete.el (pcomplete-comint-setup): * lisp/proced.el (proced-mode): * lisp/recentf.el (recentf-edit-list, recentf-open-files-items): * lisp/replace.el (occur-1): * lisp/reveal.el (reveal-mode): * lisp/ruler-mode.el (ruler--save-header-line-format): * lisp/scroll-lock.el (scroll-lock-mode): * lisp/startup.el (normal-top-level, normal-splash-screen): * lisp/strokes.el (strokes-list-strokes): * lisp/thumbs.el (thumbs-insert-image, thumbs-show-thumbs-list): * lisp/tree-widget.el (tree-widget-set-theme): * lisp/window.el (read-buffer-to-switch): * lisp/xwidget.el (xwidget-webkit-begin-edit-textarea): Prefer setq-local. --- diff --git a/lisp/apropos.el b/lisp/apropos.el index 595db1d2f8e..97314cc489f 100644 --- a/lisp/apropos.el +++ b/lisp/apropos.el @@ -1225,8 +1225,8 @@ as a heading." (apropos-print-doc 6 'apropos-face t) (apropos-print-doc 5 'apropos-widget t) (apropos-print-doc 4 'apropos-plist nil)) - (set (make-local-variable 'truncate-partial-width-windows) t) - (set (make-local-variable 'truncate-lines) t)))) + (setq-local truncate-partial-width-windows t) + (setq-local truncate-lines t)))) (prog1 apropos-accumulator (setq apropos-accumulator ()))) ; permit gc diff --git a/lisp/buff-menu.el b/lisp/buff-menu.el index d06ba287879..5392519d718 100644 --- a/lisp/buff-menu.el +++ b/lisp/buff-menu.el @@ -269,8 +269,8 @@ In Buffer Menu mode, the following commands are defined: \\[revert-buffer] Update the list of buffers. \\[Buffer-menu-toggle-files-only] Toggle whether the menu displays only file buffers. \\[Buffer-menu-bury] Bury the buffer listed on this line." - (set (make-local-variable 'buffer-stale-function) - (lambda (&optional _noconfirm) 'fast)) + (setq-local buffer-stale-function + (lambda (&optional _noconfirm) 'fast)) (add-hook 'tabulated-list-revert-hook 'list-buffers--refresh nil t)) (defun buffer-menu (&optional arg) diff --git a/lisp/calc/calc.el b/lisp/calc/calc.el index 9d869f359bc..bb02281111f 100644 --- a/lisp/calc/calc.el +++ b/lisp/calc/calc.el @@ -2100,7 +2100,7 @@ the United States." (set-buffer calc-trail-buffer) (unless (derived-mode-p 'calc-trail-mode) (calc-trail-mode) - (set (make-local-variable 'calc-main-buffer) buf))))) + (setq-local calc-main-buffer buf))))) (or (and calc-trail-pointer (eq (marker-buffer calc-trail-pointer) calc-trail-buffer)) (with-current-buffer calc-trail-buffer diff --git a/lisp/chistory.el b/lisp/chistory.el index c9aa927b94f..98443bfa88f 100644 --- a/lisp/chistory.el +++ b/lisp/chistory.el @@ -140,7 +140,7 @@ The buffer is left in Command History mode." Keybindings: \\{command-history-mode-map}" (lisp-mode-variables nil) - (set (make-local-variable 'revert-buffer-function) 'command-history-revert) + (setq-local revert-buffer-function 'command-history-revert) (set-syntax-table emacs-lisp-mode-syntax-table)) (defcustom command-history-hook nil diff --git a/lisp/dabbrev.el b/lisp/dabbrev.el index a9df0314215..c8bb749eb38 100644 --- a/lisp/dabbrev.el +++ b/lisp/dabbrev.el @@ -45,7 +45,7 @@ ;; dabbrev-case-replace nil t ;; ;; Set the variables you want special for your mode like this: -;; (set (make-local-variable 'dabbrev-case-replace) nil) +;; (setq-local dabbrev-case-replace nil) ;; Then you don't interfere with other modes. ;; ;; If your mode handles buffers that refers to other buffers @@ -59,10 +59,10 @@ ;; Example for GNUS (when we write a reply, we want dabbrev to look in ;; the article for expansion): -;; (set (make-local-variable 'dabbrev-friend-buffer-function) -;; (lambda (buffer) -;; (with-current-buffer buffer -;; (memq major-mode '(news-reply-mode gnus-article-mode))))) +;; (setq-local dabbrev-friend-buffer-function +;; (lambda (buffer) +;; (with-current-buffer buffer +;; (memq major-mode '(news-reply-mode gnus-article-mode))))) ;; Known bugs and limitations. diff --git a/lisp/dframe.el b/lisp/dframe.el index 417477be27b..31e571410bc 100644 --- a/lisp/dframe.el +++ b/lisp/dframe.el @@ -280,7 +280,7 @@ CREATE-HOOK is a hook to run after creating a frame." ;; Enable mouse tracking in emacs (if dframe-track-mouse-function - (set (make-local-variable 'track-mouse) t)) ;this could be messy. + (setq-local track-mouse t)) ;this could be messy. ;; Override `temp-buffer-show-hook' so that help and such ;; put their stuff into a frame other than our own. @@ -290,10 +290,8 @@ CREATE-HOOK is a hook to run after creating a frame." ;; FIXME: Doesn't this get us into an inf-loop when the ;; `temp-buffer-show-function' runs `temp-buffer-show-hook' ;; (as is normally the case)? - (progn (make-local-variable 'temp-buffer-show-hook) - (setq temp-buffer-show-hook temp-buffer-show-function))) - (make-local-variable 'temp-buffer-show-function) - (setq temp-buffer-show-function 'dframe-temp-buffer-show-function) + (setq-local temp-buffer-show-hook temp-buffer-show-function)) + (setq-local temp-buffer-show-function 'dframe-temp-buffer-show-function) ;; If this buffer is killed, we must make sure that we destroy ;; the frame the dedicated window is in. (add-hook 'kill-buffer-hook (lambda () diff --git a/lisp/doc-view.el b/lisp/doc-view.el index 9997c1ae7b8..f7a7be96b3d 100644 --- a/lisp/doc-view.el +++ b/lisp/doc-view.el @@ -2055,7 +2055,7 @@ See the command `doc-view-mode' for more information on this mode." :init-value nil :keymap doc-view-presentation-mode-map (if doc-view-presentation-mode (progn - (set (make-local-variable 'mode-line-format) nil) + (setq-local mode-line-format nil) (doc-view-fit-page-to-window) ;; (doc-view-convert-all-pages) ) diff --git a/lisp/ebuff-menu.el b/lisp/ebuff-menu.el index 079fce88def..cf7b28a1e80 100644 --- a/lisp/ebuff-menu.el +++ b/lisp/ebuff-menu.el @@ -202,8 +202,7 @@ Electric Buffer Menu mode is a minor mode which is automatically enabled and disabled by the \\[electric-buffer-list] command. See the documentation of `electric-buffer-list' for details." (setq mode-line-buffer-identification "Electric Buffer List") - (set (make-local-variable 'Helper-return-blurb) - "return to buffer editing")) + (setq-local Helper-return-blurb "return to buffer editing")) (define-obsolete-function-alias 'Electric-buffer-menu-mode 'electric-buffer-menu-mode "24.3") @@ -270,8 +269,8 @@ Return to Electric Buffer Menu when done." (when (derived-mode-p 'electric-buffer-menu-mode) ;; Make sure we have an overlay to use. (or electric-buffer-overlay - (set (make-local-variable 'electric-buffer-overlay) - (make-overlay (point) (point)))) + (setq-local electric-buffer-overlay + (make-overlay (point) (point)))) (move-overlay electric-buffer-overlay (line-beginning-position) (line-end-position)) diff --git a/lisp/edmacro.el b/lisp/edmacro.el index 44cf5aad387..8ff766cee99 100644 --- a/lisp/edmacro.el +++ b/lisp/edmacro.el @@ -151,9 +151,9 @@ With a prefix argument, format the macro in a more concise way." (setq buffer-read-only nil) (setq major-mode 'edmacro-mode) (setq mode-name "Edit Macro") - (set (make-local-variable 'edmacro-original-buffer) oldbuf) - (set (make-local-variable 'edmacro-finish-hook) finish-hook) - (set (make-local-variable 'edmacro-store-hook) store-hook) + (setq-local edmacro-original-buffer oldbuf) + (setq-local edmacro-finish-hook finish-hook) + (setq-local edmacro-store-hook store-hook) (erase-buffer) (insert ";; Keyboard Macro Editor. Press C-c C-c to finish; " "press C-x k RET to cancel.\n") diff --git a/lisp/face-remap.el b/lisp/face-remap.el index 4ccd463aff2..13bbb5284a3 100644 --- a/lisp/face-remap.el +++ b/lisp/face-remap.el @@ -446,7 +446,7 @@ local, and sets it to FACE." (setq specs (car specs))) (if (null specs) (buffer-face-mode 0) - (set (make-local-variable 'buffer-face-mode-face) specs) + (setq-local buffer-face-mode-face specs) (buffer-face-mode t))) ;;;###autoload @@ -470,7 +470,7 @@ buffer local, and set it to SPECS." (if (or (null specs) (and buffer-face-mode (equal buffer-face-mode-face specs))) (buffer-face-mode 0) - (set (make-local-variable 'buffer-face-mode-face) specs) + (setq-local buffer-face-mode-face specs) (buffer-face-mode t))) (defun buffer-face-mode-invoke (specs arg &optional interactive) diff --git a/lisp/files.el b/lisp/files.el index 2cf77d5d7e9..a89d39e784d 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -597,7 +597,7 @@ settings being applied, but still respect file-local ones.") ;; This is an odd variable IMO. ;; You might wonder why it is needed, when we could just do: -;; (set (make-local-variable 'enable-local-variables) nil) +;; (setq-local enable-local-variables nil) ;; These two are not precisely the same. ;; Setting this variable does not cause -*- mode settings to be ;; ignored, whereas setting enable-local-variables does. @@ -2419,9 +2419,7 @@ Do you want to revisit the file normally now? "))) ;; this is a permanent local, the major mode won't eliminate it. (and backup-enable-predicate (not (funcall backup-enable-predicate buffer-file-name)) - (progn - (make-local-variable 'backup-inhibited) - (setq backup-inhibited t))) + (setq-local backup-inhibited t)) (if rawfile (progn (set-buffer-multibyte nil) @@ -3520,7 +3518,7 @@ n -- to ignore the local variables list.") (let ((print-escape-newlines t)) (prin1 (cdr elt) buf)) (insert "\n")) - (set (make-local-variable 'cursor-type) nil) + (setq-local cursor-type nil) (set-buffer-modified-p nil) (goto-char (point-min))) @@ -4492,9 +4490,7 @@ the old visited file has been renamed to the new name FILENAME." (and buffer-file-name backup-enable-predicate (not (funcall backup-enable-predicate buffer-file-name)) - (progn - (make-local-variable 'backup-inhibited) - (setq backup-inhibited t))) + (setq-local backup-inhibited t)) (let ((oauto buffer-auto-save-file-name)) (cond ((null filename) (setq buffer-auto-save-file-name nil)) @@ -6219,7 +6215,7 @@ Non-file buffers need a custom function." ;; Run after-revert-hook as it was before we reverted. (setq-default revert-buffer-internal-hook global-hook) (if local-hook - (set (make-local-variable 'revert-buffer-internal-hook) + (setq-local revert-buffer-internal-hook local-hook) (kill-local-variable 'revert-buffer-internal-hook)) (run-hooks 'revert-buffer-internal-hook)) diff --git a/lisp/filesets.el b/lisp/filesets.el index 883871c4d80..62dc5a54d53 100644 --- a/lisp/filesets.el +++ b/lisp/filesets.el @@ -1336,8 +1336,7 @@ Use the viewer defined in EV-ENTRY (a valid element of (progn (switch-to-buffer (format "Filesets: %s %s" vwr file)) (insert output) - (make-local-variable 'filesets-output-buffer-flag) - (setq filesets-output-buffer-flag t) + (setq-local filesets-output-buffer-flag t) (set-visited-file-name file t) (when oh (run-hooks 'oh)) diff --git a/lisp/find-dired.el b/lisp/find-dired.el index 18330d821ce..d2b82bdd51c 100644 --- a/lisp/find-dired.el +++ b/lisp/find-dired.el @@ -223,11 +223,10 @@ it finishes, type \\[kill-find]." (set-keymap-parent map (current-local-map)) (define-key map "\C-c\C-k" 'kill-find) (use-local-map map)) - (make-local-variable 'dired-sort-inhibit) - (setq dired-sort-inhibit t) - (set (make-local-variable 'revert-buffer-function) - `(lambda (ignore-auto noconfirm) - (find-dired ,dir ,find-args))) + (setq-local dired-sort-inhibit t) + (setq-local revert-buffer-function + `(lambda (ignore-auto noconfirm) + (find-dired ,dir ,find-args))) ;; Set subdir-alist so that Tree Dired will work: (if (fboundp 'dired-simple-subdir-alist) ;; will work even with nested dired format (dired-nstd.el,v 1.15 @@ -235,9 +234,9 @@ it finishes, type \\[kill-find]." (dired-simple-subdir-alist) ;; else we have an ancient tree dired (or classic dired, where ;; this does no harm) - (set (make-local-variable 'dired-subdir-alist) - (list (cons default-directory (point-min-marker))))) - (set (make-local-variable 'dired-subdir-switches) find-ls-subdir-switches) + (setq-local dired-subdir-alist + (list (cons default-directory (point-min-marker))))) + (setq-local dired-subdir-switches find-ls-subdir-switches) (setq buffer-read-only nil) ;; Subdir headlerline must come first because the first marker in ;; subdir-alist points there. diff --git a/lisp/find-lisp.el b/lisp/find-lisp.el index c1be5ff403d..44a2e6d7371 100644 --- a/lisp/find-lisp.el +++ b/lisp/find-lisp.el @@ -212,21 +212,17 @@ It is a function which takes two arguments, the directory and its parent." (use-local-map (append (make-sparse-keymap) (current-local-map))) - (make-local-variable 'find-lisp-file-predicate) - (setq find-lisp-file-predicate file-predicate) - (make-local-variable 'find-lisp-directory-predicate) - (setq find-lisp-directory-predicate directory-predicate) - (make-local-variable 'find-lisp-regexp) - (setq find-lisp-regexp regexp) - - (make-local-variable 'revert-buffer-function) - (setq revert-buffer-function - (lambda (_ignore1 _ignore2) - (find-lisp-insert-directory - default-directory - find-lisp-file-predicate - find-lisp-directory-predicate - 'ignore))) + (setq-local find-lisp-file-predicate file-predicate) + (setq-local find-lisp-directory-predicate directory-predicate) + (setq-local find-lisp-regexp regexp) + + (setq-local revert-buffer-function + (lambda (_ignore1 _ignore2) + (find-lisp-insert-directory + default-directory + find-lisp-file-predicate + find-lisp-directory-predicate + 'ignore))) ;; Set subdir-alist so that Tree Dired will work: (if (fboundp 'dired-simple-subdir-alist) @@ -235,8 +231,8 @@ It is a function which takes two arguments, the directory and its parent." (dired-simple-subdir-alist) ;; else we have an ancient tree dired (or classic dired, where ;; this does no harm) - (set (make-local-variable 'dired-subdir-alist) - (list (cons default-directory (point-min-marker))))) + (setq-local dired-subdir-alist + (list (cons default-directory (point-min-marker))))) (find-lisp-insert-directory dir file-predicate directory-predicate 'ignore) (goto-char (point-min)) diff --git a/lisp/finder.el b/lisp/finder.el index a59a185cc9b..98859f6a395 100644 --- a/lisp/finder.el +++ b/lisp/finder.el @@ -448,7 +448,7 @@ FILE should be in a form suitable for passing to `locate-library'." :syntax-table finder-mode-syntax-table (setq buffer-read-only t buffer-undo-list t) - (set (make-local-variable 'finder-headmark) nil)) + (setq-local finder-headmark nil)) (defun finder-summary () "Summarize basic Finder commands." diff --git a/lisp/font-core.el b/lisp/font-core.el index 098253eb162..1b15d8cd30e 100644 --- a/lisp/font-core.el +++ b/lisp/font-core.el @@ -160,8 +160,8 @@ this function onto `change-major-mode-hook'." (defun font-lock-default-function (mode) ;; Turn on Font Lock mode. (when mode - (set (make-local-variable 'char-property-alias-alist) - (copy-tree char-property-alias-alist)) + (setq-local char-property-alias-alist + (copy-tree char-property-alias-alist)) ;; Add `font-lock-face' as an alias for the `face' property. (let ((elt (assq 'face char-property-alias-alist))) (if elt @@ -171,8 +171,8 @@ this function onto `change-major-mode-hook'." ;; Turn off Font Lock mode. (unless mode ;; Remove `font-lock-face' as an alias for the `face' property. - (set (make-local-variable 'char-property-alias-alist) - (copy-tree char-property-alias-alist)) + (setq-local char-property-alias-alist + (copy-tree char-property-alias-alist)) (let ((elt (assq 'face char-property-alias-alist))) (when elt (setcdr elt (remq 'font-lock-face (cdr elt))) diff --git a/lisp/format.el b/lisp/format.el index 905ca2d9ec9..16456eb5877 100644 --- a/lisp/format.el +++ b/lisp/format.el @@ -237,9 +237,8 @@ For most purposes, consider using `format-encode-region' instead." ;; delete the buffer once the write is done, but do ;; it after running to-fn so it doesn't affect ;; write-region calls in to-fn. - (set (make-local-variable - 'write-region-post-annotation-function) - 'kill-buffer))) + (setq-local write-region-post-annotation-function + #'kill-buffer))) nil) ;; Otherwise just call function, it will return annotations. (funcall to-fn from to orig-buf))))) diff --git a/lisp/help-fns.el b/lisp/help-fns.el index 1c55d0ed79a..043c79f3900 100644 --- a/lisp/help-fns.el +++ b/lisp/help-fns.el @@ -1137,8 +1137,7 @@ it is displayed along with the global value." (when (looking-at "value is") (replace-match "")) (save-excursion (insert "\n\nValue:") - (set (make-local-variable 'help-button-cache) - (point-marker))) + (setq-local help-button-cache (point-marker))) (insert "value is shown ") (insert-button "below" 'action help-button-cache diff --git a/lisp/help-mode.el b/lisp/help-mode.el index 732e6cc28dd..025a67016b6 100644 --- a/lisp/help-mode.el +++ b/lisp/help-mode.el @@ -319,10 +319,10 @@ The format is (FUNCTION ARGS...).") Entry to this mode runs the normal hook `help-mode-hook'. Commands: \\{help-mode-map}" - (set (make-local-variable 'revert-buffer-function) - 'help-mode-revert-buffer) - (set (make-local-variable 'bookmark-make-record-function) - 'help-bookmark-make-record)) + (setq-local revert-buffer-function + #'help-mode-revert-buffer) + (setq-local bookmark-make-record-function + #'help-bookmark-make-record)) ;;;###autoload (defun help-mode-setup () diff --git a/lisp/icomplete.el b/lisp/icomplete.el index 676917b9da5..0fdacd0a3c6 100644 --- a/lisp/icomplete.el +++ b/lisp/icomplete.el @@ -441,7 +441,7 @@ Conditions are: "Run in minibuffer on activation to establish incremental completion. Usually run by inclusion in `minibuffer-setup-hook'." (when (and icomplete-mode (icomplete-simple-completing-p)) - (set (make-local-variable 'completion-show-inline-help) nil) + (setq-local completion-show-inline-help nil) (use-local-map (make-composed-keymap icomplete-minibuffer-map (current-local-map))) (add-hook 'pre-command-hook #'icomplete-pre-command-hook nil t) @@ -464,7 +464,7 @@ Usually run by inclusion in `minibuffer-setup-hook'." (when (and completion-in-region-mode icomplete-mode (icomplete-simple-completing-p)) (setq icomplete--in-region-buffer (current-buffer)) - (set (make-local-variable 'completion-show-inline-help) nil) + (setq-local completion-show-inline-help nil) (let ((tem (assq 'completion-in-region-mode minor-mode-overriding-map-alist))) (unless (memq icomplete-minibuffer-map (cdr tem)) diff --git a/lisp/ido.el b/lisp/ido.el index c83b700e656..5758d3fdeac 100644 --- a/lisp/ido.el +++ b/lisp/ido.el @@ -3966,7 +3966,7 @@ If `ido-change-word-sub' cannot be found in WORD, return nil." (boundp 'ido-completion-buffer-full)) (set-window-start win (point-min)) (with-no-warnings - (set (make-local-variable 'ido-completion-buffer-full) t)) + (setq-local ido-completion-buffer-full t)) (setq full-list t display-it t)) (scroll-other-window)) @@ -4810,8 +4810,7 @@ Modified from `icomplete-completions'." (delete-region ido-eoinput (point-max)))) ;; Reestablish the local variable 'cause minibuffer-setup is weird: - (make-local-variable 'ido-eoinput) - (setq ido-eoinput 1)))) + (setq-local ido-eoinput 1)))) (defun ido-summary-buffers-to-end () ;; Move the summaries to the end of the buffer list. diff --git a/lisp/international/robin.el b/lisp/international/robin.el index 94d2bf18088..16cac07c773 100644 --- a/lisp/international/robin.el +++ b/lisp/international/robin.el @@ -424,8 +424,7 @@ While this input method is active, the variable (add-hook 'minibuffer-exit-hook 'robin-exit-from-minibuffer)) (run-hooks 'input-method-activate-hook 'robin-activate-hook) - (set (make-local-variable 'input-method-function) - 'robin-input-method))) + (setq-local input-method-function 'robin-input-method))) (define-obsolete-variable-alias 'robin-inactivate-hook diff --git a/lisp/leim/quail/hangul.el b/lisp/leim/quail/hangul.el index b8562556eff..16f8de9cfbe 100644 --- a/lisp/leim/quail/hangul.el +++ b/lisp/leim/quail/hangul.el @@ -525,7 +525,7 @@ HELP-TEXT is a text set in `hangul-input-method-help-text'." (quail-delete-overlays) (if (eq (selected-window) (minibuffer-window)) (add-hook 'minibuffer-exit-hook 'quail-exit-from-minibuffer)) - (set (make-local-variable 'input-method-function) func)) + (setq-local input-method-function func)) (defun hangul-input-method-deactivate () "Deactivate the current Hangul input method." diff --git a/lisp/leim/quail/uni-input.el b/lisp/leim/quail/uni-input.el index 6f1fbcc9e5a..bee73d8e743 100644 --- a/lisp/leim/quail/uni-input.el +++ b/lisp/leim/quail/uni-input.el @@ -105,8 +105,7 @@ While this input method is active, the variable (quail-delete-overlays) (if (eq (selected-window) (minibuffer-window)) (add-hook 'minibuffer-exit-hook 'quail-exit-from-minibuffer)) - (set (make-local-variable 'input-method-function) - 'ucs-input-method))) + (setq-local input-method-function 'ucs-input-method))) (defun ucs-input-deactivate () "Deactivate UCS input method." diff --git a/lisp/man.el b/lisp/man.el index 991b1bb60e5..8430201c562 100644 --- a/lisp/man.el +++ b/lisp/man.el @@ -1583,10 +1583,10 @@ The following key bindings are currently in effect in the buffer: (auto-fill-mode -1) (setq imenu-generic-expression (list (list nil Man-heading-regexp 0))) (imenu-add-to-menubar man-imenu-title) - (set (make-local-variable 'outline-regexp) Man-heading-regexp) - (set (make-local-variable 'outline-level) (lambda () 1)) - (set (make-local-variable 'bookmark-make-record-function) - 'Man-bookmark-make-record) + (setq-local outline-regexp Man-heading-regexp) + (setq-local outline-level (lambda () 1)) + (setq-local bookmark-make-record-function + #'Man-bookmark-make-record) (add-hook 'window-state-change-functions #'Man--window-state-change nil t)) (defun Man-build-section-list () diff --git a/lisp/master.el b/lisp/master.el index 32556a535f3..88baa1f8218 100644 --- a/lisp/master.el +++ b/lisp/master.el @@ -96,8 +96,7 @@ yourself the value of `master-of' by calling `master-show-slave'." "Makes BUFFER the slave of the current buffer. Use \\[master-mode] to toggle control of the slave buffer." (interactive "bSlave: ") - (make-local-variable 'master-of) - (setq master-of buffer) + (setq-local master-of buffer) (run-hooks 'master-set-slave-hook)) (defun master-show-slave () diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index d44d8968221..456193d52e1 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -2067,14 +2067,14 @@ variables.") (funcall aff-fun completions))) (with-current-buffer standard-output - (set (make-local-variable 'completion-base-position) + (setq-local completion-base-position (list (+ start base-size) ;; FIXME: We should pay attention to completion ;; boundaries here, but currently ;; completion-all-completions does not give us the ;; necessary information. end)) - (set (make-local-variable 'completion-list-insert-choice-function) + (setq-local completion-list-insert-choice-function (let ((ctable minibuffer-completion-table) (cpred minibuffer-completion-predicate) (cprops completion-extra-properties)) @@ -2866,7 +2866,7 @@ See `read-file-name' for the meaning of the arguments." ;; On the first request on `M-n' fill ;; `minibuffer-default' with a list of defaults ;; relevant for file-name reading. - (set (make-local-variable 'minibuffer-default-add-function) + (setq-local minibuffer-default-add-function (lambda () (with-current-buffer (window-buffer (minibuffer-selected-window)) diff --git a/lisp/outline.el b/lisp/outline.el index 9b11b86b9d2..85f9de4e1b4 100644 --- a/lisp/outline.el +++ b/lisp/outline.el @@ -318,7 +318,7 @@ See the command `outline-mode' for more information on this mode." (add-hook 'change-major-mode-hook (lambda () (outline-minor-mode -1)) nil t) - (set (make-local-variable 'line-move-ignore-invisible) t) + (setq-local line-move-ignore-invisible t) ;; Cause use of ellipses for invisible text. (add-to-invisibility-spec '(outline . t))) (setq line-move-ignore-invisible nil) diff --git a/lisp/pcomplete.el b/lisp/pcomplete.el index a744165e0d5..a24df93a828 100644 --- a/lisp/pcomplete.el +++ b/lisp/pcomplete.el @@ -738,12 +738,12 @@ user actually typed in." COMPLETEF-SYM should be the symbol where the dynamic-complete-functions are kept. For comint mode itself, this is `comint-dynamic-complete-functions'." - (set (make-local-variable 'pcomplete-parse-arguments-function) - #'pcomplete-parse-comint-arguments) + (setq-local pcomplete-parse-arguments-function + #'pcomplete-parse-comint-arguments) (add-hook 'completion-at-point-functions #'pcomplete-completions-at-point nil 'local) - (set (make-local-variable completef-sym) - (copy-sequence (symbol-value completef-sym))) + (setq-local ompletef-sym + (copy-sequence (symbol-value completef-sym))) (let* ((funs (symbol-value completef-sym)) (elem (or (memq 'comint-filename-completion funs) (memq 'shell-filename-completion funs) diff --git a/lisp/proced.el b/lisp/proced.el index 203d70331ce..5d4318d81f6 100644 --- a/lisp/proced.el +++ b/lisp/proced.el @@ -664,9 +664,9 @@ After displaying or updating a Proced buffer, Proced runs the normal hook truncate-lines t header-line-format '(:eval (proced-header-line))) (add-hook 'post-command-hook #'force-mode-line-update nil t) ;; FIXME: Why? - (set (make-local-variable 'revert-buffer-function) #'proced-revert) - (set (make-local-variable 'font-lock-defaults) - '(proced-font-lock-keywords t nil nil beginning-of-line)) + (setq-local revert-buffer-function #'proced-revert) + (setq-local font-lock-defaults + '(proced-font-lock-keywords t nil nil beginning-of-line)) (if (and (not proced-auto-update-timer) proced-auto-update-interval) (setq proced-auto-update-timer (run-at-time t proced-auto-update-interval diff --git a/lisp/recentf.el b/lisp/recentf.el index 61c39de12b2..746363728b0 100644 --- a/lisp/recentf.el +++ b/lisp/recentf.el @@ -1127,7 +1127,7 @@ IGNORE arguments." (unless recentf-list (error "The list of recent files is empty")) (recentf-dialog (format "*%s - Edit list*" recentf-menu-title) - (set (make-local-variable 'recentf-edit-list) nil) + (setq-local recentf-edit-list nil) (widget-insert (format-message "Click on OK to delete selected files from the recent list. @@ -1196,8 +1196,8 @@ IGNORE other arguments." (defun recentf-open-files-items (files) "Return a list of widgets to display FILES in a dialog buffer." - (set (make-local-variable 'recentf--files-with-key) - (recentf-trunc-list files 10)) + (setq-local recentf--files-with-key + (recentf-trunc-list files 10)) (mapcar 'recentf-open-files-item (append ;; When requested group the files with shortcuts together diff --git a/lisp/replace.el b/lisp/replace.el index 3a2ab1d24c8..5ebc5493012 100644 --- a/lisp/replace.el +++ b/lisp/replace.el @@ -1706,7 +1706,7 @@ See also `multi-occur'." (buffer-undo-list t) (occur--final-pos nil)) (erase-buffer) - (set (make-local-variable 'occur-highlight-regexp) regexp) + (setq-local occur-highlight-regexp regexp) (let ((count (if (stringp nlines) ;; Treat nlines as a regexp to collect. diff --git a/lisp/reveal.el b/lisp/reveal.el index f9e38646349..b4558e1bebb 100644 --- a/lisp/reveal.el +++ b/lisp/reveal.el @@ -233,7 +233,7 @@ Also see the `reveal-auto-hide' variable." :keymap reveal-mode-map (if reveal-mode (progn - (set (make-local-variable 'search-invisible) t) + (setq-local search-invisible t) (add-hook 'post-command-hook 'reveal-post-command nil t)) (kill-local-variable 'search-invisible) (remove-hook 'post-command-hook 'reveal-post-command t))) diff --git a/lisp/ruler-mode.el b/lisp/ruler-mode.el index 82e6178da14..d97abca9ee7 100644 --- a/lisp/ruler-mode.el +++ b/lisp/ruler-mode.el @@ -584,8 +584,8 @@ format first." (when (and (not ruler-mode) (local-variable-p 'header-line-format) (not (local-variable-p 'ruler-mode-header-line-format-old))) - (set (make-local-variable 'ruler-mode-header-line-format-old) - header-line-format)) + (setq-local ruler-mode-header-line-format-old + header-line-format)) (setq header-line-format ruler-mode-header-line-format)) ;;;###autoload diff --git a/lisp/scroll-lock.el b/lisp/scroll-lock.el index f20ea1bcc87..31808be4372 100644 --- a/lisp/scroll-lock.el +++ b/lisp/scroll-lock.el @@ -64,7 +64,7 @@ MS-Windows systems if `w32-scroll-lock-modifier' is non-nil." (progn (setq scroll-lock-preserve-screen-pos-save scroll-preserve-screen-position) - (set (make-local-variable 'scroll-preserve-screen-position) 'always)) + (setq-local scroll-preserve-screen-position 'always)) (setq scroll-preserve-screen-position scroll-lock-preserve-screen-pos-save))) diff --git a/lisp/startup.el b/lisp/startup.el index 9f67dfde124..b652977798a 100644 --- a/lisp/startup.el +++ b/lisp/startup.el @@ -633,7 +633,7 @@ It is the default value of the variable `top-level'." (with-current-buffer "*Messages*" (messages-buffer-mode) ;; Make it easy to do like "tail -f". - (set (make-local-variable 'window-point-insertion-type) t) + (setq-local window-point-insertion-type t) ;; Give *Messages* the same default-directory as *scratch*, ;; just to keep things predictable. (setq default-directory (or dir (expand-file-name "~/"))))) @@ -1999,7 +1999,7 @@ splash screen in another window." (setq buffer-read-only nil) (erase-buffer) (setq default-directory command-line-default-directory) - (set (make-local-variable 'tab-width) 8) + (setq-local tab-width 8) (if pure-space-overflow (insert pure-space-overflow-message)) diff --git a/lisp/strokes.el b/lisp/strokes.el index 11bc07a29cc..044872068f4 100644 --- a/lisp/strokes.el +++ b/lisp/strokes.el @@ -1231,8 +1231,8 @@ the stroke as a character in some language." ;; mode-popup-menu edit-strokes-menu) ; what about extent-specific stuff? ;; (and (featurep 'menubar) ;; current-menubar -;; (set (make-local-variable 'current-menubar) -;; (copy-sequence current-menubar)) +;; (setq-local current-menubar +;; (copy-sequence current-menubar)) ;; (add-submenu nil edit-strokes-menu))) ;;(let ((map edit-strokes-mode-map)) @@ -1363,13 +1363,13 @@ If STROKES-MAP is not given, `strokes-global-map' will be used instead." finally do (unless (eobp) (kill-region (1+ (point)) (point-max)))) (view-buffer "*Strokes List*" nil) - (set (make-local-variable 'view-mode-map) - (let ((map (copy-keymap view-mode-map))) - (define-key map "q" `(lambda () - (interactive) - (View-quit) - (set-window-configuration ,config))) - map)) + (setq-local view-mode-map + (let ((map (copy-keymap view-mode-map))) + (define-key map "q" `(lambda () + (interactive) + (View-quit) + (set-window-configuration ,config))) + map)) (goto-char (point-min)))) (defun strokes-alphabetic-lessp (stroke1 stroke2) diff --git a/lisp/thumbs.el b/lisp/thumbs.el index 3aa7ff0836b..93b7c08d62f 100644 --- a/lisp/thumbs.el +++ b/lisp/thumbs.el @@ -347,8 +347,7 @@ If MARKED is non-nil, the image is marked." :conversion ,(if marked 'disabled) :margin ,thumbs-margin))) (insert-image i) - (set (make-local-variable 'thumbs-current-image-size) - (image-size i t)))) + (setq-local thumbs-current-image-size (image-size i t)))) (defun thumbs-insert-thumb (img &optional marked) "Insert the thumbnail for IMG at point. @@ -387,7 +386,7 @@ If MARKED is non-nil, the image is marked." (if dir (setq default-directory dir)) (thumbs-do-thumbs-insertion list) (goto-char (point-min)) - (set (make-local-variable 'thumbs-current-dir) default-directory))) + (setq-local thumbs-current-dir default-directory))) ;;;###autoload (defun thumbs-show-from-dir (dir &optional reg same-window) diff --git a/lisp/tree-widget.el b/lisp/tree-widget.el index 45d3f28ea07..e8a71a38df6 100644 --- a/lisp/tree-widget.el +++ b/lisp/tree-widget.el @@ -260,10 +260,9 @@ Typically it should contain something like this: \\='(:ascent center :mask (heuristic t)))" (or name (setq name (or tree-widget-theme "default"))) (unless (string-equal name (tree-widget-theme-name)) - (set (make-local-variable 'tree-widget--theme) - (make-vector 4 nil)) - (tree-widget-set-parent-theme name) - (tree-widget-set-parent-theme "default"))) + (setq-local tree-widget--theme (make-vector 4 nil)) + (tree-widget-set-parent-theme name) + (tree-widget-set-parent-theme "default"))) (defun tree-widget--locate-sub-directory (name path) "Locate all occurrences of the sub-directory NAME in PATH. diff --git a/lisp/window.el b/lisp/window.el index daa5c67df8b..67c3992c3f9 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -8390,9 +8390,9 @@ from the list of completions and default values." ;; here manually. (if (and (boundp 'icomplete-with-completion-tables) (listp icomplete-with-completion-tables)) - (set (make-local-variable 'icomplete-with-completion-tables) - (cons rbts-completion-table - icomplete-with-completion-tables)))) + (setq-local icomplete-with-completion-tables + (cons rbts-completion-table + icomplete-with-completion-tables)))) (read-buffer prompt (other-buffer (current-buffer)) (confirm-nonexistent-file-or-buffer))))) diff --git a/lisp/xwidget.el b/lisp/xwidget.el index caf57ae43fe..9d502d772bd 100644 --- a/lisp/xwidget.el +++ b/lisp/xwidget.el @@ -451,7 +451,7 @@ function findactiveelement(doc){ XW is the xwidget identifier, TEXT is retrieved from the webkit." (switch-to-buffer (generate-new-buffer "textarea")) - (set (make-local-variable 'xwidget-xwbl) xw) + (setq-local xwidget-xwbl xw) (insert text)) (defun xwidget-webkit-end-edit-textarea ()