From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Daniel Pittman Newsgroups: gmane.emacs.help Subject: Re: using variable names as args to interactive functions Date: Sat, 12 Jan 2008 14:28:23 +1100 Organization: Cybersource: Australia's Leading Linux and Open Source Solutions Company Message-ID: <8763xzn2nc.fsf@rimspace.net> References: <96f5c9ae-3f50-4f54-9537-92a27cd618e8@f47g2000hsd.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1200108894 10330 80.91.229.12 (12 Jan 2008 03:34:54 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 12 Jan 2008 03:34:54 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Jan 12 04:35:16 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 1JDX9O-0007oe-HD for geh-help-gnu-emacs@m.gmane.org; Sat, 12 Jan 2008 04:35:14 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JDX90-0004JY-MC for geh-help-gnu-emacs@m.gmane.org; Fri, 11 Jan 2008 22:34:50 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JDX8g-0004G5-A0 for help-gnu-emacs@gnu.org; Fri, 11 Jan 2008 22:34:30 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JDX8f-0004EG-AE for help-gnu-emacs@gnu.org; Fri, 11 Jan 2008 22:34:29 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JDX8f-0004E6-5W for help-gnu-emacs@gnu.org; Fri, 11 Jan 2008 22:34:29 -0500 Original-Received: from main.gmane.org ([80.91.229.2] helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JDX8f-0005Hr-7G for help-gnu-emacs@gnu.org; Fri, 11 Jan 2008 22:34:29 -0500 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1JDX8a-0000MY-DE for help-gnu-emacs@gnu.org; Sat, 12 Jan 2008 03:34:24 +0000 Original-Received: from ppp59-167-189-244.static.internode.on.net ([59.167.189.244]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 12 Jan 2008 03:34:24 +0000 Original-Received: from daniel by ppp59-167-189-244.static.internode.on.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 12 Jan 2008 03:34:24 +0000 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 27 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: ppp59-167-189-244.static.internode.on.net User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/23.0.60 (gnu/linux) Cancel-Lock: sha1:YBl8Qu4mF7UOWZ1hmpBdI02T0ug= X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) 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:50675 Archived-At: Stuart writes: > I have some variables which I set at startup with setq. There are a > bunch of variables that get set. Each is a string representing a > directory path. I want a function which I can just type the variable > name and it opens dired with that directory. You might find it easier to define your paths in the environment, either before starting Emacs or using `setenv'. You can then use `find-file' with the environment variable to open dired, such as: M-: (setenv "MYDIR" "/home/daniel/example") ret C-x C-f $MYDIR ret That should open up /home/daniel/example in dired for you. This substitution works as expected everywhere, too, so you can open $MYDIR/foobar and have it open a file under that directory... Regards, Daniel -- Daniel Pittman Phone: 03 9428 6922 1/130-132 Stawell St, Richmond Web: http://www.cyber.com.au Cybersource: Australia's Leading Linux and Open Source Solutions Company