all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
To: <emacs-pretest-bug@gnu.org>
Subject: bug#5420: 23.1.91; dired-goto-file does not work with a listing of absolute file names
Date: Mon, 18 Jan 2010 17:17:24 -0800	[thread overview]
Message-ID: <18FFD0D211884A6E80981C22ED87DBD6@us.oracle.com> (raw)

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







                 reply	other threads:[~2010-01-19  1:17 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=18FFD0D211884A6E80981C22ED87DBD6@us.oracle.com \
    --to=drew.adams@oracle.com \
    --cc=emacs-pretest-bug@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.