From: "Drew Adams" <drew.adams@oracle.com>
To: <5478@debbugs.gnu.org>
Subject: bug#5478: 23.1.91; Cannot use dired with cons DIRNAME arg if include remote files
Date: Mon, 25 Jan 2010 21:14:20 -0800 [thread overview]
Message-ID: <3F08B52228FF450E9346548AB6E30C7B@us.oracle.com> (raw)
In-Reply-To: <72D5669EF250488BB23F1D1E23EB9C7F@us.oracle.com>
Here is some info about the cause of this bug. It has to do with the very
different way that local and remote file and directory names are handled by
`insert-directory'. Remote names are not handled correctly.
Local file and dir names are inserted into Dired verbatim: if they are absolute
names, then they remain such.
Remote names are instead relativized (they should not be). And in the case of a
remote directory name, instead of the directory name itself being inserted, its
constituent file names are inserted. (So there are in fact two bugs, or two
aspects to this bug.)
Here are some details:
`dired-internal-noselect' calls `dired-readin', which calls `insert-directory'
for each of the absolute file names in `dired-directory', which is the cons from
the DIR-OR-LIST arg to `dired-internal-noselect'.
The problem for a remote file name or a remote directory name as one of the
elements of the cons comes I think from this code in the definition of
`insert-directory' in ls-lisp.el:
(let ((handler (find-file-name-handler (expand-file-name file)
'insert-directory))
(orig-file file)
wildcard-regexp)
(if handler
(funcall handler 'insert-directory file switches
wildcard full-directory-p)
and this code in ange-ftp.el:
(put 'insert-directory 'ange-ftp 'ange-ftp-insert-directory)
When a local directory name or an (absolute) local file name is an element of
the cons DIRNAME, `insert-directory' just inserts it verbatim as a single name
in the Dired buffer. That is the correct behavior for the cons DIRNAME case:
each file or dir in the cons should just be inserted in the Dired buffer. This
is done by calling `ls-lisp-insert-directory'.
But when a remote directory name or a remote (absolute) file name is an element
of the cons DIRNAME, the handler `ange-ftp-insert-directory' is called. For a
remote directory name element, it inserts the relative file names of the files
in that remote dir, instead of just inserting the remote dir name itself. For a
remote file-name element, it inserts the relative name instead of the absolute
file name.
IOW, for local files and dirs, `insert-directory' just inserts the names. For
remote files and dirs, it inserts relative file names. And in the case of a
remote dir, it inserts the (relative) names of the files in the dir, instead of
the dir name itself.
next prev parent reply other threads:[~2010-01-26 5:14 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-26 0:40 bug#5478: 23.1.91; Cannot use dired with cons DIRNAME arg if include remote files Drew Adams
2010-01-26 5:14 ` Drew Adams [this message]
2010-01-27 0:45 ` Drew Adams
2010-01-28 21:19 ` Michael Albinus
2010-02-09 16:11 ` Michael Albinus
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3F08B52228FF450E9346548AB6E30C7B@us.oracle.com \
--to=drew.adams@oracle.com \
--cc=5478@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.