emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Dired subdirectories & the ls option time-style with the %R sequence


From: gautier
Subject: Re: Dired subdirectories & the ls option time-style with the %R sequence
Date: Wed, 24 May 2023 17:03:49 +0200
User-agent: Roundcube Webmail/1.4.13

Hello Robert,

Robert Pluim <rpluim@gmail.com> (2023-05-24 13:36 +0200):
Something like the following (untested) patch?

diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el
index fc3f6f4f04d..dc558e13ac8 100644
--- a/lisp/dired-aux.el
+++ b/lisp/dired-aux.el
@@ -3142,7 +3142,7 @@ dired-insert-subdir
     (and (not switches) cons (setq switches (cdr cons)))
     (dired-insert-subdir-validate dirname switches)
     ;; case-fold-search is nil now, so we can test for capital `R':
- (if (setq switches-have-R (and switches (string-match-p "R" switches))) + (if (setq switches-have-R (and switches (string-match-p "[^%]R" switches)))
        ;; avoid duplicated subdirs
        (setq mark-alist (dired-kill-tree dirname t)))
     (if elt

Robert
--

Thank you very much for the patch!

It seems that the exact same modification you did also need to be done in the
function: dired-insert-subdir-doinsert .

So, the following patch works for me:

diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el
index a07406e4c0d..8d31efd4a1a 100644
--- a/lisp/dired-aux.el
+++ b/lisp/dired-aux.el
@@ -3142,7 +3142,7 @@ dired-insert-subdir
     (and (not switches) cons (setq switches (cdr cons)))
     (dired-insert-subdir-validate dirname switches)
     ;; case-fold-search is nil now, so we can test for capital `R':
- (if (setq switches-have-R (and switches (string-match-p "R" switches))) + (if (setq switches-have-R (and switches (string-match-p "[^%]R" switches)))
        ;; avoid duplicated subdirs
        (setq mark-alist (dired-kill-tree dirname t)))
     (if elt
@@ -3258,7 +3258,7 @@ dired-insert-subdir-doinsert
       (let ((dired-actual-switches
             (or switches
                 dired-subdir-switches
-                (string-replace "R" "" dired-actual-switches))))
+                (string-replace "[^%]R" "" dired-actual-switches))))
        (if (equal dirname (car (car (last dired-subdir-alist))))
            ;; If doing the top level directory of the buffer,
            ;; redo it as specified in dired-directory.


However, I don't know if it has some unexpected consequences on dired.

All the best,
Gautier.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]