[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Definition reasoning of revert-buffer-function, should it be defvar-
From: |
Tassilo Horn |
Subject: |
Re: Definition reasoning of revert-buffer-function, should it be defvar-local? |
Date: |
Tue, 10 Aug 2021 16:46:47 +0200 |
User-agent: |
mu4e 1.6.2; emacs 28.0.50 |
Andreas Schwab <schwab@linux-m68k.org> writes:
>> I want to understand the reasoning behind the definition and the
>> intention of the variable `revert-buffer-function`.
>>
>> In `files.el` I see the following definition:
>>
>>> (put 'revert-buffer-function 'permanent-local t)
>>> (defvar revert-buffer-function #'revert-buffer--default)
>>
>> The first line suggests to me, that the intention of the variable is that it
>> is
>> supposed to be buffer-local, but `defvar-local` was not used.
>
> When these lines were written, defvar-local didn't exist.
Hehe, sure. But why hasn't `make-variable-buffer-local' been used? I
agree with Daniel that nobody should ever alter the global value of
`revert-buffer-function' but it is easy to do that accidentally.
Bye,
Tassilo