unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* setting default value
@ 2005-05-11  7:44 David Reitter
  0 siblings, 0 replies; 3+ messages in thread
From: David Reitter @ 2005-05-11  7:44 UTC (permalink / raw)


In a site init file, I'm trying to set different default values for 
stuff like 'blink-cursor-mode'.

(setq-default blink-cursor-mode t)
(blink-cursor-mode blink-cursor-mode)

However, if I then select a different setting (i.e. blink-cursor mode 
nil) and save the customizations (Options/Save Options), this setting 
is not saved.

No I think this is because menu-bar-options-save doesn't notice that 
the standard value for blink-cursor-mode is supposed to be different, 
so it doesn't bother saving the current value.

Therefore, I tried to do this in my site init file:

(put 'blink-cursor-mode 'standard-value t)

However, it has absolutely no effect. That's because the 
customized-value property of blink-cursor-mode simply isn't set 
correctly when blink-cursor-mode changes. Theoretically, 
customize-mark-as-set should take care of that, checking the 
standard-value property. That's why I tried to set it.

Why does this not work???

Thanks for your help!

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

* Re: setting default value
       [not found] <mailman.4613.1115797896.2819.help-gnu-emacs@gnu.org>
@ 2005-05-11 14:18 ` Stefan Monnier
  0 siblings, 0 replies; 3+ messages in thread
From: Stefan Monnier @ 2005-05-11 14:18 UTC (permalink / raw)


> In a site init file, I'm trying to set different default values for stuff
> like 'blink-cursor-mode'.

> (setq-default blink-cursor-mode t)
> (blink-cursor-mode blink-cursor-mode)

Now this piece of code is bizarre.  Are you trying to check for corner-case
bugs or was there a particular reason why you didn't just do

  (blink-cursor-mode t)


-- Stefan

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

* Re: setting default value
@ 2005-05-12  4:46 David Reitter
  0 siblings, 0 replies; 3+ messages in thread
From: David Reitter @ 2005-05-12  4:46 UTC (permalink / raw)


Stefan Monnier wrote:

> > In a site init file, I'm trying to set different default values for 
> stuff
> > like 'blink-cursor-mode'.
>
> > (setq-default blink-cursor-mode t)
> > (blink-cursor-mode blink-cursor-mode)
>
> Now this piece of code is bizarre.  Are you trying to check for 
> corner-case
> bugs or was there a particular reason why you didn't just do
>
>   (blink-cursor-mode t)


Oh that's what I did first, but it seems to set blink-cursor mode but 
not allow for further changes using the Options menu (and Save 
Options).

And that's my problem - no matter what I do.

Remember that I need to do this in a site-init file. The individual 
user is going to have an option in the menu bar that can be toggled 
(this is default). It is, however, only saved to .emacs if it is 
different from the default (which, I thought, would be in the 
standard-value property of blink-cursor-mode). If I just hardwire 
blink-cursor-mode to be enabled, and the user disables it, no entry 
gets saved to .emacs, with the result that blink-cursor-mode is back to 
enabled mode after the next restart.

So again my question: how do I manipulate the default choice of a 
(customizable) variable?

- D

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

end of thread, other threads:[~2005-05-12  4:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-05-12  4:46 setting default value David Reitter
     [not found] <mailman.4613.1115797896.2819.help-gnu-emacs@gnu.org>
2005-05-11 14:18 ` Stefan Monnier
  -- strict thread matches above, loose matches on Subject: below --
2005-05-11  7:44 David Reitter

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).