]> git.eshelyaron.com Git - emacs.git/commitdiff
Prefer setq-local in more places
authorStefan Kangas <stefankangas@gmail.com>
Sun, 4 Feb 2024 12:16:59 +0000 (13:16 +0100)
committerEshel Yaron <me@eshelyaron.com>
Wed, 7 Feb 2024 10:49:52 +0000 (11:49 +0100)
* lisp/erc/erc-compat.el (erc-set-write-file-functions):
* lisp/obsolete/iswitchb.el (iswitchb-minibuffer-setup-hook)
(iswitchb-minibuffer-setup):
* lisp/obsolete/longlines.el (longlines-mode):
* lisp/obsolete/rcompile.el (remote-compile):
* lisp/progmodes/cperl-mode.el (cperl-file-style):
* test/lisp/erc/erc-tests.el (erc-ring-previous-command):
Prefer setq-local.

(cherry picked from commit 70c10204f0025eac844a88b0ef85cfca44cff61c)

lisp/erc/erc-compat.el
lisp/obsolete/iswitchb.el
lisp/obsolete/longlines.el
lisp/obsolete/rcompile.el
lisp/progmodes/cperl-mode.el
test/lisp/erc/erc-tests.el

index dede833a93ded643dcf7580a56964314a9fee405..37fcdebbe7b15d0db293ddca7ff55480095dbb08 100644 (file)
@@ -102,7 +102,7 @@ See `erc-encoding-coding-alist'."
 
 (defun erc-set-write-file-functions (new-val)
   (declare (obsolete nil "28.1"))
-  (set (make-local-variable 'write-file-functions) new-val))
+  (setq-local 'write-file-functions new-val))
 
 (defvar erc-emacs-build-time
   (if (or (stringp emacs-build-time) (not emacs-build-time))
index 3f05b7fe7acdfaa6ac602310a3c436292bbb30d2..d541dc085c680c67f7dcfb0988ce9053dc0a938d 100644 (file)
@@ -370,7 +370,7 @@ See documentation of `walk-windows' for useful values."
 This hook is run during minibuffer setup if `iswitchb' is active.
 For instance:
 \(add-hook \\='iswitchb-minibuffer-setup-hook
-         \\='\(lambda () (set (make-local-variable \\='max-mini-window-height) 3)))
+          \\='\(lambda () (setq-local \\='max-mini-window-height 3)))
 will constrain the minibuffer to a maximum height of 3 lines when
 iswitchb is running."
   :type 'hook)
@@ -1262,7 +1262,7 @@ Modified from `icomplete-completions'."
   "Set up minibuffer for `iswitchb-buffer'.
 Copied from `icomplete-minibuffer-setup-hook'."
   (when (iswitchb-entryfn-p)
-    (set (make-local-variable 'iswitchb-use-mycompletion) t)
+    (setq-local 'iswitchb-use-mycompletion t)
     (add-hook 'pre-command-hook #'iswitchb-pre-command nil t)
     (add-hook 'post-command-hook #'iswitchb-post-command nil t)
     (run-hooks 'iswitchb-minibuffer-setup-hook)))
index 6aa388805f2e0eebd0c5ac89779c06b3d810187f..e73e9e0c85b8da1976f27a9250d1b8320795b7cc 100644 (file)
@@ -116,17 +116,14 @@ newlines are indicated with a symbol."
       ;; Turn on longlines mode
       (progn
         (use-hard-newlines 1 'never)
-        (set (make-local-variable 'require-final-newline) nil)
+        (setq-local 'require-final-newline nil)
         (add-to-list 'buffer-file-format 'longlines)
         (add-hook 'change-major-mode-hook #'longlines-mode-off nil t)
        (add-hook 'before-revert-hook #'longlines-before-revert-hook nil t)
         (make-local-variable 'longlines-auto-wrap)
-       (set (make-local-variable 'isearch-search-fun-function)
-            #'longlines-search-function)
-       (set (make-local-variable 'replace-search-function)
-            #'longlines-search-forward)
-       (set (make-local-variable 'replace-re-search-function)
-            #'longlines-re-search-forward)
+        (setq-local 'isearch-search-fun-function #'longlines-search-function)
+        (setq-local 'replace-search-function #'longlines-search-forward)
+        (setq-local 'replace-re-search-function #'longlines-re-search-forward)
         (add-function :filter-return (local 'filter-buffer-substring-function)
                       #'longlines-encode-string)
         (when longlines-wrap-follows-window-size
@@ -136,8 +133,7 @@ newlines are indicated with a symbol."
                                (window-width)))
                        longlines-wrap-follows-window-size
                      2)))
-           (set (make-local-variable 'fill-column)
-                (- (window-width) dw)))
+            (setq-local 'fill-column (- (window-width) dw)))
           (add-hook 'window-configuration-change-hook
                     #'longlines-window-change-function nil t))
         (let ((buffer-undo-list t)
index e0826475e3246ba6404975f0311334952f85b800..877a143f6ad5d37e0f35579a6cd91b030d1cee57 100644 (file)
@@ -169,12 +169,12 @@ See \\[compile]."
     ;; compilation-parse-errors will find referenced files by Tramp.
     (with-current-buffer next-error-last-buffer
       (when (fboundp 'tramp-make-tramp-file-name)
-       (set (make-local-variable 'comint-file-name-prefix)
-            (funcall
-              #'tramp-make-tramp-file-name
-             nil ;; method.
-             remote-compile-user
-             remote-compile-host
-             ""))))))
+        (setq-local 'comint-file-name-prefix
+                    (funcall
+                     #'tramp-make-tramp-file-name
+                     nil ;; method.
+                     remote-compile-user
+                     remote-compile-host
+                     ""))))))
 
 ;;; rcompile.el ends here
index 758a6e17f727fbaecd6d75e3fd54f75adb3718e9..dc3b31c79acfd589c0443c9a1339db7f0b061146 100644 (file)
@@ -6557,7 +6557,7 @@ and \"Whitesmith\"."
     (let ((option (car setting))
           (value (cdr setting)))
       (set (make-local-variable option) value)))
-  (set (make-local-variable 'cperl-file-style) style))
+  (setq-local 'cperl-file-style style))
 
 (declare-function Info-find-node "info"
                  (filename nodename &optional no-going-back strict-case
index 7890049a325cbc177bf1be45249a911cc1784bf4..440b52fe1069ac8d8bf89fc78d90ce287577f0ea 100644 (file)
     (setq erc-server-current-nick "tester")
     (setq-local erc-last-input-time 0)
     (should-not (local-variable-if-set-p 'erc-send-completed-hook))
-    (set (make-local-variable 'erc-send-completed-hook) nil) ; skip t (globals)
+    (setq-local 'erc-send-completed-hook nil) ; skip t (globals)
     ;; Just in case erc-ring-mode is already on
     (setq-local erc--input-review-functions erc--input-review-functions)
     (add-hook 'erc--input-review-functions #'erc-add-to-input-ring)