unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* dired-aux.el's (dired-show-file-type) is not protected from files beginning with '-'
@ 2002-05-10 12:45 Fabrice Bauzac
  0 siblings, 0 replies; only message in thread
From: Fabrice Bauzac @ 2002-05-10 12:45 UTC (permalink / raw)


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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2002-05-10 12:45 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-05-10 12:45 dired-aux.el's (dired-show-file-type) is not protected from files beginning with '-' Fabrice Bauzac

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).