all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* standard-value of display-battery/time-mode
@ 2006-02-18 13:15 David Reitter
  2006-02-19  0:31 ` Luc Teirlinck
  0 siblings, 1 reply; 8+ messages in thread
From: David Reitter @ 2006-02-18 13:15 UTC (permalink / raw)


(customize-mark-to-save 'display-battery-mode)

is always t even though now change was made because the standard- 
value property is nil / not set. It should probably be (nil). One  
consequence of this is that menu-bar-save-options always saves the  
customizations, even though they haven't changed.

It works fine for, e.g., `show-paren-mode'.

This problem occurs both with `display-battery-mode' and `display- 
time-mode'.





--
http://aquamacs.org -- Aquamacs: Emacs on Mac OS X
http://aquamacs.org/donate -- Could we help you? Return the favor and  
support the Aquamacs Project!

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: standard-value of display-battery/time-mode
  2006-02-18 13:15 standard-value of display-battery/time-mode David Reitter
@ 2006-02-19  0:31 ` Luc Teirlinck
  2006-02-19 18:37   ` David Reitter
  2006-02-19 22:47   ` Richard M. Stallman
  0 siblings, 2 replies; 8+ messages in thread
From: Luc Teirlinck @ 2006-02-19  0:31 UTC (permalink / raw)
  Cc: emacs-devel

David Reitter wrote:

   (customize-mark-to-save 'display-battery-mode)

   is always t even though now change was made because the standard- 
   value property is nil / not set. It should probably be (nil).

`display-battery-mode' is autoloaded.  This means that it is defined
with `defvar' in loaddefs.el.  The standard-value property remains nil
until the defcustom is evaluated, when it becomes (nil).

   It works fine for, e.g., `show-paren-mode'.

Then your .emacs must load paren.

`emacs -q', then:

ELISP> (get 'show-paren-mode 'standard-value)
nil
ELISP> (load "paren")
t
ELISP> (get 'show-paren-mode 'standard-value)
(nil)

ELISP> 

Sincerely,

Luc.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: standard-value of display-battery/time-mode
  2006-02-19  0:31 ` Luc Teirlinck
@ 2006-02-19 18:37   ` David Reitter
  2006-02-19 22:47   ` Richard M. Stallman
  1 sibling, 0 replies; 8+ messages in thread
From: David Reitter @ 2006-02-19 18:37 UTC (permalink / raw)


On 19 Feb 2006, at 00:31, Luc Teirlinck wrote:

>    (customize-mark-to-save 'display-battery-mode)
>
>    is always t even though now change was made because the standard-
>    value property is nil / not set. It should probably be (nil).
>
> `display-battery-mode' is autoloaded.  This means that it is defined
> with `defvar' in loaddefs.el.  The standard-value property remains nil
> until the defcustom is evaluated, when it becomes (nil).

OK, so something like menu-bar-options-save should contain a few  
require's then.
I've written something that'll automatically save the options at the  
end of an Emacs session.The user is asked whether to actually do that  
if they have changed. Obviously, I don't want to ask if there is no  
change, which means I'll need to load the appropriate libraries at  
that point.

Maybe that's something that menu-bar-options-save should do as well,  
because as it stands now, the customizations are always written to  
file, whether there have been changes or not (unless all those  
libraries have been loaded).

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: standard-value of display-battery/time-mode
  2006-02-19  0:31 ` Luc Teirlinck
  2006-02-19 18:37   ` David Reitter
@ 2006-02-19 22:47   ` Richard M. Stallman
  2006-02-20  0:50     ` Luc Teirlinck
  1 sibling, 1 reply; 8+ messages in thread
From: Richard M. Stallman @ 2006-02-19 22:47 UTC (permalink / raw)
  Cc: david.reitter, emacs-devel

    `display-battery-mode' is autoloaded.  This means that it is defined
    with `defvar' in loaddefs.el.  The standard-value property remains nil
    until the defcustom is evaluated, when it becomes (nil).

Does this mean there is no bug?

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: standard-value of display-battery/time-mode
  2006-02-19 22:47   ` Richard M. Stallman
@ 2006-02-20  0:50     ` Luc Teirlinck
  2006-02-20  1:20       ` Chong Yidong
  0 siblings, 1 reply; 8+ messages in thread
From: Luc Teirlinck @ 2006-02-20  0:50 UTC (permalink / raw)
  Cc: david.reitter, Chong Yidong, emacs-devel

Richard Stallman wrote:

       `display-battery-mode' is autoloaded.  This means that it is defined
       with `defvar' in loaddefs.el.  The standard-value property remains nil
       until the defcustom is evaluated, when it becomes (nil).

   Does this mean there is no bug?

No, it means that the files necessary to evaluate the defcustoms
should be loaded.  This morning, Chong Yidong added:

   (custom-load-symbol symbol)

to the `customize-mark-to-save' code (Rev 1.120 to custom.el), which
should have done that, but then he took it back out in the next
revision.  I do not know what the problem was that necessitated this
revert.

Sincerely,

Luc.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: standard-value of display-battery/time-mode
  2006-02-20  0:50     ` Luc Teirlinck
@ 2006-02-20  1:20       ` Chong Yidong
  2006-02-20  3:07         ` Luc Teirlinck
  0 siblings, 1 reply; 8+ messages in thread
From: Chong Yidong @ 2006-02-20  1:20 UTC (permalink / raw)
  Cc: david.reitter, rms, emacs-devel

Luc Teirlinck <teirllm@dms.auburn.edu> writes:

> No, it means that the files necessary to evaluate the defcustoms
> should be loaded.  This morning, Chong Yidong added:
>
>    (custom-load-symbol symbol)
>
> to the `customize-mark-to-save' code (Rev 1.120 to custom.el), which
> should have done that, but then he took it back out in the next
> revision.  I do not know what the problem was that necessitated this
> revert.

custom-load-symbol does not work for all variables concerned.  At
first, I thought all the relevant variables have 'custom-load property
(which tells custom-load-symbol what to load), but I was wrong.  I
don't know what the criteria is that variables are given
'custom-load---is it only if the variable name matches the custom
group name?

So I am trying to think of a better solution.

Maybe we should explicitly load those defcustoms that appear in the
menu-bar, in menu-bar.el.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: standard-value of display-battery/time-mode
  2006-02-20  1:20       ` Chong Yidong
@ 2006-02-20  3:07         ` Luc Teirlinck
  2006-02-20 16:01           ` Chong Yidong
  0 siblings, 1 reply; 8+ messages in thread
From: Luc Teirlinck @ 2006-02-20  3:07 UTC (permalink / raw)
  Cc: david.reitter, rms, emacs-devel

Chong Yidong wrote:

   custom-load-symbol does not work for all variables concerned.  At
   first, I thought all the relevant variables have 'custom-load property
   (which tells custom-load-symbol what to load), but I was wrong.  I
   don't know what the criteria is that variables are given
   'custom-load---is it only if the variable name matches the custom
   group name?

You did not give any examples.  Are these options that are neither
autoloaded nor preloaded?  A magic autoload cookie should, I believe,
write a line of the form:

(custom-autoload (quote show-paren-mode) "paren")

in loaddefs.el.  So I believe that it should suffice to add that
custom-load-symbol call back and put in ###autoload's for all options
for which it fails to work.

Sincerely,

Luc.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: standard-value of display-battery/time-mode
  2006-02-20  3:07         ` Luc Teirlinck
@ 2006-02-20 16:01           ` Chong Yidong
  0 siblings, 0 replies; 8+ messages in thread
From: Chong Yidong @ 2006-02-20 16:01 UTC (permalink / raw)
  Cc: david.reitter, rms, emacs-devel

Luc Teirlinck <teirllm@dms.auburn.edu> writes:

> Chong Yidong wrote:
>
>    custom-load-symbol does not work for all variables concerned.  At
>    first, I thought all the relevant variables have 'custom-load property
>    (which tells custom-load-symbol what to load), but I was wrong.  I
>    don't know what the criteria is that variables are given
>    'custom-load---is it only if the variable name matches the custom
>    group name?
>
> You did not give any examples.  Are these options that are neither
> autoloaded nor preloaded?  A magic autoload cookie should, I believe,
> write a line of the form:
>
> (custom-autoload (quote show-paren-mode) "paren")
>
> in loaddefs.el.  So I believe that it should suffice to add that
> custom-load-symbol call back and put in ###autoload's for all options
> for which it fails to work.

I guess there isn't a problem after all, so I checked in the change.
Thanks.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2006-02-20 16:01 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-02-18 13:15 standard-value of display-battery/time-mode David Reitter
2006-02-19  0:31 ` Luc Teirlinck
2006-02-19 18:37   ` David Reitter
2006-02-19 22:47   ` Richard M. Stallman
2006-02-20  0:50     ` Luc Teirlinck
2006-02-20  1:20       ` Chong Yidong
2006-02-20  3:07         ` Luc Teirlinck
2006-02-20 16:01           ` Chong Yidong

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.