unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Luc Teirlinck <teirllm@dms.auburn.edu>
Subject: Custom and defvaralias.
Date: Thu, 10 Feb 2005 21:14:57 -0600 (CST)	[thread overview]
Message-ID: <200502110314.j1B3EvU08371@raven.dms.auburn.edu> (raw)

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	other threads:[~2005-02-11  3:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-02-11  3:14 Luc Teirlinck [this message]
2005-02-12  8:38 ` Custom and defvaralias Richard Stallman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200502110314.j1B3EvU08371@raven.dms.auburn.edu \
    --to=teirllm@dms.auburn.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).