]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix uses of 'dired-omit-mode' (bug#71905)
authorJuri Linkov <juri@linkov.net>
Sun, 7 Jul 2024 06:52:01 +0000 (09:52 +0300)
committerEshel Yaron <me@eshelyaron.com>
Mon, 8 Jul 2024 20:50:44 +0000 (22:50 +0200)
* lisp/dired.el (dired-jump): Disable dired-omit-mode with -1.

* lisp/files.el (recover-session): Disable dired-omit-mode
explicitly afterwards instead of modifying dired-mode-hook
that fails when it contains a lambda.

(cherry picked from commit 8911d53ce5d8c67327704b7bf55ada14024766d0)

lisp/dired.el
lisp/files.el

index 8781ff52fbe0d7979077b1ae2433ea25ee93d6c7..6225ee3a7b00849080ec5e7eaf5c1a3d0fb6ee44 100644 (file)
@@ -5171,7 +5171,7 @@ Interactively with prefix argument, read FILE-NAME."
                   (dired-goto-file file))
                 ;; Toggle omitting, if it is on, and try again.
                 (when (bound-and-true-p dired-omit-mode)
-                  (dired-omit-mode)
+                  (dired-omit-mode -1)
                   (dired-goto-file file)))))))))
 
 ;;;###autoload
index 74a9c62c6671804cb7a17669cf895a42348e60d0..ab2b0223d1d0dc9d504f42652a241837ab06b48f 100644 (file)
@@ -7310,7 +7310,7 @@ auto-save file, if that is more recent than the visited file."
           (after-find-file nil nil t))
          (t (user-error "Recover-file canceled")))))
 
-(defvar dired-mode-hook)
+(declare-function dired-omit-mode "dired-x" (&optional arg))
 
 (defun recover-session ()
   "Recover auto save files from a previous Emacs session.
@@ -7331,14 +7331,12 @@ Then you'll be asked about a number of files to recover."
                                (concat "\\`" (regexp-quote nd)))
                             t)
       (error "No previous sessions to recover")))
-  (require 'dired)
-  (let ((ls-lisp-support-shell-wildcards t)
-        ;; Ensure that we don't omit the session files as the user may
-        ;; have (as suggested by the manual) `dired-omit-mode' in the
-        ;; hook.
-        (dired-mode-hook (delete 'dired-omit-mode dired-mode-hook)))
+  (let ((ls-lisp-support-shell-wildcards t))
     (dired (concat auto-save-list-file-prefix "*")
-          (concat (connection-local-value dired-listing-switches) " -t")))
+          (concat (connection-local-value dired-listing-switches) " -t"))
+    ;; Toggle omitting, if it is on.
+    (when (bound-and-true-p dired-omit-mode)
+      (dired-omit-mode -1)))
   (use-local-map (nconc (make-sparse-keymap) (current-local-map)))
   (define-key (current-local-map) "\C-c\C-c" 'recover-session-finish)
   (save-excursion