]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix problem with previous dired.el change
authorLars Ingebrigtsen <larsi@gnus.org>
Wed, 16 Sep 2020 11:34:58 +0000 (13:34 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Wed, 16 Sep 2020 11:34:58 +0000 (13:34 +0200)
* 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.

lisp/dired.el

index 1b6da1f9617a801bec9ee92d11fa6303b9262660..7839ace80304c76ac807decb8a559f942ae58741 100644 (file)
@@ -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))