bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

dired-aux.el's (dired-show-file-type) is not protected from files beginn


From: Fabrice Bauzac
Subject: dired-aux.el's (dired-show-file-type) is not protected from files beginning with '-'
Date: Fri, 10 May 2002 12:45:11 +0000

In GNU Emacs 21.2.1 (i386-debian-linux-gnu, X toolkit, Xaw3d scroll bars)
 of 2002-03-22 on raven, modified by Debian
configured using `configure  i386-debian-linux-gnu --prefix=/usr 
--sharedstatedir=/var/lib --libexecdir=/usr/lib --localstatedir=/var/lib 
--infodir=/usr/share/info --mandir=/usr/share/man --with-pop=yes --with-x=yes 
--with-x-toolkit=athena --without-gif'
Important settings:
  value of $LC_ALL: fr_FR
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: fr_FR
  locale-coding-system: iso-latin-1
  default-enable-multibyte-characters: t

Good afternoon,

In Dired-mode, the dired-show-file-type command (executed when y is
pressed) does not work on files that begin with a "-".

Here is how to reproduce the bug:

================================================================
$ touch /tmp/-a
$ emacs -q
C-x d /tmp RET
(position the cursor on the line describing the "-a" file)
y
================================================================

And this is what is then displayed on the minibuffer:

================================================================
/usr/bin/file: invalid option -- a
Usage: file [-bciknsvzL] [-f namefile] [-m magicfiles] file...
Usage: file -C [-m magic]
================================================================

Below is a patch that adds a "--" command-line argument to "file" and
that corrects the problem on my system.  The semantics (end of the
options list) is understood by the version of "file" on my
Debian-unstable system:

$ file --version
file-3.37-3.1
magic data from /etc/magic:/usr/share/misc/magic
$

and by SunOS 5.7's "file".

Note: SunOS 5.7's "file" utility doesn't understand the "-L" option.

================================================================
*** /tmp/dired-aux.el.orig      Fri May 10 12:40:25 2002
--- /tmp/dired-aux.el   Fri May 10 12:40:42 2002
***************
*** 2018,2025 ****
    (interactive (list (dired-get-filename t) current-prefix-arg))
    (with-temp-buffer 
      (if deref-symlinks
!       (call-process "file" nil t t "-L" file)
!       (call-process "file" nil t t file))
      (when (bolp)
        (backward-delete-char 1))
      (message (buffer-string))))
--- 2018,2025 ----
    (interactive (list (dired-get-filename t) current-prefix-arg))
    (with-temp-buffer 
      (if deref-symlinks
!       (call-process "file" nil t t "-L" "--" file)
!       (call-process "file" nil t t "--" file))
      (when (bolp)
        (backward-delete-char 1))
      (message (buffer-string))))
================================================================

Have a nice day,

Recent input:
SPC j e SPC ESC DEL ESC DEL d a n s SPC l e SPC s y 
s t e m e RET ESC [ 1 9 ~ l m DEL ESC [ 1 9 ~ m y C-h 
k y C-x o RET C-n C-p C-e C-b RET C-n C-p C-e C-b C-b 
RET C-x 1 C-p C-@ C-u C-n C-u C-n C-u C-n C-n ESC w 
C-x m b u g - g n u - e m a c s C-x k RET ESC x r e 
g DEL p o TAB r t TAB RET

Recent messages:
ven mai 10 12:13:19 UTC 2002
Type C-x 1 to remove help window.  C-M-v to scroll the help.
Note: file is write protected
Mark set
Making completion list...
Loading emacsbug...done

-- 
fabrice bauzac
Software should be free.  http://www.gnu.org/philosophy/why-free.html



reply via email to

[Prev in Thread] Current Thread [Next in Thread]