GNU bug report logs - #2068
23.0.60; dired-get-filename includes `*' for executable in name

Previous Next

Packages: emacs, w32;

Reported by: "Drew Adams" <drew.adams <at> oracle.com>

Date: Mon, 26 Jan 2009 17:55:04 UTC

Severity: normal

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

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (Emacs bug Tracking System)
To: Eli Zaretskii <eliz <at> gnu.org>
Subject: bug#2068: marked as done (23.0.60; dired-get-filename includes 
 `*' for executable in name)
Date: Wed, 28 Jan 2009 19:15:03 +0000
[Message part 1 (text/plain, inline)]
Your message dated Wed, 28 Jan 2009 21:07:35 +0200
with message-id <uljsv1c7c.fsf <at> gnu.org>
and subject line Re: bug#2068: 23.0.60;	dired-get-filename includes `*' for executable in name
has caused the Emacs bug report #2068,
regarding 23.0.60; dired-get-filename includes `*' for executable in name
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact help-debbugs <at> gnu.org
immediately.)


-- 
2068: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=2068
Emacs Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: "Drew Adams" <drew.adams <at> oracle.com>
To: <emacs-pretest-bug <at> gnu.org>
Subject: 23.0.60; dired-get-filename includes `*' for executable in name
Date: Sun, 25 Jan 2009 22:54:12 -0800
emacs -Q
 
Create a file named `grep.exe' in some directory. The file content is
unimportant.
 
Use `C-u C-x d' to visit the directory, and specify `-alF' as the
listing switches.
 
Put the cursor on the line of the file named `grep.exe', which is
displayed as `grep.exe*' to show that it is executable.
 
M-: (dired-get-filename) returns "/the/dir/to/grep.exe*"
 
That is, the display artifact `*' is included as part of the file
name. This is also a bug in Emacs 22.3. It is a regression from Emacs
21.3.1.
 

In GNU Emacs 23.0.60.1 (i386-mingw-nt5.1.2600)
 of 2009-01-04 on LENNART-69DE564
Windowing system distributor `Microsoft Corp.', version 5.1.2600
configured using `configure --with-gcc (3.4) --no-opt --cflags -Ic:/g/include
-fno-crossjumping'
 
 



[Message part 3 (message/rfc822, inline)]
From: Eli Zaretskii <eliz <at> gnu.org>
To: Jason Rumney <jasonr <at> gnu.org>, 2068-done <at> debbugs.gnu.org
Cc: cyd <at> stupidchicken.com, Drew Adams <drew.adams <at> oracle.com>
Subject: Re: bug#2068: 23.0.60;	dired-get-filename includes `*' for executable in name
Date: Wed, 28 Jan 2009 21:07:35 +0200
> From: "Drew Adams" <drew.adams <at> oracle.com>
> Date: Tue, 27 Jan 2009 12:43:25 -0800
> Cc: 
> 
> > > emacs -Q
> > > 
> > > Create a file named `grep.exe' in some directory.
> > >
> > > Use `C-u C-x d' to visit the directory, and specify `-alF' as the
> > > listing switches.
> > > 
> > > Put the cursor on the line of the file named `grep.exe', which is
> > > displayed as `grep.exe*' to show that it is executable.
> >  
> > > M-: (dired-get-filename) returns "/the/dir/to/grep.exe*"
> >  
> > Can't reproduce this.  If this bug exists, it's probably Windows-only.
> 
> Yes, I pretty much figured it was Windows-only.

ls-lisp.el was putting the `dired-filename' property incorrectly when
the "-F" switch was used.  Fixed as below.

If you want to try this without rebuilding Emacs, you will need to
issue 2 commands, after byte-compiling the patched ls-lisp.el:

  M-x load-library RET files RET
  M-x load-library RET ls-lisp RET

IOW, files.elc needs to be loaded before ls-lisp, because the latter
redefines some functions in the former, and redefining them again will
give you trouble.

2009-01-28  Eli Zaretskii  <eliz <at> gnu.org>

	* ls-lisp.el (ls-lisp-classify): Propertize file name before
	concatenating the type indicating character.
	(ls-lisp-format): Don't propertize file-name only if
	ls-lisp-classify already did.


Index: lisp/ls-lisp.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/ls-lisp.el,v
retrieving revision 1.80
retrieving revision 1.81
diff -u -r1.80 -r1.81
--- lisp/ls-lisp.el	5 Jan 2009 03:19:31 -0000	1.80
+++ lisp/ls-lisp.el	28 Jan 2009 19:01:42 -0000	1.81
@@ -531,13 +531,17 @@
         (type (cadr filedata)))
     (cond (type
 	   (cons
-	    (concat file-name (if (eq type t) "/" "@"))
+	    (concat (propertize file-name 'dired-filename t)
+		    (if (eq type t) "/" "@"))
 	    (cdr filedata)))
 	  ((string-match "x" (nth 9 filedata))
 	   (cons
-	    (concat file-name "*")
+	    (concat (propertize file-name 'dired-filename t) "*")
 	    (cdr filedata)))
-	  (t filedata))))
+	  (t
+	   (cons
+	    (propertize file-name 'dired-filename t)
+	    (cdr filedata))))))
 
 (defun ls-lisp-extension (filename)
   "Return extension of FILENAME (ignoring any version extension)
@@ -632,7 +636,9 @@
 	    " "
 	    (ls-lisp-format-time file-attr time-index now)
 	    " "
-	    (propertize file-name 'dired-filename t)
+	    (if (not (memq ?F switches)) ; ls-lisp-classify already did that
+		(propertize file-name 'dired-filename t)
+	      file-name)
 	    (if (stringp file-type)	; is a symbolic link
 		(concat " -> " file-type))
 	    "\n"


This bug report was last modified 16 years and 197 days ago.

Previous Next


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