unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Daniel Pittman <daniel@rimspace.net>
To: help-gnu-emacs@gnu.org
Subject: Re: using variable names as args to interactive functions
Date: Sat, 12 Jan 2008 14:28:23 +1100	[thread overview]
Message-ID: <8763xzn2nc.fsf@rimspace.net> (raw)
In-Reply-To: 96f5c9ae-3f50-4f54-9537-92a27cd618e8@f47g2000hsd.googlegroups.com

Stuart <stuart.tett@gmail.com> 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 <daniel@cybersource.com.au>           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

  parent reply	other threads:[~2008-01-12  3:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-12  0:53 using variable names as args to interactive functions Stuart
2008-01-12  2:09 ` Pascal Bourguignon
2008-01-12  3:28 ` Daniel Pittman [this message]
2008-01-13  8:40 ` Mathias Dahl
2008-01-15  3:17 ` Kevin Rodgers
2008-01-16  1:42 ` Stuart
2008-01-16  3:01   ` Kevin Rodgers

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=8763xzn2nc.fsf@rimspace.net \
    --to=daniel@rimspace.net \
    --cc=help-gnu-emacs@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.
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).