GNU bug report logs - #78493
30.1.90; dired-listing-switches "-hail --group-directories-first" fumbles filename ending with `:'

Previous Next

Package: emacs;

Reported by: Van Ly <van.ly <at> SDF.ORG>

Date: Mon, 19 May 2025 12:16:02 UTC

Severity: normal

Found in version 30.1.90

Done: Eli Zaretskii <eliz <at> gnu.org>

To reply to this bug, email your comments to 78493 AT debbugs.gnu.org.
There is no need to reopen the bug first.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#78493; Package emacs. (Mon, 19 May 2025 12:16:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Van Ly <van.ly <at> SDF.ORG>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 19 May 2025 12:16:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Van Ly <van.ly <at> SDF.ORG>
To: bug-gnu-emacs <at> gnu.org
Subject: 30.1.90; dired-listing-switches "-hail --group-directories-first"
 fumbles filename ending with `:'
Date: Mon, 19 May 2025 12:15:26 +0000
[Message part 1 (text/plain, inline)]
Hello,

The contents of directory `plan9-4e/rc/bin' has filenames ending with `:'.

This is a problem when the following setting applies.

  (setopt dired-listing-switches "-hail --group-directories-first")

Before the setting is applied a line appears as follows.

  -rwxr-xr-x 1 van staff  354 Dec 25  2021 9fat:

After the setting is applied the line now looks like this.

  /u/van/src/plan9/plan9-4e/rc/bin/11291923 -rwxr-xr-x 1 van staff  354 Dec 25  2021 9fat:

I am using the `gls' gnu ls command with dired-use-ls-dired variable value being `t'.

I expect the file `9fat:' to appear like `9fs', compare A and B below.

 [A] -> https://sdf.org/~van.ly/img/emacs-30.1.90-dired-1-before-setting.webp
 [B] -> https://sdf.org/~van.ly/img/emacs-30.1.90-dired-2-after-setting.webp

To reproduce observed bug,

  1. start, `emacs -Q'
  2. dired, `C-x d plan9-4e/rc/bin/'
     see: [A]
  3. apply, `(setopt dired-listing-switches "-hail --group-directories-first")'
  4. destroy dired buffer listing `plan9-4e/rc/bin'
  5. dired, `C-x d plan9-4e/rc/bin/'
     see: [B]
  6. note the appearance on the line with filename `9fat:'

[bug_gnu_emacs_diagnostics.text (application/octet-stream, attachment)]
[Message part 3 (text/plain, inline)]
-- 
vl

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#78493; Package emacs. (Mon, 19 May 2025 14:50:02 GMT) Full text and rfc822 format available.

Message #8 received at 78493 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Van Ly <van.ly <at> SDF.ORG>
Cc: 78493 <at> debbugs.gnu.org
Subject: Re: bug#78493: 30.1.90;
 dired-listing-switches "-hail --group-directories-first" fumbles
 filename ending with `:'
Date: Mon, 19 May 2025 17:49:40 +0300
> Date: Mon, 19 May 2025 12:15:26 +0000
> From:  Van Ly via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
> 
> The contents of directory `plan9-4e/rc/bin' has filenames ending with `:'.
> 
> This is a problem when the following setting applies.
> 
>   (setopt dired-listing-switches "-hail --group-directories-first")
> 
> Before the setting is applied a line appears as follows.
> 
>   -rwxr-xr-x 1 van staff  354 Dec 25  2021 9fat:
> 
> After the setting is applied the line now looks like this.
> 
>   /u/van/src/plan9/plan9-4e/rc/bin/11291923 -rwxr-xr-x 1 van staff  354 Dec 25  2021 9fat:
> 
> I am using the `gls' gnu ls command with dired-use-ls-dired variable value being `t'.
> 
> I expect the file `9fat:' to appear like `9fs', compare A and B below.
> 
>  [A] -> https://sdf.org/~van.ly/img/emacs-30.1.90-dired-1-before-setting.webp
>  [B] -> https://sdf.org/~van.ly/img/emacs-30.1.90-dired-2-after-setting.webp
> 
> To reproduce observed bug,
> 
>   1. start, `emacs -Q'
>   2. dired, `C-x d plan9-4e/rc/bin/'
>      see: [A]
>   3. apply, `(setopt dired-listing-switches "-hail --group-directories-first")'
>   4. destroy dired buffer listing `plan9-4e/rc/bin'
>   5. dired, `C-x d plan9-4e/rc/bin/'
>      see: [B]
>   6. note the appearance on the line with filename `9fat:'

Thanks.  Please try the patch below and tell if it solves the problem.

diff --git a/lisp/dired.el b/lisp/dired.el
index 63d373a..95e9fb2 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -3721,7 +3721,13 @@ dired-build-subdir-alist
 	    ;; ange-ftp listings.
 	    (and (dired-switches-recursive-p switches)
 		 (string-match "\\`/.*:\\(/.*\\)" default-directory)
-		 (concat "\\`" (match-string 1 default-directory)))))
+		 (concat "\\`" (match-string 1 default-directory))))
+           ;; Regexp that describes the beginning of line of a
+           ;; file/directory entry (as opposed to a subdirectory
+           ;; heading), including the optional mark, inoder, and size.
+           (file-entry-beg-re (concat dired-re-maybe-mark
+                                      dired-re-inode-size
+                                      dired-re-perms)))
       (goto-char (point-min))
       (setq dired-subdir-alist nil)
       (while (re-search-forward dired-subdir-regexp nil t)
@@ -3730,8 +3736,7 @@ dired-build-subdir-alist
 	(unless (save-excursion
 		  (goto-char (match-beginning 0))
 		  (beginning-of-line)
-		  (forward-char 2)
-		  (looking-at-p dired-re-perms))
+		  (looking-at-p file-entry-beg-re))
 	  (save-excursion
 	    (goto-char (match-beginning 1))
 	    (setq new-dir-name




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#78493; Package emacs. (Sat, 24 May 2025 12:40:02 GMT) Full text and rfc822 format available.

Message #11 received at 78493 <at> debbugs.gnu.org (full text, mbox):

From: Van Ly <van.ly <at> SDF.ORG>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 78493 <at> debbugs.gnu.org
Subject: Re: bug#78493: 30.1.90;
 dired-listing-switches "-hail --group-directories-first" fumbles
 filename ending with `:'
Date: Sat, 24 May 2025 12:39:01 +0000
Eli Zaretskii <eliz <at> gnu.org> writes:

>
> Thanks.  Please try the patch below and tell if it solves the problem.
>

The patch solves the problem.  Thank you.

I had to byte compile dired.el after applying the patch diff inside `emacs -Q'.

My experimental environment with quicklisp and ecl inferior-lisp-program complained as follows:


Compiling file /u/van/src/emacs-30.1.90/lisp/dired.el at Sat May 24 22:20:32 2025
Entering directory ‘/u/van/src/emacs-30.1.90/lisp/’
dired.el:848:19: Error: Wrong number of arguments: when-let, 1

Is there a setting to tell emacs lisp to byte compile in the experimental environment?

-- 
vl




Reply sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Sat, 24 May 2025 13:30:02 GMT) Full text and rfc822 format available.

Notification sent to Van Ly <van.ly <at> SDF.ORG>:
bug acknowledged by developer. (Sat, 24 May 2025 13:30:03 GMT) Full text and rfc822 format available.

Message #16 received at 78493-done <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Van Ly <van.ly <at> SDF.ORG>
Cc: 78493-done <at> debbugs.gnu.org
Subject: Re: bug#78493: 30.1.90;
 dired-listing-switches "-hail --group-directories-first" fumbles
 filename ending with `:'
Date: Sat, 24 May 2025 16:28:54 +0300
> From: Van Ly <van.ly <at> SDF.ORG>
> Cc: 78493 <at> debbugs.gnu.org
> Date: Sat, 24 May 2025 12:39:01 +0000
> 
> 
> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
> >
> > Thanks.  Please try the patch below and tell if it solves the problem.
> >
> 
> The patch solves the problem.  Thank you.

Thanks, installed on the master branch, and closing the bug.

> I had to byte compile dired.el after applying the patch diff inside `emacs -Q'.

Yes, that's expected.

> My experimental environment with quicklisp and ecl inferior-lisp-program complained as follows:
> 
> 
> Compiling file /u/van/src/emacs-30.1.90/lisp/dired.el at Sat May 24 22:20:32 2025
> Entering directory ‘/u/van/src/emacs-30.1.90/lisp/’
> dired.el:848:19: Error: Wrong number of arguments: when-let, 1

I don't see such an error.

> Is there a setting to tell emacs lisp to byte compile in the experimental environment?

What do you mean by "experimental environment", and how does it
different from the "normal" Emacs environment?




This bug report was last modified today.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.