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.
This commit is contained in:
Tino Calancha 2017-07-21 13:17:14 +09:00
parent 7a0ca227af
commit d881b33595
2 changed files with 12 additions and 4 deletions

View file

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

View file

@ -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