GNU bug report logs - #5551
23.1.92; Dired shows wrongly whole directory contents

Previous Next

Package: emacs;

Reported by: Michael Albinus <michael.albinus <at> gmx.de>

Date: Tue, 9 Feb 2010 12:43:02 UTC

Severity: normal

Done: Michael Albinus <michael.albinus <at> gmx.de>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 5551 in the body.
You can then email your comments to 5551 AT debbugs.gnu.org in the normal way.

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

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


Report forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#5551; Package emacs. (Tue, 09 Feb 2010 12:43:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Michael Albinus <michael.albinus <at> gmx.de>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 09 Feb 2010 12:43:02 GMT) Full text and rfc822 format available.

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

From: Michael Albinus <michael.albinus <at> gmx.de>
To: bug-gnu-emacs <at> gnu.org
Subject: 23.1.92; Dired shows wrongly whole directory contents
Date: Tue, 09 Feb 2010 13:42:04 +0100
This bug report will be sent to the Free Software Foundation,
not to your local site managers!
Please write in English if possible, because the Emacs maintainers
usually do not have translators to read other languages for them.
According to the doc, dired shall show single file entries when called
with a list of file names. If a file name is a directory, this works OK
with remote directory names. But with local directory names, it shows
the whole directory contents, which is wrong. Example:

--8<---------------cut here---------------start------------->8---
(dired
 '("foo"
   "~/"
   "/ftp:anonymous <at> alpha.gnu.org:/gnu/emacs/pretest/windows"))
--8<---------------cut here---------------end--------------->8---

results in

--8<---------------cut here---------------start------------->8---
  /home/albinus/lisp:
  total 2204
  drwxr-xr-x 47 albinus albinus   4096 2010-02-09 13:34 .
  drwxr-xr-x  4 root    root      4096 2009-01-26 13:38 ..
  lrwxrwxrwx  1 albinus albinus      7 2009-10-11 14:59 aaa -> /.emacs
  drwx------  3 albinus albinus   4096 2009-08-04 16:25 .arch-params

...

drwxr-xr-x    2 1003     1003         4096 Jan 03 13:40 /ftp:anonymous <at> alpha.gnu.org:/gnu/emacs/pretest/windows
--8<---------------cut here---------------end--------------->8---

But I would have expected

--8<---------------cut here---------------start------------->8---
  /home/albinus/lisp:
  total 2204
  drwxr-xr-x 47 albinus albinus   4096 2010-02-09 13:34 /home/albinus
  drwxr-xr-x  2 1003     1003     4096     Jan 03 13:40 /ftp:anonymous <at> alpha.gnu.org:/gnu/emacs/pretest/windows
--8<---------------cut here---------------end--------------->8---


If Emacs crashed, and you have the Emacs process in the gdb debugger,
please include the output from the following gdb commands:
    `bt full' and `xbacktrace'.
For information about debugging Emacs, please read the file
/home/albinus/src/emacs/etc/DEBUG.


In GNU Emacs 23.1.92.4 (i686-pc-linux-gnu, GTK+ Version 2.16.1)
 of 2010-02-05 on ubuntu
Windowing system distributor `The X.Org Foundation', version 11.0.10600000
Important settings:
  value of $LC_ALL: nil
  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: en_US.UTF-8
  value of $XMODIFIERS: nil
  locale-coding-system: utf-8-unix
  default enable-multibyte-characters: t

Major mode: Text

Minor modes in effect:
  diff-auto-refine-mode: t
  display-time-mode: t
  shell-dirtrack-mode: t
  iswitchb-mode: t
  icomplete-mode: t
  partial-completion-mode: t
  show-paren-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
<return> y q C-x 0 <down> <down> <down> <down> <down>
<down> <down> <down> C-x C-e C-x k <return> C-x 0 C-x
C-e C-x k <return> C-x 0 <down> <end> C-x C-e C-x k
<return> <up> <up> <down> <left> <left> <backspace>
<backspace> <backspace> <backspace> <backspace> <backspace>
<down> <kp-2> <left> <left> <left> <backspace> <backspace>
<backspace> <backspace> <backspace> <backspace> <backspace>
<end> C-x C-e <end> <up> <return> C-x k <return> <up>
<return> <home> C-x k <return> <escape> x b u g <tab>
<kp-add> r e p o <tab> r <tab> <return>

Recent messages:
#<buffer foo>
Mark set
Doing CD...done
Listing /ftp:anonymous <at> alpha.gnu.org:/gnu/emacs/pretest/...done
#<buffer foo>
Mark set
Doing CD...done
Listing /ftp:anonymous <at> alpha.gnu.org:/gnu/emacs/pretest/windows/...done
if: File no longer exists; type `g' to update dired buffer
Mark set

Load-path shadows:
~/src/tramp/lisp/tramp-imap hides ~/lisp/tramp-imap
~/src/tramp/lisp/tramp-gvfs hides ~/lisp/tramp-gvfs
~/src/tramp/lisp/tramp-fish hides /usr/local/src/emacs/lisp/net/tramp-fish
~/src/tramp/lisp/tramp-cmds hides /usr/local/src/emacs/lisp/net/tramp-cmds
~/src/tramp/lisp/tramp-gvfs hides /usr/local/src/emacs/lisp/net/tramp-gvfs
~/lisp/dbus hides /usr/local/src/emacs/lisp/net/dbus
~/src/tramp/lisp/tramp-cache hides /usr/local/src/emacs/lisp/net/tramp-cache
~/src/tramp/lisp/tramp-uu hides /usr/local/src/emacs/lisp/net/tramp-uu
~/src/tramp/lisp/tramp-smb hides /usr/local/src/emacs/lisp/net/tramp-smb
~/src/tramp/lisp/tramp hides /usr/local/src/emacs/lisp/net/tramp
~/src/tramp/lisp/tramp-imap hides /usr/local/src/emacs/lisp/net/tramp-imap
~/src/tramp/lisp/tramp-compat hides /usr/local/src/emacs/lisp/net/tramp-compat
~/src/tramp/lisp/tramp-gw hides /usr/local/src/emacs/lisp/net/tramp-gw
~/src/tramp/lisp/tramp-ftp hides /usr/local/src/emacs/lisp/net/tramp-ftp
~/src/tramp/lisp/trampver hides /usr/local/src/emacs/lisp/net/trampver

Features:
(shadow warnings emacsbug gnus-fun log-view pcvs-util url-cache url-http
tls url-gw url-auth url-handlers nnweb mm-url url url-proxy url-privacy
url-expand url-methods url-history url-cookie url-util tabify man
add-log desktop vc-sccs vc-svn vc-cvs vc-rcs diff-mode cus-start
cus-load recentf tree-widget mule-util cc-mode cc-fonts cc-menus cc-cmds
cc-styles cc-align cc-engine cc-vars cc-defs find-func utf-7 utf7
starttls imap-hash imap ange-ftp cl-specs edebug info apropos debug
vc-bzr gnus-dup multi-isearch ediff-merg ediff-diff ediff-wind
ediff-help ediff-util ediff-mult ediff-init ediff noutline outline
easy-mmode newcomment vc-git make-mode help-mode view time-stamp
dired-aux sort gnus-cite html2text smiley ansi-color mail-extr
gnus-agent gnus-srvr nnvirtual gnus-async gnus-bcklg parse-time timezone
gnus-score score-mode gnus-ml gnus-msg gnus-art mm-uu mml2015 mm-view
smime dig disp-table gnus-cache gnus-sum nnfolder byte-opt bytecomp
byte-compile nnml nndraft nnmh nnnil smtpmail gnus-demon nntp gnus-group
gnus-undo nnmail mail-source nnoo gnus-start gnus-spec gnus-int
gnus-range message sendmail ecomplete rfc822 mml mml-sec mm-decode
mm-bodies mm-encode mailcap mail-parse rfc2231 rfc2047 rfc2045 qp
ietf-drums mailabbrev gmm-utils mailheader canlock sha1 hex-util
hashcash gnus-win gnus gnus-ems nnheader mail-utils wid-edit cperl-mode
easymenu time tramp-imap assoc tramp-gw tramp-gvfs zeroconf url-parse
url-vars mm-util mail-prsvr dbus xml tramp-fish tramp-smb tramp-cache
tramp-ftp tramp-cmds tramp auth-source gnus-util netrc time-date advice
help-fns advice-preload shell comint ring password-cache format-spec
tramp-compat cl cl-19 trampver epa-file epa derived epg epg-config
iswitchb jka-compr icomplete complete paren ps-print ps-def lpr vc-dir
ewoc vc vc-dispatcher dired regexp-opt tooltip ediff-hook vc-hooks
lisp-float-type mwheel x-win x-dnd font-setting tool-bar dnd fontset
image fringe lisp-mode register page menu-bar rfn-eshadow timer select
scroll-bar mldrag mouse jit-lock font-lock syntax facemenu font-core
frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai
tai-viet lao korean japanese hebrew greek romanian slovak czech european
ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help
simple abbrev loaddefs button minibuffer faces cus-face files
text-properties overlay md5 base64 format env code-pages mule custom
widget hashtable-print-readable backquote make-network-process dbusbind
system-font-setting font-render-setting gtk x-toolkit x multi-tty emacs)





Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#5551; Package emacs. (Tue, 09 Feb 2010 15:28:02 GMT) Full text and rfc822 format available.

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

From: Michael Albinus <michael.albinus <at> gmx.de>
To: 5551 <at> debbugs.gnu.org
Subject: Re: bug#5551: 23.1.92; Dired shows wrongly whole directory contents
Date: Tue, 09 Feb 2010 16:27:09 +0100
> According to the doc, dired shall show single file entries when called
> with a list of file names. If a file name is a directory, this works OK
> with remote directory names. But with local directory names, it shows
> the whole directory contents, which is wrong.

The following patch ought to solve this:

--8<---------------cut here---------------start------------->8---
*** lisp/files.el	2010-01-27 03:36:36 +0000
--- lisp/files.el	2010-02-09 15:14:12 +0000
***************
*** 5699,5704 ****
--- 5699,5709 ----
  				 (shell-quote-wildcard-pattern pattern))))
  		    ;; SunOS 4.1.3, SVr4 and others need the "." to list the
  		    ;; directory if FILE is a symbolic link.
+ 		    (unless full-directory-p
+ 		      (setq switches
+ 			    (if (stringp switches)
+ 				(concat switches " -d")
+ 			      (add-to-list 'switches "-d" 'append))))
  		    (apply 'call-process
  			   insert-directory-program nil t nil
  			   (append
--8<---------------cut here---------------end--------------->8---

Any objections to install the patch? Stefan?

Best regards, Michael.




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#5551; Package emacs. (Wed, 10 Feb 2010 09:28:02 GMT) Full text and rfc822 format available.

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

From: Chong Yidong <cyd <at> stupidchicken.com>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: 5551 <at> debbugs.gnu.org
Subject: Re: bug#5551: 23.1.92; Dired shows wrongly whole directory contents
Date: Wed, 10 Feb 2010 04:27:27 -0500
Michael Albinus <michael.albinus <at> gmx.de> writes:

> According to the doc, dired shall show single file entries when called
> with a list of file names. If a file name is a directory, this works OK
> with remote directory names. But with local directory names, it shows
> the whole directory contents, which is wrong.

The doc seems ambiguous to me, and it is not clear to me what is the
better behavior.  Do you have an argument for why displaying just the
directory name is better?

But the present behavior has been around since at least Emacs 22, so I
don't think we should make this change right now in any case.




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#5551; Package emacs. (Wed, 10 Feb 2010 09:48:01 GMT) Full text and rfc822 format available.

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

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Chong Yidong <cyd <at> stupidchicken.com>
Cc: Drew Adams <drew.adams <at> oracle.com>,
	"5551 <at> debbugs.gnu.org" <5551 <at> debbugs.gnu.org>
Subject: Re: bug#5551: 23.1.92; Dired shows wrongly whole directory contents
Date: Wed, 10 Feb 2010 10:46:48 +0100
Chong Yidong <cyd <at> stupidchicken.com> writes:

> The doc seems ambiguous to me, and it is not clear to me what is the
> better behavior.  Do you have an argument for why displaying just the
> directory name is better?

Have you tried the example I gave in the bug report? There is definitely
an error, if default-directory points to "~/somewhere/else", and you
apply

  (dired '("foo" "~/"))

You will see the relative file names listed from "~/", but if you click
on a file name, you cannot open, because default-directory is still
"~/somewhere/else".

My proposed change was influenced by the comment in front of
insert-directory:

;; insert-directory
;; - must insert _exactly_one_line_ describing FILE if WILDCARD and
;;   FULL-DIRECTORY-P is nil.
;;   The single line of output must display FILE's name as it was
;;   given, namely, an absolute path name.

> But the present behavior has been around since at least Emacs 22, so I
> don't think we should make this change right now in any case.

It was also in Emacs 21.3 (Drew Adams has tested). But it is still an error.

Best regards, Michael.




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#5551; Package emacs. (Wed, 10 Feb 2010 16:48:02 GMT) Full text and rfc822 format available.

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

From: "Drew Adams" <drew.adams <at> oracle.com>
To: "'Chong Yidong'" <cyd <at> stupidchicken.com>,
	"'Michael Albinus'" <michael.albinus <at> gmx.de>
Cc: 5551 <at> debbugs.gnu.org
Subject: RE: bug#5551: 23.1.92; Dired shows wrongly whole directory contents
Date: Wed, 10 Feb 2010 08:47:01 -0800
> > According to the doc, dired shall show single file entries 
> > when called with a list of file names. If a file name is a
> > directory, this works OK with remote directory names. But
> > with local directory names, it shows
> > the whole directory contents, which is wrong.
> 
> The doc seems ambiguous to me, and it is not clear to me what is the
> better behavior.  Do you have an argument for why displaying just the
> directory name is better?
> 
> But the present behavior has been around since at least Emacs 22, so I
> don't think we should make this change right now in any case.

Please apply Michael's patch.

When `dired' is passed a cons arg (a list of file or directory names), it should
show a Dired buffer with only those names. A directory name should be inserted
as a single line - the directory contents should *not* be inserted.

I confirm that this works correctly on Windows (e.g. 23.1 and 23-1-91 pretest),
but it works incorrectly on Linux with Emacs 21.3.1. (I don't have access to
other Emacs versions on Linux.)





Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#5551; Package emacs. (Sat, 13 Feb 2010 07:34:01 GMT) Full text and rfc822 format available.

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

From: Chong Yidong <cyd <at> stupidchicken.com>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: Drew Adams <drew.adams <at> oracle.com>,
	"5551 <at> debbugs.gnu.org" <5551 <at> debbugs.gnu.org>
Subject: Re: bug#5551: 23.1.92; Dired shows wrongly whole directory contents
Date: Sat, 13 Feb 2010 02:33:23 -0500
Michael Albinus <michael.albinus <at> gmx.de> writes:

> Have you tried the example I gave in the bug report? There is definitely
> an error, if default-directory points to "~/somewhere/else", and you
> apply
>
>   (dired '("foo" "~/"))
>
> You will see the relative file names listed from "~/", but if you click
> on a file name, you cannot open, because default-directory is still
> "~/somewhere/else".

I see; this is indeed a problem, so I guess we can risk committing the
patch.  Please do so, thanks.




Reply sent to Michael Albinus <michael.albinus <at> gmx.de>:
You have taken responsibility. (Sun, 14 Feb 2010 09:32:02 GMT) Full text and rfc822 format available.

Notification sent to Michael Albinus <michael.albinus <at> gmx.de>:
bug acknowledged by developer. (Sun, 14 Feb 2010 09:32:02 GMT) Full text and rfc822 format available.

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

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Chong Yidong <cyd <at> stupidchicken.com>
Cc: 5551-done <at> debbugs.gnu.org
Subject: Re: bug#5551: 23.1.92; Dired shows wrongly whole directory contents
Date: Sun, 14 Feb 2010 10:31:36 +0100
Chong Yidong <cyd <at> stupidchicken.com> writes:

> Michael Albinus <michael.albinus <at> gmx.de> writes:
>
>> Have you tried the example I gave in the bug report? There is definitely
>> an error, if default-directory points to "~/somewhere/else", and you
>> apply
>>
>>   (dired '("foo" "~/"))
>>
>> You will see the relative file names listed from "~/", but if you click
>> on a file name, you cannot open, because default-directory is still
>> "~/somewhere/else".
>
> I see; this is indeed a problem, so I guess we can risk committing the
> patch.  Please do so, thanks.

Committed.

Best regards, Michael.




bug archived. Request was from Debbugs Internal Request <bug-gnu-emacs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 14 Mar 2010 11:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 15 years and 99 days ago.

Previous Next


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