emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 838da4aef8: Make dired-directory and dired-subdir-alist buffer-lo


From: Lars Ingebrigtsen
Subject: master 838da4aef8: Make dired-directory and dired-subdir-alist buffer-local
Date: Sun, 6 Feb 2022 19:31:58 -0500 (EST)

branch: master
commit 838da4aef8768ff74c419e0ecd6498b9dad24641
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    Make dired-directory and dired-subdir-alist buffer-local
    
    * lisp/dired.el (dired-directory):
    (dired-subdir-alist): Make buffer-local (bug#7118)
    (dired-readin):
    (dired-mode):
    * lisp/dired-x.el (dired-virtual): Adjust usage.
    * lisp/locate.el (locate-mode):
    * lisp/find-lisp.el (find-lisp-find-dired-internal):
    * lisp/find-dired.el (find-dired): Adjust usage.
---
 lisp/dired-x.el    | 4 ++--
 lisp/dired.el      | 8 ++++----
 lisp/find-dired.el | 4 ++--
 lisp/find-lisp.el  | 4 ++--
 lisp/locate.el     | 4 +---
 5 files changed, 11 insertions(+), 13 deletions(-)

diff --git a/lisp/dired-x.el b/lisp/dired-x.el
index bdf416b3ed..56036b6c16 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 5f1bfef12c..bca3018923 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 c67138a800..c04545e44e 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 d4d899aced..0a712c0b81 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 95b66f275a..d4847b9c05 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]