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: Juanma Barranquero
Subject: Re: Documentation not clear for the Lisp function set-variable
Date: Wed, 29 Jun 2005 04:32:39 +0200

On 6/28/05, Richard M. Stallman <address@hidden> wrote:

> I don't like that idea.  The command should accept *all* names,
> whether obsolete or not.  But it would be nice to inform the user in
> the echo area that the name is obsolete, and give the new name if any.

With the installed changes for `user-variable-p' and the attached
patch, `set-variable' now:

 - allows setting aliases of user options
 - does *not* filter out obsolete variables
 - shows a 3-seconds warning when the variable (alias or not) being
set is obsolete;
   the warning includes the CURRENT-NAME information from
`make-variable-obsolete'
 - does not show a warning for aliases (I don't think it's necessary
to single out aliases
   if they aren't obsolete, and when they are, they already produce a warning)

-- 
                    /L/e/k/t/u



Index: lisp/simple.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/simple.el,v
retrieving revision 1.734
diff -c -2 -b -r1.734 simple.el
*** lisp/simple.el      24 Jun 2005 21:11:58 -0000      1.734
--- lisp/simple.el      29 Jun 2005 00:50:03 -0000
***************
*** 4539,4550 ****
          (minibuffer-help-form '(describe-variable var))
          (prop (get var 'variable-interactive))
!         (prompt (format "Set %s%s to value: " var
                          (cond ((local-variable-p var)
!                                " (buffer-local)")
                                ((or current-prefix-arg
                                     (local-variable-if-set-p var))
!                                " buffer-locally")
!                               (t " globally"))))
!         (val (if prop
                   ;; Use VAR's `variable-interactive' property
                   ;; as an interactive spec for prompting.
--- 4539,4557 ----
          (minibuffer-help-form '(describe-variable var))
          (prop (get var 'variable-interactive))
!           (obsolete (car (get var 'byte-obsolete-variable)))
!         (prompt (format "Set %s %s to value: " var
                          (cond ((local-variable-p var)
!                                "(buffer-local)")
                                ((or current-prefix-arg
                                     (local-variable-if-set-p var))
!                                "buffer-locally")
!                               (t "globally"))))
!         (val (progn
!                  (when obsolete
!                    (message (concat "`%S' is obsolete; "
!                                     (if (symbolp obsolete) "use `%S'
instead" "%s"))
!                             var obsolete)
!                    (sit-for 3))
!                  (if prop
                       ;; Use VAR's `variable-interactive' property
                       ;; as an interactive spec for prompting.
***************
*** 4554,4558 ****
                 (read
                  (read-string prompt nil
!                              'set-variable-value-history)))))
       (list var val current-prefix-arg)))
  
--- 4561,4565 ----
                     (read
                      (read-string prompt nil
!                                  'set-variable-value-history))))))
       (list var val current-prefix-arg)))




reply via email to

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