From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: gautier@gautierponsinet.xyz Newsgroups: gmane.emacs.devel Subject: Re: Dired subdirectories & the ls option time-style with the %R sequence Date: Wed, 24 May 2023 17:03:49 +0200 Message-ID: References: <87fs7mugwv.fsf@gautierponsinet.xyz> <87cz2qneqn.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32172"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Roundcube Webmail/1.4.13 Cc: emacs-devel@gnu.org To: Robert Pluim Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed May 24 17:05:45 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 1q1q3d-0008E4-8A for ged-emacs-devel@m.gmane-mx.org; Wed, 24 May 2023 17:05:45 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q1q1y-00089p-6e; Wed, 24 May 2023 11:04:02 -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 1q1q1v-0007vK-OP for emacs-devel@gnu.org; Wed, 24 May 2023 11:03:59 -0400 Original-Received: from 7.mo584.mail-out.ovh.net ([178.33.253.54]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q1q1t-0007ui-Ec for emacs-devel@gnu.org; Wed, 24 May 2023 11:03:59 -0400 Original-Received: from director8.ghost.mail-out.ovh.net (unknown [10.108.1.162]) by mo584.mail-out.ovh.net (Postfix) with ESMTP id D293721FE4 for ; Wed, 24 May 2023 15:03:53 +0000 (UTC) Original-Received: from ghost-submission-6684bf9d7b-vbqcl (unknown [10.110.208.233]) by director8.ghost.mail-out.ovh.net (Postfix) with ESMTPS id 6BE5D1FE4A; Wed, 24 May 2023 15:03:53 +0000 (UTC) Original-Received: from RCM-web10.webmail.mail.ovh.net ([151.80.29.18]) by ghost-submission-6684bf9d7b-vbqcl with ESMTPSA id tKvlGFknbmRYYwAA0ONLkQ (envelope-from ); Wed, 24 May 2023 15:03:53 +0000 In-Reply-To: <87cz2qneqn.fsf@gmail.com> X-Sender: gautier@gautierponsinet.xyz X-Originating-IP: 134.76.51.242 X-Webmail-UserID: gautier@gautierponsinet.xyz X-Ovh-Tracer-Id: 2835297444360611749 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -65 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvhedrfeejhedgkedvucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnegfrhhlucfvnfffucdlfeehmdenucfjughrpeggfffhvfevufgjfhgfkfigihgtgfesthejjhdttdervdenucfhrhhomhepghgruhhtihgvrhesghgruhhtihgvrhhpohhnshhinhgvthdrgiihiienucggtffrrghtthgvrhhnpeegudfhhedtheehgeehueejgefgfedvtdejfedtteffvddtuedvteekffdutdfhteenucfkphepuddvjedrtddrtddruddpudefgedrjeeirdehuddrvdegvddpudehuddrkedtrddvledrudeknecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepuddvjedrtddrtddruddpmhgrihhlfhhrohhmpeeoghgruhhtihgvrhesghgruhhtihgvrhhpohhnshhinhgvthdrgiihiieqpdhnsggprhgtphhtthhopedupdhrtghpthhtohepvghmrggtshdquggvvhgvlhesghhnuhdrohhrghdpoffvtefjohhsthepmhhoheekgedpmhhouggvpehsmhhtphho uhht Received-SPF: pass client-ip=178.33.253.54; envelope-from=gautier@gautierponsinet.xyz; helo=7.mo584.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_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:306301 Archived-At: Hello Robert, Robert Pluim (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.