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

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

Re: Does defvar-local has same effect as make-variable-buffer-local?


From: Yuri Khan
Subject: Re: Does defvar-local has same effect as make-variable-buffer-local?
Date: Sun, 16 May 2021 15:52:48 +0700

On Sun, 16 May 2021 at 15:32, Jean Louis <bugs@gnu.support> wrote:

> > Why not look at the source?  Then you could be absolutely sure.
>
> Because I read the other sources (not source of definition) I get
> confused, example in simple.el:
>
> (defvar minibuffer-history-isearch-message-overlay)
> (make-variable-buffer-local 'minibuffer-history-isearch-message-overlay)
>
> Then I ask myself why did not author straight write like:
>
> (defvar-local minibuffer-history-isearch-message-overlay)
>
> I ask myself why that, what is the difference... then I need
> assistance in clarification.

Why not look at the history? ;)

    $ git blame subr.el

shows that defvar-local was introduced on May 4, 2012. On the other hand,

    $ git blame simple.el

shows minibuffer-history-isearch-message-overlay was added July 23,
2007. Its author could not have used defvar-local at the time, because
it had not yet been invented.

This leaves us with the question “why didn’t the author of
defvar-local immediately convert all code to use it”, to which a
possible answer is “because he wasn’t sure it makes a big difference”.



reply via email to

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