[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [External] : Re: Is there a way of setting a variable only when it e

From: Marcin Borkowski
Subject: Re: [External] : Re: Is there a way of setting a variable only when it exists?
Date: Wed, 16 Mar 2022 19:32:35 +0100
User-agent: mu4e 1.1.0; emacs 29.0.50

On 2022-03-15, at 16:38, Drew Adams <> wrote:

>> What if it's an internal Emacs variable which might become a user
>> option one day (I submitted a bug report about it) and then my
>> customization silently disappears?  It's the "silently" part I
>> want to guard against...
> What do you mean by "an internal Emacs variable"?

As I hinted in my question, one whose name contains a double dash.

> If it's a defvar then Emacs's predefined defvar
> has no effect if you defvar the variable before
> Emacs does.  And it has no effect if you setq
> the var before or after Emacs defvars it (as long
> as Emacs doesn't _use_ it before you setq it).

I know that.

> If Emacs later changes it to a defcustom, the
> same things apply.  However, if the defcustom has
> a :set function then your own setting of it might
> no longer be appropriate ("valid").

If, however, it gets promoted to a user option - and gets renamed -
things look different.


Marcin Borkowski

reply via email to

[Prev in Thread] Current Thread [Next in Thread]