help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: using variable names as args to interactive functions


From: Daniel Pittman
Subject: Re: using variable names as args to interactive functions
Date: Sat, 12 Jan 2008 14:28:23 +1100
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/23.0.60 (gnu/linux)

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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]