From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jambunathan K Newsgroups: gmane.emacs.help Subject: Re: interactive interface to supply variables Date: Sun, 15 Dec 2013 02:39:23 +0530 Message-ID: <87bo0jw35o.fsf@gmail.com> References: <87vbyr45bj.fsf@nl106-137-194.student.uu.se> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1387055538 17738 80.91.229.3 (14 Dec 2013 21:12:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 14 Dec 2013 21:12:18 +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:12:24 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 1VrwVc-0006HK-1H for geh-help-gnu-emacs@m.gmane.org; Sat, 14 Dec 2013 22:12:24 +0100 Original-Received: from localhost ([::1]:48615 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VrwVb-0002GA-DG for geh-help-gnu-emacs@m.gmane.org; Sat, 14 Dec 2013 16:12:23 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35274) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VrwVI-0002B4-Nz for help-gnu-emacs@gnu.org; Sat, 14 Dec 2013 16:12:10 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VrwVD-0006Nb-9a for help-gnu-emacs@gnu.org; Sat, 14 Dec 2013 16:12:04 -0500 Original-Received: from mail-pd0-x236.google.com ([2607:f8b0:400e:c02::236]:50243) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VrwVD-0006NP-1w for help-gnu-emacs@gnu.org; Sat, 14 Dec 2013 16:11:59 -0500 Original-Received: by mail-pd0-f182.google.com with SMTP id v10so3854435pde.27 for ; Sat, 14 Dec 2013 13:11:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:references:date:in-reply-to:message-id:user-agent :mime-version:content-type; bh=2n2s8uwxAZCiLE+8Ie9L5ltbf+f7XrCoMTmQkS8kGXE=; b=VtcAr5VSXLdDEU+r0Y+hDso8qDtdBCOFVnc2yOcMplkxwhvbHCJfGcrhm90Q5tyosa jff1+MdpoV413bR9UXsQPSB1klQ5YV6Gu3UrtnSBUNSVHnmhTWx7zPHjIzzPabhILji0 4Xr+f9rny3P8G5uGa/G/mIxKJBHch6TQRjUNbVmNHmgi6dPQ7zcUS8zZZF3I9GdJY/pm PzmnlLO19+FqiIO1d4rh3o1eYN/sm12CaFrDsaRcVq8LnJcr3hdSYkLa2jYhje+2KSWK BDItclpKtoxaE+WNLOBMt3yDuxjsLIxUuLJFd1AXp2Bt2wnZTC+LIukhyQVvjg1OFdQZ LS1w== X-Received: by 10.67.21.130 with SMTP id hk2mr11143357pad.76.1387055518169; Sat, 14 Dec 2013 13:11:58 -0800 (PST) Original-Received: from debian-6.05 ([115.242.214.195]) by mx.google.com with ESMTPSA id ql10sm14562247pbc.44.2013.12.14.13.11.55 for (version=TLSv1.1 cipher=RC4-SHA bits=128/128); Sat, 14 Dec 2013 13:11:57 -0800 (PST) In-Reply-To: <87vbyr45bj.fsf@nl106-137-194.student.uu.se> (Emanuel Berg's message of "Sat, 14 Dec 2013 20:09:43 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:400e:c02::236 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:94985 Archived-At: Declare the variable with defcustom instead of defvar. You can `put' and `get' stuff on a symbol. As an experiment, Try C-x n n or any of the narrowing command and see what happens to your .emacs. You can also use the "x" interactive spec and check the expression that is input with symbolp. Emanuel Berg writes: > (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.)