* bug#5420: 23.1.91; dired-goto-file does not work with a listing of absolute file names
@ 2010-01-19 1:17 Drew Adams
0 siblings, 0 replies; only message in thread
From: Drew Adams @ 2010-01-19 1:17 UTC (permalink / raw)
To: emacs-pretest-bug
emacs -Q
Let A and B be the absolute file names of some existing files, possibly in
different directories. You can pass an explicit list of files to `dired', and
those file names can be absolute.
M-: (dired '("foo" A B)) ; with A and B as absolute file names
If you do that, you get a functioning Dired buffer that lists only those files.
They are listed as absolute file names, as they must be, since they can be in
different directories. No problem; Dired works fine with such a listing, in
general - you can do pretty much everything normally.
However, `dired-goto-file' does not work in such a listing; `dired-goto-file'
does not work if the displayed file names are absolute.
M-: (dired-goto-file A) ; with A the absolute file name as listed
This is so because `dired-goto-file' searches for a space followed by the
_relative_ file name:
(let ((base (file-name-nondirectory file)) ; <<< RELATIVE NAME
search-string
(boundary (dired-subdir-max)))
(setq search-string (replace-regexp-in-string
"\^m" "\\^m" base nil t))
(setq search-string (replace-regexp-in-string
"\\\\" "\\\\" search-string nil t))
(while (and (not found)
;; filenames are preceded by SPC, this makes
;; the search faster (e.g. for the filename "-"!).
(search-forward (concat " " search-string) boundary 'move))
...
`dired-goto-file' is used in several places in the code, in addition to its
interactive use, so this breaks a certain number of things. In particular, it
breaks `dired-mark-remembered', so you cannot restore a set of recorded
markings.
In GNU Emacs 23.1.91.1 (i386-mingw-nt5.1.2600)
of 2010-01-02 on PRETEST
Windowing system distributor `Microsoft Corp.', version 5.1.2600
configured using `configure --with-gcc (3.4)'
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2010-01-19 1:17 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-19 1:17 bug#5420: 23.1.91; dired-goto-file does not work with a listing of absolute file names Drew Adams
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.