unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#5551: 23.1.92; Dired shows wrongly whole directory contents
@ 2010-02-09 12:42 Michael Albinus
  2010-02-09 15:27 ` Michael Albinus
  2010-02-10  9:27 ` Chong Yidong
  0 siblings, 2 replies; 7+ messages in thread
From: Michael Albinus @ 2010-02-09 12:42 UTC (permalink / raw)
  To: 5551

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@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@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@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@alpha.gnu.org:/gnu/emacs/pretest/...done
#<buffer foo>
Mark set
Doing CD...done
Listing /ftp:anonymous@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)







^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#5551: 23.1.92; Dired shows wrongly whole directory contents
  2010-02-09 12:42 bug#5551: 23.1.92; Dired shows wrongly whole directory contents Michael Albinus
@ 2010-02-09 15:27 ` Michael Albinus
  2010-02-10  9:27 ` Chong Yidong
  1 sibling, 0 replies; 7+ messages in thread
From: Michael Albinus @ 2010-02-09 15:27 UTC (permalink / raw)
  To: 5551

> 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.






^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#5551: 23.1.92; Dired shows wrongly whole directory contents
  2010-02-09 12:42 bug#5551: 23.1.92; Dired shows wrongly whole directory contents Michael Albinus
  2010-02-09 15:27 ` Michael Albinus
@ 2010-02-10  9:27 ` Chong Yidong
  2010-02-10  9:46   ` Michael Albinus
  2010-02-10 16:47   ` Drew Adams
  1 sibling, 2 replies; 7+ messages in thread
From: Chong Yidong @ 2010-02-10  9:27 UTC (permalink / raw)
  To: Michael Albinus; +Cc: 5551

Michael Albinus <michael.albinus@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.






^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#5551: 23.1.92; Dired shows wrongly whole directory contents
  2010-02-10  9:27 ` Chong Yidong
@ 2010-02-10  9:46   ` Michael Albinus
  2010-02-13  7:33     ` Chong Yidong
  2010-02-10 16:47   ` Drew Adams
  1 sibling, 1 reply; 7+ messages in thread
From: Michael Albinus @ 2010-02-10  9:46 UTC (permalink / raw)
  To: Chong Yidong; +Cc: 5551@debbugs.gnu.org

Chong Yidong <cyd@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.






^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#5551: 23.1.92; Dired shows wrongly whole directory contents
  2010-02-10  9:27 ` Chong Yidong
  2010-02-10  9:46   ` Michael Albinus
@ 2010-02-10 16:47   ` Drew Adams
  1 sibling, 0 replies; 7+ messages in thread
From: Drew Adams @ 2010-02-10 16:47 UTC (permalink / raw)
  To: 'Chong Yidong', 'Michael Albinus'; +Cc: 5551

> > 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.)







^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#5551: 23.1.92; Dired shows wrongly whole directory contents
  2010-02-10  9:46   ` Michael Albinus
@ 2010-02-13  7:33     ` Chong Yidong
  2010-02-14  9:31       ` Michael Albinus
  0 siblings, 1 reply; 7+ messages in thread
From: Chong Yidong @ 2010-02-13  7:33 UTC (permalink / raw)
  To: Michael Albinus; +Cc: 5551@debbugs.gnu.org

Michael Albinus <michael.albinus@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.






^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#5551: 23.1.92; Dired shows wrongly whole directory contents
  2010-02-13  7:33     ` Chong Yidong
@ 2010-02-14  9:31       ` Michael Albinus
  0 siblings, 0 replies; 7+ messages in thread
From: Michael Albinus @ 2010-02-14  9:31 UTC (permalink / raw)
  To: Chong Yidong; +Cc: 5551-done

Chong Yidong <cyd@stupidchicken.com> writes:

> Michael Albinus <michael.albinus@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.






^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2010-02-14  9:31 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-02-09 12:42 bug#5551: 23.1.92; Dired shows wrongly whole directory contents Michael Albinus
2010-02-09 15:27 ` Michael Albinus
2010-02-10  9:27 ` Chong Yidong
2010-02-10  9:46   ` Michael Albinus
2010-02-13  7:33     ` Chong Yidong
2010-02-14  9:31       ` Michael Albinus
2010-02-10 16:47   ` Drew Adams

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).