From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Niels Giesen Newsgroups: gmane.emacs.help Subject: Re: set a "default" directory in a function when asking for a file Date: Sun, 16 Nov 2008 16:47:06 +0100 Organization: A noiseless patient Spider Message-ID: <87r65b4qrp.fsf@gmail.com> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1226853653 21341 80.91.229.12 (16 Nov 2008 16:40:53 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 16 Nov 2008 16:40:53 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Nov 16 17:41:55 2008 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1L1kh6-0005kh-PL for geh-help-gnu-emacs@m.gmane.org; Sun, 16 Nov 2008 17:41:52 +0100 Original-Received: from localhost ([127.0.0.1]:33860 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L1kfy-0004I6-3u for geh-help-gnu-emacs@m.gmane.org; Sun, 16 Nov 2008 11:40:42 -0500 Original-Path: news.stanford.edu!headwall.stanford.edu!newshub.sdsu.edu!feeder.erje.net!85.214.105.209.MISMATCH!news.eternal-september.org!news.motzarella.org!motzarella.org!news.motzarella.org!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 27 Original-X-Trace: news.motzarella.org U2FsdGVkX18jJoF8LO1Lr56piO0bYk65DAT5u8WB1pEcN7GwZ8ccnra11lyIeRnoegQRp5odpNiItozdzw/odPcenBw/bU0BcYvBN257hEWW68t/LJ+AsS+9ONK+sK1WalWCQ9VmZdg= Original-X-Complaints-To: Please send complaints to abuse@motzarella.org with full headers Original-NNTP-Posting-Date: Sun, 16 Nov 2008 15:47:07 +0000 (UTC) X-Auth-Sender: U2FsdGVkX1+q9Wo1T/UfEalQwpZ5trkI Cancel-Lock: sha1:iA67Z4y96Tp7xHRjdOEj/aE9e5I= sha1:ZSsb2Bmcik2kE4Ji1gpMqRJmPRU= User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux) Original-Xref: news.stanford.edu gnu.emacs.help:164500 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:59834 Archived-At: Niels Felsted Thorsen writes: > Hi > > I have a function like this: > > (defun testfun (file) > (interactive "fFile: ") > (message file)) > > But it will ask for the file based on, as I understand it, the value > of "default-directory" which is buffer-local. > > Is there a way to specify default-directory just for this function? So > it will always start with fx: > > File: ~/foo/bar/ > > when asking for the file. > Define your function as follows: (defun testfun (file) (interactive (list (read-file-name "File: " "~/foo/bar/"))) (message file))