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

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

interactive interface to supply variables


From: Emanuel Berg
Subject: interactive interface to supply variables
Date: Sat, 14 Dec 2013 20:09:43 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

(defvar test-var 1)
(symbol-value 'test-var)      ; 1
(symbol-name 'test-var)       ; "test-var" (both correct)

But:

(custom-variable-p 'test-var) ; nil

This messes up this defun:

(defun describe-variable-short (var)
  (interactive "v Variable: ")
  (message (format " %s: %s" (symbol-name var) (symbol-value var))) )

Because if `custom-variable-p' is nil, (interactive "v
... reports [No match].

How does `describe-variable' do that? (Perhaps I should
just copy their interface, because they also suggest
the variable at point as default. But that's step two.)

-- 
Emanuel Berg, programmer-for-rent. CV, projects, etc at uXu
underground experts united:  http://user.it.uu.se/~embe8573


reply via email to

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