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: Eli Zaretskii
Subject: Re: Does defvar-local has same effect as make-variable-buffer-local?
Date: Sun, 16 May 2021 11:55:18 +0300

> Date: Sun, 16 May 2021 11:09:02 +0300
> From: Jean Louis <bugs@gnu.support>
> Cc: help-gnu-emacs@gnu.org
> 
> * Eli Zaretskii <eliz@gnu.org> [2021-05-16 07:12]:
> > > Date: Sat, 15 May 2021 23:14:38 +0300
> > > From: Jean Louis <bugs@gnu.support>
> > > 
> > > I did read the documentation, yet I need assurance on this subject.
> > 
> > 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.

The doc string of defvar-local answers that question as well:

  (defvar-local VAR VAL &optional DOCSTRING)

    Probably introduced at or before Emacs version 24.3.
                                           ^^^^^^^^^^^^
So code written before that version couldn't use defvar-local.



reply via email to

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