From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Gautier Ponsinet Newsgroups: gmane.emacs.devel Subject: Re: Dired subdirectories & the ls option time-style with the %R sequence Date: Sat, 27 May 2023 12:33:15 +0200 Message-ID: <87353icbdg.fsf@gautierponsinet.xyz> References: <87fs7mugwv.fsf@gautierponsinet.xyz> <87cz2qneqn.fsf@gmail.com> <878rdcoqnv.fsf@gmail.com> <287178c7f11c6a2b3a4de84e13b72c2b@gautierponsinet.xyz> <87zg5smlet.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34121"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Robert Pluim Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat May 27 12:34:21 2023 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1q2rFd-0008i5-E3 for ged-emacs-devel@m.gmane-mx.org; Sat, 27 May 2023 12:34:21 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q2rEq-0004KD-Ku; Sat, 27 May 2023 06:33:32 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q2rEo-0004Jm-SU for emacs-devel@gnu.org; Sat, 27 May 2023 06:33:30 -0400 Original-Received: from 20.mo550.mail-out.ovh.net ([188.165.45.168]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q2rEm-00025t-2L for emacs-devel@gnu.org; Sat, 27 May 2023 06:33:30 -0400 Original-Received: from director8.ghost.mail-out.ovh.net (unknown [10.109.143.79]) by mo550.mail-out.ovh.net (Postfix) with ESMTP id CBA2426FE1 for ; Sat, 27 May 2023 10:33:16 +0000 (UTC) Original-Received: from ghost-submission-6684bf9d7b-z72ps (unknown [10.110.208.181]) by director8.ghost.mail-out.ovh.net (Postfix) with ESMTPS id 843AD1FD34; Sat, 27 May 2023 10:33:16 +0000 (UTC) Original-Received: from gautierponsinet.xyz ([37.59.142.99]) by ghost-submission-6684bf9d7b-z72ps with ESMTPSA id qNOoHWzccWRTOAAAEWAAJA (envelope-from ); Sat, 27 May 2023 10:33:16 +0000 Authentication-Results: garm.ovh; auth=pass (GARM-99G00395c81c08-a37d-4288-be9f-b102a407e122, 92B0A84F445ED07B36E0E8A79E9BEFE5352E61AB) smtp.auth=gautier@gautierponsinet.xyz X-OVh-ClientIp: 134.76.50.203 In-Reply-To: <87zg5smlet.fsf@gmail.com> X-Ovh-Tracer-Id: 15883069986348918693 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -65 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvhedrfeekuddgvdelucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnegfrhhlucfvnfffucdlfeehmdenucfjughrpefhvfevufgjfhffkfggtgfgsehtqhertddttdejnecuhfhrohhmpefirghuthhivghrucfrohhnshhinhgvthcuoehgrghuthhivghrsehgrghuthhivghrphhonhhsihhnvghtrdighiiiqeenucggtffrrghtthgvrhhnpeekueeijeekieeukeetueffieehgfevkefhlefguddtfeevtdfgveegveekheelueenucfkphepuddvjedrtddrtddruddpudefgedrjeeirdehtddrvddtfedpfeejrdehledrudegvddrleelnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepuddvjedrtddrtddruddpmhgrihhlfhhrohhmpeeoghgruhhtihgvrhesghgruhhtihgvrhhpohhnshhinhgvthdrgiihiieqpdhnsggprhgtphhtthhopedupdhrtghpthhtohepvghmrggtshdquggvvhgvlhesghhnuhdrohhrghdpoffvtefjohhsthep mhhoheehtddpmhhouggvpehsmhhtphhouhht Received-SPF: pass client-ip=188.165.45.168; envelope-from=gautier@gautierponsinet.xyz; helo=20.mo550.mail-out.ovh.net X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:306366 Archived-At: Robert Pluim (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=CA=BCs 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-re= plate "%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" s= witches))) (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-switch= es))))) (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.