From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Luc Teirlinck Newsgroups: gmane.emacs.devel Subject: Re: Documentation not clear for the Lisp function set-variable Date: Mon, 4 Jul 2005 20:42:43 -0500 (CDT) Message-ID: <200507050142.j651ghI15860@raven.dms.auburn.edu> References: <87slz6nr3h.fsf@jurta.org> <200506271609.j5RG9i020638@raven.dms.auburn.edu> <200506271845.j5RIj3W22159@raven.dms.auburn.edu> <200507040118.j641ImO12290@raven.dms.auburn.edu> NNTP-Posting-Host: main.gmane.org X-Trace: sea.gmane.org 1120528637 12302 80.91.229.2 (5 Jul 2005 01:57:17 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 5 Jul 2005 01:57:17 +0000 (UTC) Cc: lekktu@gmail.com, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jul 05 03:57:17 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DpcgV-0007hu-D2 for ged-emacs-devel@m.gmane.org; Tue, 05 Jul 2005 03:57:15 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DpceX-0000pT-09 for ged-emacs-devel@m.gmane.org; Mon, 04 Jul 2005 21:55:13 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Dpce8-0000k0-90 for emacs-devel@gnu.org; Mon, 04 Jul 2005 21:54:48 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Dpcdx-0000d6-DQ for emacs-devel@gnu.org; Mon, 04 Jul 2005 21:54:39 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Dpcdu-0000aY-Nw for emacs-devel@gnu.org; Mon, 04 Jul 2005 21:54:34 -0400 Original-Received: from [131.204.53.104] (helo=manatee.dms.auburn.edu) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DpcaN-0008DF-Gs; Mon, 04 Jul 2005 21:50:55 -0400 Original-Received: from raven.dms.auburn.edu (raven.dms.auburn.edu [131.204.53.29]) by manatee.dms.auburn.edu (8.12.10/8.12.10) with ESMTP id j651ijCK000406; Mon, 4 Jul 2005 20:44:45 -0500 (CDT) Original-Received: (from teirllm@localhost) by raven.dms.auburn.edu (8.11.7p1+Sun/8.11.7) id j651ghI15860; Mon, 4 Jul 2005 20:42:43 -0500 (CDT) X-Authentication-Warning: raven.dms.auburn.edu: teirllm set sender to teirllm@dms.auburn.edu using -f Original-To: rms@gnu.org In-reply-to: (rms@gnu.org) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:40380 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:40380 Richard Stallman wrote: Actually, I forgot that, unlike customize-face, customize-variable does not allow to enter variables that are defvarred or defvaraliased, rather than defcustomed. I think that is partly a bug--it should allow an alias if its "real" name has a defcustom. If it is a bug, then the following patches fix it. I can install if desired: ===File ~/custom-diff======================================= diff -c /home/teirllm/emacscvsdir/emacs/lisp/custom.el.\~1.85.\~ /home/teirllm/emacscvsdir/emacs/lisp/custom.el *** /home/teirllm/emacscvsdir/emacs/lisp/custom.el.~1.85.~ Sun Jul 3 13:38:33 2005 --- /home/teirllm/emacscvsdir/emacs/lisp/custom.el Mon Jul 4 19:45:29 2005 *************** *** 518,524 **** ;; This test is also in the C code of `user-variable-p'. (defun custom-variable-p (variable) ! "Return non-nil if VARIABLE is a custom variable." (or (get variable 'standard-value) (get variable 'custom-autoload))) --- 518,526 ---- ;; This test is also in the C code of `user-variable-p'. (defun custom-variable-p (variable) ! "Return non-nil if VARIABLE is a custom variable. ! This recursively follows aliases." ! (setq variable (indirect-variable variable)) (or (get variable 'standard-value) (get variable 'custom-autoload))) Diff finished. Mon Jul 4 20:23:04 2005 ============================================================ ===File ~/cus-edit-diff===================================== diff -c /home/teirllm/emacscvsdir/emacs/lisp/cus-edit.el.\~1.225.\~ /home/teirllm/emacscvsdir/emacs/lisp/cus-edit.el *** /home/teirllm/emacscvsdir/emacs/lisp/cus-edit.el.~1.225.~ Sun Jul 3 19:57:02 2005 --- /home/teirllm/emacscvsdir/emacs/lisp/cus-edit.el Mon Jul 4 19:45:23 2005 *************** *** 488,495 **** (defun custom-variable-prompt () "Prompt for a custom variable, defaulting to the variable at point. Return a list suitable for use in `interactive'." ! (let ((v (variable-at-point)) (enable-recursive-minibuffers t) val) (setq val (completing-read --- 488,497 ---- (defun custom-variable-prompt () "Prompt for a custom variable, defaulting to the variable at point. + If that variable is an alias, the default is the actual custom variable + at the end of the chain of aliases. Return a list suitable for use in `interactive'." ! (let ((v (indirect-variable (variable-at-point))) (enable-recursive-minibuffers t) val) (setq val (completing-read *************** *** 1021,1026 **** --- 1023,1029 ---- (defun customize-option (symbol) "Customize SYMBOL, which must be a user option variable." (interactive (custom-variable-prompt)) + (setq symbol (indirect-variable symbol)) (custom-buffer-create (list (list symbol 'custom-variable)) (format "*Customize Option: %s*" (custom-unlispify-tag-name symbol)))) *************** *** 1033,1038 **** --- 1036,1042 ---- "Customize SYMBOL, which must be a user option variable. Show the buffer in another window, but don't select it." (interactive (custom-variable-prompt)) + (setq symbol (indirect-variable symbol)) (custom-buffer-create-other-window (list (list symbol 'custom-variable)) (format "*Customize Option: %s*" (custom-unlispify-tag-name symbol)))) Diff finished. Mon Jul 4 20:24:04 2005 ============================================================