emacs-devel
[Top][All Lists]
Advanced

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

Custom and defvaralias.


From: Luc Teirlinck
Subject: Custom and defvaralias.
Date: Thu, 10 Feb 2005 21:14:57 -0600 (CST)

Custom currently does not recognize variable aliases.  We are planning
on replacing the user option `blink-cursor' with `blink-cursor-mode'
to get rid of a bug, get rid of no longer needed duplication and be
more standard.  We plan to keep `blink-cursor' as an alias.  So people
who have `(setq blink-cursor nil)' in their .emacs will be safe.  But,
without the patch below, people who set blink-cursor to nil in their
custom-set-variables form risk being tortured by a blinking cursor.

The small patch below makes Custom take aliases into account.  It
assumes, for correctness, that if foo is defcustomed, it can occur as
second, but not as first argument to defvaralias.  Defcustoming a
variable just to make it an alias for another variable would not make
any sense.

Note that the patch below _only_ ensures that the option gets recognized
_in the `custom-set-variables' form_.  If you do:

M-x customize-option RET blink-cursor RET

you will see (_not_ now, after a change is installed):

blink-cursor-

After saving your next option (any option), the blink-cursor in the
custom-set-variables form will automatically get corrected to
blink-cursor-mode.  (Again, _not_ now.  After all relevant changes
have been installed.)

I can install if desired.

===File ~/custom.el-diff====================================
*** custom.el   10 Feb 2005 09:52:54 -0600      1.79
--- custom.el   10 Feb 2005 20:04:47 -0600      
***************
*** 777,783 ****
      (while args
        (let ((entry (car args)))
        (if (listp entry)
!           (let* ((symbol (nth 0 entry))
                   (value (nth 1 entry))
                   (now (nth 2 entry))
                   (requests (nth 3 entry))
--- 777,783 ----
      (while args
        (let ((entry (car args)))
        (if (listp entry)
!           (let* ((symbol (indirect-variable (nth 0 entry)))
                   (value (nth 1 entry))
                   (now (nth 2 entry))
                   (requests (nth 3 entry))
***************
*** 809,815 ****
          (message "Warning: old format `custom-set-variables'")
          (ding)
          (sit-for 2)
!         (let ((symbol (nth 0 args))
                (value (nth 1 args)))
            (put symbol 'saved-value (list value))
              (custom-push-theme 'theme-value symbol theme 'set value))
--- 809,815 ----
          (message "Warning: old format `custom-set-variables'")
          (ding)
          (sit-for 2)
!         (let ((symbol (indirect-variable (nth 0 args)))
                (value (nth 1 args)))
            (put symbol 'saved-value (list value))
              (custom-push-theme 'theme-value symbol theme 'set value))
============================================================




reply via email to

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