From: Kevin Rodgers <kevinr@ihs.com>
Subject: Re: find-alternate-file from dired wildcard dir
Date: Fri, 12 Apr 2002 10:07:17 -0600 [thread overview]
Message-ID: <3CB70635.620302DC@ihs.com> (raw)
In-Reply-To: m2it6yyvo9.fsf@jidanni.org
Dan Jacobson wrote:
>
> find-alternate-file prompts with the current filename -- quite
> helpful. However if it is in a dired wildcard directory, e,g, from C-x d
> *.c then this doesn't work. The *.c isn't even available from M-n either.
Here's a workaround to make it available via `M-n':
(defadvice find-alternate-file (around dired-directory activate)
"Use `dired-directory' as `buffer-file-name' when called interactively."
(let ((buffer-file-name (and (interactive-p)
(stringp dired-directory)
dired-directory)))
ad-do-it))
To automatically insert it in the minibuffer, you'd have to copy the entire
9-line `interactive' form from files.el to the advice and add the same
buffer-file-name binding to its `let' form as above. But then you may as
well just modify files.el instead.
This doesn't handle the case where `dired-directory' is a list, which I
think only occurs when dired is called programmatically anyway.
--
Kevin Rodgers <kevinr@ihs.com>
next prev parent reply other threads:[~2002-04-12 16:07 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-04-11 17:47 find-alternate-file from dired wildcard dir Dan Jacobson
2002-04-12 16:07 ` Kevin Rodgers [this message]
2002-04-12 18:18 ` Kevin Rodgers
2002-04-16 4:20 ` insert current buffer name anywhere vs. M-p M-n Dan Jacobson
2002-04-16 10:22 ` Ehud Karni
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3CB70635.620302DC@ihs.com \
--to=kevinr@ihs.com \
/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 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).