From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Kevin Rodgers Newsgroups: gmane.emacs.bugs Subject: Re: find-alternate-file from dired wildcard dir Date: Fri, 12 Apr 2002 10:07:17 -0600 Organization: IHS Engineering, Electronic Systems Development Sender: bug-gnu-emacs-admin@gnu.org Message-ID: <3CB70635.620302DC@ihs.com> References: NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: main.gmane.org 1018627761 9900 127.0.0.1 (12 Apr 2002 16:09:21 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Fri, 12 Apr 2002 16:09:21 +0000 (UTC) Return-path: Original-Received: from fencepost.gnu.org ([199.232.76.164]) by main.gmane.org with esmtp (Exim 3.33 #1 (Debian)) id 16w3c0-0002ZS-00 for ; Fri, 12 Apr 2002 18:09:21 +0200 Original-Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 16w3c0-0006TC-00; Fri, 12 Apr 2002 12:09:20 -0400 Original-Received: from mailbox3.ucsd.edu ([132.239.1.55]) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 16w3Zc-00067T-00 for ; Fri, 12 Apr 2002 12:06:53 -0400 Original-Received: from mail.fu-berlin.de (mail.fu-berlin.de [160.45.11.165]) by mailbox3.ucsd.edu (8.12.1/8.12.1) with ESMTP id g3CG6ou7020656 for ; Fri, 12 Apr 2002 09:06:51 -0700 (PDT) Original-Received: by mail.fu-berlin.de (Smail3.2.0.98) from Curry.ZEDAT.FU-Berlin.DE (160.45.10.36) with esmtp id ; Fri, 12 Apr 2002 18:06:50 +0200 (MEST) Original-Received: by Curry.ZEDAT.FU-Berlin.DE (Smail3.2.0.98) from news.fu-berlin.de with bsmtp id ; Fri, 12 Apr 2002 18:06:49 +0200 (MEST) Original-To: gnu-emacs-bug@moderators.isc.org Original-Path: 170.207.51.80!not-for-mail Original-Newsgroups: gnu.emacs.bug Original-Lines: 25 X-Orig-NNTP-Posting-Host: 170.207.51.80 X-Orig-X-Trace: fu-berlin.de 1018627609 922634 170.207.51.80 (16 [82742]) X-Mailer: Mozilla 4.78 [en] (X11; U; SunOS 5.7 i86pc) X-Accept-Language: en Errors-To: bug-gnu-emacs-admin@gnu.org X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.0.9 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Bug reports for GNU Emacs, the Swiss army knife of text editors List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.bugs:608 X-Report-Spam: http://spam.gmane.org/gmane.emacs.bugs:608 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