[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 Ponsinet |
Subject: |
Re: Dired subdirectories & the ls option time-style with the %R sequence |
Date: |
Sat, 27 May 2023 12:33:15 +0200 |
Robert Pluim <rpluim@gmail.com> (2023-05-25 18:21 +0200):
> Gautier> Do you think another solution could be to expand '%R' into
> '%H:%M'
> Gautier> early on in dired-insert-subdir then?
>
> Thatʼs another option, perhaps slightly less kludgy than my original
> patch :-)
So, something like this?
diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el
index a07406e4c0d..967bdbd3e44 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"
(string-replate "%R" "%H:%M" switches))))
;; avoid duplicated subdirs
(setq mark-alist (dired-kill-tree dirname t)))
(if elt
@@ -3157,7 +3157,7 @@ dired-insert-subdir
(push (cons dirname switches) dired-switches-alist)))
(when switches-have-R
(dired-build-subdir-alist switches)
- (setq switches (string-replace "R" "" switches))
+ (setq switches (string-replace "R" "" (string-replace "%R" "%H:%M"
switches)))
(dolist (cur-ass dired-subdir-alist)
(let ((cur-dir (car cur-ass)))
(and (dired-in-this-tree-p cur-dir dirname)
@@ -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" "" (string-replace "%R" "%H:%M"
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.
All the best,
Gautier.
Re: Dired subdirectories & the ls option time-style with the %R sequence, Yuri Khan, 2023/05/24