summaryrefslogtreecommitdiff
path: root/lisp/dired.el
diff options
context:
space:
mode:
authorLars Ingebrigtsen <larsi@gnus.org>2020-09-16 13:34:58 +0200
committerLars Ingebrigtsen <larsi@gnus.org>2020-09-16 13:34:58 +0200
commit96f1fedf4dd662dbd5bba7eebc0b9c9e926fbce6 (patch)
tree873fe8a45350dede85c40bd78ebaaf2a9ef93404 /lisp/dired.el
parentb43287e41307ea2cb331b8915c8b1088ba9e5e9f (diff)
downloademacs-96f1fedf4dd662dbd5bba7eebc0b9c9e926fbce6.tar.gz
Fix problem with previous dired.el change
* lisp/dired.el (dired-get-filename): dired-current-directory can't be called before the dired buffer has been set up. (add-hook 'dired-mode-hook 'dired-sort-toggle) calls dired-get-filename in a way that exposes this problem, so avoid it.
Diffstat (limited to 'lisp/dired.el')
-rw-r--r--lisp/dired.el4
1 files changed, 3 insertions, 1 deletions
diff --git a/lisp/dired.el b/lisp/dired.el
index 1b6da1f9617..7839ace8030 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -2610,7 +2610,9 @@ it occurs in the buffer, and a value of t means construct name relative to
Optional arg NO-ERROR-IF-NOT-FILEP means treat `.' and `..' as
regular filenames and return nil if no filename on this line.
Otherwise, an error occurs in these cases."
- (let ((hidden (dired-subdir-hidden-p (dired-current-directory)))
+ (let ((hidden (and dired-subdir-alist
+ (dired-subdir-hidden-p
+ (dired-current-directory))))
case-fold-search file p1 p2 already-absolute)
(when hidden
(dired-unhide-subdir))