emacs-devel
[Top][All Lists]
Advanced

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

Re: Documentation not clear for the Lisp function set-variable


From: Luc Teirlinck
Subject: Re: Documentation not clear for the Lisp function set-variable
Date: Mon, 4 Jul 2005 20:42:43 -0500 (CDT)

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
============================================================




reply via email to

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