Prefer setq-local in dired extensions

* 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):
This commit is contained in:
Stefan Kangas 2020-12-09 09:18:04 +01:00
parent be4d6b043f
commit 4489531b1e
3 changed files with 15 additions and 15 deletions

View 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))

View 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."

View 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))