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

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

RE: interactive interface to supply variables


From: Drew Adams
Subject: RE: interactive interface to supply variables
Date: Sat, 14 Dec 2013 15:39:05 -0800 (PST)

> (interactive "v Variable: ")

"vVariable: " is more conventional, FWIW.

> How does `describe-variable' do that?

What does `describe-variable' say about how it does it?  Ask it.
Take a look.  Why ask someone here to say how `describe-variable'
does it?  What fun is that?

`interactive' with a string arg is very simple.  It serves only
as an abbreviation for common use cases - nothing more.

But `interactive' with a non-string arg does whatever you want.
It is easy to make it prompt for and provide completion for all
symbols that are `boundp', i.e., all variables (in the current
obarray).  I'm guessing that's a challenge you might enjoy, once
undertaken.  `C-h f interactive' and `C-h f completing-read'.

Emacs itself is the first helper to ask about such things - for
one's own greatest benefit.  Google is a reasonable second.

This list or StackOverflow is really best fit for questions you
still have after you have already tried something on your own.

Nothing wrong with asking here first, of course.  But for most
people there are better ways to learn to fish, and it is more
interesting to discover most of Emacs by interacting with Emacs
itself.

This example is a good opportunity to ask Emacs - a relatively
easy challenge that rewards quickly.



reply via email to

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