help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Generality of defvar


From: Emanuel Berg
Subject: Re: Generality of defvar
Date: Fri, 29 Jul 2022 17:56:44 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

Yuri Khan wrote:

>> (defvar var-name)
>> (setq var-name 'var-value)
>>
>> instead because if you do something with that and want to
>> reset it, it's enough to evaluate the second line, whereas
>> if you just have the first line you tend to evaluate that
>> one and if/because the variable is already set at that
>> point then nothing will happen ...
>
> Yes, but you can press C-M-x on a (defvar var-name
> 'var-value) and it will get re-set to the new value even if
> the variable is already defined.

So you can! I just tested and you are right. Did they change
that recently? Okay then, I guess there is no point in doing

  (defvar var-name)
  (setq var-name 'var-value)

anymore.

-- 
underground experts united
https://dataswamp.org/~incal




reply via email to

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