all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Variable that can be set only through customize
@ 2013-08-29 16:48 Julien Cubizolles
  2013-08-29 17:04 ` Drew Adams
  0 siblings, 1 reply; 3+ messages in thread
From: Julien Cubizolles @ 2013-08-29 16:48 UTC (permalink / raw)
  To: help-gnu-emacs

While configuring AUCTex, I came upon this variable
LaTeX-math-abbrev-prefix that can only be set through customize. That's
what the docstring says, and indeed I can't change its value using
setq. What's the purpose of this limitation ? Is there a way to
circumvent it ?

Julien.




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

* RE: Variable that can be set only through customize
  2013-08-29 16:48 Variable that can be set only through customize Julien Cubizolles
@ 2013-08-29 17:04 ` Drew Adams
  2013-08-30 15:37   ` Julien Cubizolles
  0 siblings, 1 reply; 3+ messages in thread
From: Drew Adams @ 2013-08-29 17:04 UTC (permalink / raw)
  To: Julien Cubizolles, help-gnu-emacs

> While configuring AUCTex, I came upon this variable
> LaTeX-math-abbrev-prefix that can only be set through customize. That's
> what the docstring says, and indeed I can't change its value using
> setq. What's the purpose of this limitation ? Is there a way to
> circumvent it ?

Someone else can speak more directly to your question. (I don't have the
AUCTex code etc.)

But in general it is good to keep in mind that Customize often does
additional things when you use it to set an option value.  One important
thing it does is type-check the value to be assigned; it checks it against
the type specified in the `defcustom' that defines the option.

In addition, a `defcustom' can specify a `:set' operation, which is a
function that is invoked whenever the option gets set to a new value.

To set an option value programmatically, you will want to first check the
option definition - its `defcustom'.  Once you understand that you will be
in a better position to know what you might need to do when setting the
value.

If you intend to set option values using Lisp, you will want to become
familiar with (at least) these Customize functions: `customize-set-value',
`customize-set-variable'.



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

* Re: Variable that can be set only through customize
  2013-08-29 17:04 ` Drew Adams
@ 2013-08-30 15:37   ` Julien Cubizolles
  0 siblings, 0 replies; 3+ messages in thread
From: Julien Cubizolles @ 2013-08-30 15:37 UTC (permalink / raw)
  To: Drew Adams; +Cc: help-gnu-emacs

Drew Adams <drew.adams@oracle.com> writes:

>> While configuring AUCTex, I came upon this variable
>> LaTeX-math-abbrev-prefix that can only be set through customize. That's
>> what the docstring says, and indeed I can't change its value using
>> setq. What's the purpose of this limitation ? Is there a way to
>> circumvent it ?

> To set an option value programmatically, you will want to first check the
> option definition - its `defcustom'.  Once you understand that you will be
> in a better position to know what you might need to do when setting the
> value.

Thanks for this very thorough answer.

> If you intend to set option values using Lisp, you will want to become
> familiar with (at least) these Customize functions: `customize-set-value',
> `customize-set-variable'.

That's what I had settled on.

Julien.



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

end of thread, other threads:[~2013-08-30 15:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-29 16:48 Variable that can be set only through customize Julien Cubizolles
2013-08-29 17:04 ` Drew Adams
2013-08-30 15:37   ` Julien Cubizolles

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.