diff --git a/lisp/dired-x.el b/lisp/dired-x.el index bdf416b3edc..56036b6c166 100644 --- a/lisp/dired-x.el +++ b/lisp/dired-x.el @@ -639,8 +639,8 @@ you can relist single subdirs using \\[dired-do-redisplay]." ":\n")) (dired-mode dirname (or switches dired-listing-switches)) (setq mode-name "Virtual Dired" - revert-buffer-function 'dired-virtual-revert) - (setq-local dired-subdir-alist nil) + revert-buffer-function 'dired-virtual-revert + dired-subdir-alist nil) (dired-build-subdir-alist) (goto-char (point-min)) (dired-initial-position dirname)) diff --git a/lisp/dired.el b/lisp/dired.el index 5f1bfef12c5..bca30189230 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -408,7 +408,7 @@ action argument symbol is `window-height' and its value is nil." "24.3") (defvar dired-file-version-alist) ;;;###autoload -(defvar dired-directory nil +(defvar-local dired-directory nil "The directory name or wildcard spec that this Dired directory lists. Local to each Dired buffer. May be a list, in which case the car is the directory name and the cdr is the list of files to mention. @@ -455,7 +455,7 @@ The directory name must be absolute, but need not be fully expanded.") (defvar dired-re-dot "^.* \\.\\.?/?$") ;; The subdirectory names in the next two lists are expanded. -(defvar dired-subdir-alist nil +(defvar-local dired-subdir-alist nil "Alist of listed directories and their buffer positions. Alist elements have the form (DIRNAME . STARTMARKER), where DIRNAME is the absolute name of the directory and STARTMARKER is @@ -1336,7 +1336,7 @@ wildcards, erases the buffer, and builds the subdir-alist anew (goto-char (point-min)) ;; Must first make alist buffer local and set it to nil because ;; dired-build-subdir-alist will call dired-clear-alist first - (setq-local dired-subdir-alist nil) + (setq dired-subdir-alist nil) (dired-build-subdir-alist)) (let ((attributes (file-attributes dirname))) (if (eq (car attributes) t) @@ -2365,7 +2365,7 @@ Keybindings: (setq-local buffer-stale-function #'dired-buffer-stale-p) (setq-local buffer-auto-revert-by-notification t) (setq-local page-delimiter "\n\n") - (setq-local dired-directory (or dirname default-directory)) + (setq dired-directory (or dirname default-directory)) ;; list-buffers uses this to display the dir being edited in this buffer. (setq list-buffers-directory (expand-file-name (if (listp dired-directory) diff --git a/lisp/find-dired.el b/lisp/find-dired.el index c67138a8006..c04545e44e9 100644 --- a/lisp/find-dired.el +++ b/lisp/find-dired.el @@ -234,8 +234,8 @@ it finishes, type \\[kill-find]." (dired-simple-subdir-alist) ;; else we have an ancient tree dired (or classic dired, where ;; this does no harm) - (setq-local dired-subdir-alist - (list (cons default-directory (point-min-marker))))) + (setq 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 diff --git a/lisp/find-lisp.el b/lisp/find-lisp.el index d4d899aced7..0a712c0b811 100644 --- a/lisp/find-lisp.el +++ b/lisp/find-lisp.el @@ -231,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) - (setq-local dired-subdir-alist - (list (cons default-directory (point-min-marker))))) + (setq 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/locate.el b/lisp/locate.el index 95b66f275a1..d4847b9c050 100644 --- a/lisp/locate.el +++ b/lisp/locate.el @@ -461,13 +461,11 @@ Specific `locate-mode' commands, such as \\[locate-find-directory], do not work in subdirectories. \\{locate-mode-map}" - ;; Avoid clobbering this variable - (make-local-variable 'dired-subdir-alist) (setq default-directory "/" buffer-read-only t) (add-to-invisibility-spec '(dired . t)) (dired-alist-add-1 default-directory (point-min-marker)) - (setq-local dired-directory "/") + (setq dired-directory "/") (setq-local dired-subdir-switches locate-ls-subdir-switches) (setq dired-switches-alist nil) ;; This should support both Unix and Windoze style names