]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix desktop-save for dired buffers (bug#66697)
authorManuel Giraud <manuel@ledu-giraud.fr>
Sat, 9 Dec 2023 12:02:19 +0000 (13:02 +0100)
committerEli Zaretskii <eliz@gnu.org>
Sat, 9 Dec 2023 13:15:36 +0000 (15:15 +0200)
* lisp/dired.el (dired-desktop-save-p): Move all logic here.  Carry on
when 'desktop-files-not-to-save' is nil.
(dired-desktop-buffer-misc-data): Use it.

lisp/dired.el

index 7f4b96353ee15c5ad093d704c3069639af988a14..36ca54efc378069239ac4d4367710c6100e7c75a 100644 (file)
@@ -4989,14 +4989,15 @@ Ask means pop up a menu for the user to select one of copy, move or link."
 
 (defun dired-desktop-save-p ()
   "Should `dired-directory' be desktop saved?"
-  (if (consp dired-directory)
-      (not (string-match-p desktop-files-not-to-save (car dired-directory)))
-    (not (string-match-p desktop-files-not-to-save dired-directory))))
+  (or (null desktop-files-not-to-save)
+      (and (stringp desktop-files-not-to-save)
+           (if (consp dired-directory)
+               (not (string-match-p desktop-files-not-to-save (car dired-directory)))
+             (not (string-match-p desktop-files-not-to-save dired-directory))))))
 
 (defun dired-desktop-buffer-misc-data (dirname)
   "Auxiliary information to be saved in desktop file."
-  (when (and (stringp desktop-files-not-to-save)
-             (dired-desktop-save-p))
+  (when (dired-desktop-save-p)
     (cons
      ;; Value of `dired-directory'.
      (if (consp dired-directory)