Using Emacs 26.1, I have enabled dired-omit-mode globally with (add-hook 'dired-mode-hook #'dired-omit-mode). When using recover-session, I don't see any files. How to fix this?

Creating a .dir-locals.el containing ((dired-mode (dired-omit-mode))) didn't work.

This bug should be fixed in Emacs 27.1.


Instead of dired-omit-mode, add a wrapper to dired-mode-hook that checks dired-directory:

(defun my-turn-on-dired-omit-mode ()
  (unless (and auto-save-list-file-prefix
               (string= dired-directory
                        (concat auto-save-list-file-prefix "*")))
(add-hook 'dired-mode-hook #'my-turn-on-dired-omit-mode)
;; (remove-hook 'dired-mode-hook #'dired-omit-mode)
  • 2
    This rather sounds like a bug which you should report with M-x report-emacs-bug – phils Jun 15 '19 at 11:44
  • 2
    done (15 chars) – Erik Jun 15 '19 at 12:04
  • 1
    More helpful than "(15 chars)" would be: debbugs.gnu.org/36223 – npostavs Jun 15 '19 at 16:44
  • I didn't know the link before I received the confirmation mail. – Erik Jun 15 '19 at 17:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.