From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Barry Margolin Newsgroups: gmane.emacs.help Subject: Re: interactive interface to supply variables Date: Sat, 14 Dec 2013 16:01:10 -0500 Organization: A noiseless patient Spider Message-ID: References: <87vbyr45bj.fsf@nl106-137-194.student.uu.se> NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1387055115 13500 80.91.229.3 (14 Dec 2013 21:05:15 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 14 Dec 2013 21:05:15 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Dec 14 22:05:19 2013 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VrwOl-0003Z9-1d for geh-help-gnu-emacs@m.gmane.org; Sat, 14 Dec 2013 22:05:19 +0100 Original-Received: from localhost ([::1]:48598 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VrwOk-0008Jt-LQ for geh-help-gnu-emacs@m.gmane.org; Sat, 14 Dec 2013 16:05:18 -0500 Original-Path: usenet.stanford.edu!news.kjsl.com!feeder.erje.net!eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!barmar.motzarella.org!.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 43 Injection-Info: barmar.motzarella.org; posting-host="2be9e9f5dd9af768b8861af71b85fc28"; logging-data="5876"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1++RuF/Q3oapAW6M2Je4847" User-Agent: MT-NewsWatcher/3.5.3b3 (Intel Mac OS X) Cancel-Lock: sha1:PhjdjdsaVA7VEFNaMNr5wAGms+s= Original-Xref: usenet.stanford.edu gnu.emacs.help:202715 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:94984 Archived-At: In article <87vbyr45bj.fsf@nl106-137-194.student.uu.se>, Emanuel Berg wrote: > (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.) I'm still using Emacs 22.x. In this version, the "v" specification reads any variable for which user-variable-p is true: (1) the first character of its documentation is `*', or (2) it is customizable (its property list contains a non-nil value of `standard-value' or `custom-autoload'), or (3) it is an alias for another user variable. Have they removed clause (1) in your version? If not, give your variable a doc string beginning with "*". describe-variable uses a custom interactive specification. It accepts any symbol that has a binding or has a documentation string. If you want this more liberal prompt, you'll probably have to copy the code. -- Barry Margolin, barmar@alum.mit.edu Arlington, MA *** PLEASE post questions in newsgroups, not directly to me ***