all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stuart <stuart.tett@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: using variable names as args to interactive functions
Date: Fri, 11 Jan 2008 16:53:58 -0800 (PST)	[thread overview]
Message-ID: <96f5c9ae-3f50-4f54-9537-92a27cd618e8@f47g2000hsd.googlegroups.com> (raw)

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

             reply	other threads:[~2008-01-12  0:53 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-12  0:53 Stuart [this message]
2008-01-12  2:09 ` using variable names as args to interactive functions Pascal Bourguignon
2008-01-12  3:28 ` Daniel Pittman
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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=96f5c9ae-3f50-4f54-9537-92a27cd618e8@f47g2000hsd.googlegroups.com \
    --to=stuart.tett@gmail.com \
    --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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.