[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
using variable names as args to interactive functions
From: |
Stuart |
Subject: |
using variable names as args to interactive functions |
Date: |
Fri, 11 Jan 2008 16:53:58 -0800 (PST) |
User-agent: |
G2/1.0 |
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.
However, this doesn't work because the interactive option "v" doesn't
include the variables set with setq because this requires that: "A
variable declared to be a user option (i.e., satisfying the predicate
user-variable-p)."
Any ideas? Thanks.
(defun find-my-special-dir (dir)
(interactive "vSpecial dir: ")
(find-file dir))
Example
--------------
startup:
(setq my-special-dir-a "/path/to/my/special/dir")
minibuffer:
Special dir: my-special-dir-a
- using variable names as args to interactive functions,
Stuart <=
- Re: using variable names as args to interactive functions, Pascal Bourguignon, 2008/01/11
- Re: using variable names as args to interactive functions, Daniel Pittman, 2008/01/11
- Re: using variable names as args to interactive functions, Mathias Dahl, 2008/01/13
- Re: using variable names as args to interactive functions, Kevin Rodgers, 2008/01/14
- Re: using variable names as args to interactive functions, Stuart, 2008/01/15