all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Glenn Morris <rgm@gnu.org>
To: 4706@emacsbugs.donarmstrong.com
Subject: bug#4706: customize and aliaes [was Re: bug#4706: 23.1.50; RMAIL mode fails to read mail first time]
Date: Mon, 12 Oct 2009 15:37:07 -0400	[thread overview]
Message-ID: <qfr5t82yl8.fsf@fencepost.gnu.org> (raw)
In-Reply-To: yz63aka7ym.fsf@fencepost.gnu.org

retitle 4706 customize and aliases
stop

I could have sworn this was supposed to work, eg:

http://lists.gnu.org/archive/html/emacs-devel/2005-02/msg00543.html
http://lists.gnu.org/archive/html/emacs-devel/2008-04/msg00716.html

Now I can't see that it ever has done. Consider:

foo.el:
(define-obsolete-variable-alias 'oldname 'newname "23.1")
(defcustom newname nil "" :type 'boolean :group 'customize)

~/.emacs:
(custom-set-variables
  '(oldname t))

(It works if you use setq rather than custom in your .emacs.)

Loading .emacs gives 'oldname a 'saved-value property. If foo.el has
not been loaded at this time, there is no way custom can know it
should really be applying this property to 'newname. Later on when
foo.el is loaded, custom-initialize-default checks if 'newname has a
'saved-value property, finds it does not, and so uses the default
value of nil rather than the desired value of t.

It will work if you load foo.el before .emacs, so one solution is to
autoload all defvaraliases that point to defcustoms. However, this is
not a solution for packages not distributed with emacs.

Another solution would be to make defvaralias copy any properties.
At present:

(put 'oldname 'foobar t)
(defvaralias 'oldname 'newname)
(get 'newname 'foobar)    ; -> nil

But changing this doesn't seem right in general, and might break some
existing behaviour.

If custom-initialize-default could somehow check if 'symbol has any
aliases, and if any of these have a 'saved-value property, that would
seem like the right thing to do. But I can't see how to do this. Is
there a "reverse indirect-variable" that lists all aliases of a given
variable?

rmail used to have a slightly complicated workaround for this. I
mistakenly thought it was not needed. Rather than put it back, I'd
prefer to just autoload the alias statements. There are other places
besides rmail that define aliases pointing to defcustoms, so some kind
of general solution is needed.


Any suggestions? 





  reply	other threads:[~2009-10-12 19:37 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-12 11:28 bug#4706: 23.1.50; RMAIL mode fails to read mail first time jpff
2009-10-12 16:32 ` Glenn Morris
2009-10-12 19:37   ` Glenn Morris [this message]
2009-10-12 19:45     ` Processed: customize and aliaes [was Re: bug#4706: 23.1.50; RMAIL mode fails to read mail first time] Emacs bug Tracking System
2009-10-12 22:53     ` bug#4706: customize and aliaes Glenn Morris
2009-10-13 20:04       ` Stefan Monnier
2009-10-15  6:14         ` Glenn Morris
2009-10-15 15:26           ` Stefan Monnier
2009-10-16  1:16             ` Glenn Morris
2009-10-16  2:05               ` Stefan Monnier
2009-10-16  6:48                 ` Glenn Morris
2009-10-16  6:55                   ` Processed: " Emacs bug Tracking System
2009-10-20 12:16   ` bug#4706: 23.1.50; RMAIL mode fails to read mail first time jpff
2009-10-20 18:33     ` Glenn Morris

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

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

  git send-email \
    --in-reply-to=qfr5t82yl8.fsf@fencepost.gnu.org \
    --to=rgm@gnu.org \
    --cc=4706@emacsbugs.donarmstrong.com \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.