]> git.eshelyaron.com Git - emacs.git/commitdiff
Prefer setq-local in dired extensions
authorStefan Kangas <stefan@marxist.se>
Wed, 9 Dec 2020 08:18:04 +0000 (09:18 +0100)
committerStefan Kangas <stefan@marxist.se>
Wed, 9 Dec 2020 10:58:37 +0000 (11:58 +0100)
* lisp/dired-aux.el (dired-diff, dired-compare-directories)
(dired-do-create-files, dired-isearch-filenames):
* lisp/dired-x.el (dired-virtual, dired-vm):
* lisp/wdired.el (wdired-change-to-wdired-mode)
(wdired-change-to-dired-mode, wdired-preprocess-perms):

lisp/dired-aux.el
lisp/dired-x.el
lisp/wdired.el

index 26155190d47f88bb1abeb7cc74ae6c1dd63e298c..0f68b470733bf713654b363010c06ec01f0f1189 100644 (file)
@@ -259,7 +259,7 @@ the string of command switches used as the third argument of `diff'."
      (list
       (minibuffer-with-setup-hook
          (lambda ()
-           (set (make-local-variable 'minibuffer-default-add-function) nil)
+            (setq-local minibuffer-default-add-function nil)
            (setq minibuffer-default defaults))
        (read-file-name (format-prompt "Diff %s with" default current)
                        target-dir default t))
@@ -334,7 +334,7 @@ only in the active region if `dired-mark-region' is non-nil."
           (defaults (dired-dwim-target-defaults nil target-dir)))
       (minibuffer-with-setup-hook
          (lambda ()
-           (set (make-local-variable 'minibuffer-default-add-function) nil)
+            (setq-local minibuffer-default-add-function nil)
            (setq minibuffer-default defaults))
        (read-directory-name (format "Compare %s with: "
                                     (dired-current-directory))
@@ -2049,7 +2049,7 @@ Optional arg HOW-TO determines how to treat the target.
         (target (expand-file-name ; fluid variable inside dired-create-files
                  (minibuffer-with-setup-hook
                      (lambda ()
-                       (set (make-local-variable 'minibuffer-default-add-function) nil)
+                        (setq-local minibuffer-default-add-function nil)
                        (setq minibuffer-default defaults))
                    (dired-mark-read-file-name
                      (format "%s %%s %s: "
@@ -3013,14 +3013,14 @@ is part of a file name (i.e., has the text property `dired-filename')."
 (defun dired-isearch-filenames ()
   "Search for a string using Isearch only in file names in the Dired buffer."
   (interactive)
-  (set (make-local-variable 'dired-isearch-filenames) t)
+  (setq-local dired-isearch-filenames t)
   (isearch-forward nil t))
 
 ;;;###autoload
 (defun dired-isearch-filenames-regexp ()
   "Search for a regexp using Isearch only in file names in the Dired buffer."
   (interactive)
-  (set (make-local-variable 'dired-isearch-filenames) t)
+  (setq-local dired-isearch-filenames t)
   (isearch-forward-regexp nil t))
 
 \f
index 55077e7188220bac8c463aeba5b0956155794f50..75e4f466246306a9f979311fc4fe018359f5569a 100644 (file)
@@ -636,7 +636,7 @@ you can relist single subdirs using \\[dired-do-redisplay]."
   (dired-mode dirname (or switches dired-listing-switches))
   (setq mode-name "Virtual Dired"
         revert-buffer-function 'dired-virtual-revert)
-  (set (make-local-variable 'dired-subdir-alist) nil)
+  (setq-local dired-subdir-alist nil)
   (dired-build-subdir-alist)
   (goto-char (point-min))
   (dired-initial-position dirname))
@@ -1226,7 +1226,7 @@ Otherwise obeys the value of `dired-vm-read-only-folders'."
                              (and dired-vm-read-only-folders
                                   (not (file-writable-p fil)))))
     ;; So that pressing `v' inside VM does prompt within current directory:
-    (set (make-local-variable 'vm-folder-directory) dir)))
+    (setq-local vm-folder-directory dir)))
 
 (defun dired-rmail ()
   "Run RMAIL on this file."
index ebe19613943915caa1f1ed3347c10b03f5f42ab2..b7dd4ee9496f3e0e08ebefd8bdd53b3cb5d5da94 100644 (file)
@@ -242,12 +242,12 @@ See `wdired-mode'."
   (interactive)
   (unless (derived-mode-p 'dired-mode)
     (error "Not a Dired buffer"))
-  (set (make-local-variable 'wdired-old-content)
-       (buffer-substring (point-min) (point-max)))
-  (set (make-local-variable 'wdired-old-marks)
-       (dired-remember-marks (point-min) (point-max)))
-  (set (make-local-variable 'wdired-old-point) (point))
-  (set (make-local-variable 'query-replace-skip-read-only) t)
+  (setq-local wdired-old-content
+              (buffer-substring (point-min) (point-max)))
+  (setq-local wdired-old-marks
+              (dired-remember-marks (point-min) (point-max)))
+  (setq-local wdired-old-point (point))
+  (setq-local query-replace-skip-read-only t)
   (add-function :after-while (local 'isearch-filter-predicate)
                 #'wdired-isearch-filter-read-only)
   (use-local-map wdired-mode-map)
@@ -390,7 +390,7 @@ non-nil means return old filename."
   (dired-advertise)
   (remove-hook 'kill-buffer-hook 'wdired-check-kill-buffer t)
   (remove-hook 'after-change-functions 'wdired--restore-properties t)
-  (set (make-local-variable 'revert-buffer-function) 'dired-revert))
+  (setq-local revert-buffer-function 'dired-revert))
 
 
 (defun wdired-abort-changes ()
@@ -834,7 +834,7 @@ Like original function but it skips read-only words."
 ;; original name and permissions as a property
 (defun wdired-preprocess-perms ()
   (let ((inhibit-read-only t))
-    (set (make-local-variable 'wdired-col-perm) nil)
+    (setq-local wdired-col-perm nil)
     (save-excursion
       (goto-char (point-min))
       (while (not (eobp))