From d881b33595c8192d93bb861ca4766cfd5a39b1eb Mon Sep 17 00:00:00 2001 From: Tino Calancha Date: Fri, 21 Jul 2017 13:17:14 +0900 Subject: [PATCH] Handle when dired-directory is a cons in some Dired functions * lisp/dired-aux.el (dired-rename-subdir-1) * lisp/dired-x.el (dired-mark-omitted): Handle when dired-directory is a cons. --- lisp/dired-aux.el | 8 ++++++-- lisp/dired-x.el | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el index 095ce8ba89c..17dae6085df 100644 --- a/lisp/dired-aux.el +++ b/lisp/dired-aux.el @@ -1623,10 +1623,14 @@ Special value `always' suppresses confirmation." (setq default-directory to dired-directory (expand-file-name;; this is correct ;; with and without wildcards - (file-name-nondirectory dired-directory) + (file-name-nondirectory (if (stringp dired-directory) + dired-directory + (car dired-directory))) to)) (let ((new-name (file-name-nondirectory - (directory-file-name dired-directory)))) + (directory-file-name (if (stringp dired-directory) + dired-directory + (car dired-directory)))))) ;; try to rename buffer, but just leave old name if new ;; name would already exist (don't try appending "<%d>") (or (get-buffer new-name) diff --git a/lisp/dired-x.el b/lisp/dired-x.el index 7ceb672bf2f..915550991d0 100644 --- a/lisp/dired-x.el +++ b/lisp/dired-x.el @@ -546,7 +546,9 @@ Should never be used as marker by the user or other packages.") (interactive) (let ((dired-omit-mode nil)) (revert-buffer)) ;; Show omitted files (dired-mark-unmarked-files (dired-omit-regexp) nil nil dired-omit-localp - (dired-omit-case-fold-p dired-directory))) + (dired-omit-case-fold-p (if (stringp dired-directory) + dired-directory + (car dired-directory))))) (defcustom dired-omit-extensions (append completion-ignored-extensions @@ -591,7 +593,9 @@ This functions works by temporarily binding `dired-marker-char' to (let ((dired-marker-char dired-omit-marker-char)) (when dired-omit-verbose (message "Omitting...")) (if (dired-mark-unmarked-files omit-re nil nil dired-omit-localp - (dired-omit-case-fold-p dired-directory)) + (dired-omit-case-fold-p (if (stringp dired-directory) + dired-directory + (car dired-directory)))) (progn (setq count (dired-do-kill-lines nil -- 2.39.2