[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#25132: 26.0.50; emacs hangs when loading org file with python source
From: |
npostavs |
Subject: |
bug#25132: 26.0.50; emacs hangs when loading org file with python source blocks |
Date: |
Thu, 19 Jan 2017 22:18:46 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) |
Clément Pit--Claudel <clement.pit@gmail.com> writes:
> On 2017-01-19 19:52, npostavs@users.sourceforge.net wrote:
>> because even after doing (make-variable-buffer-local 'var), (let
>> ((var 'foo))...) still makes a global binding.
>> `make-variable-buffer-local' only has effect for `setq', which I
>> think will hardly ever happen for `inhibit-modification-hooks'.
>
> On 2017-01-19 19:52, npostavs@users.sourceforge.net wrote:
>> because even after doing (make-variable-buffer-local 'var), (let
>> ((var 'foo))...) still makes a global binding.
>> `make-variable-buffer-local' only has effect for `setq', which I
>> think will hardly ever happen for `inhibit-modification-hooks'.
>
> Hi Noam,
>
> Can you explain a bit more? I'm not sure what you meant.
>
> I tried the following to illustrate your point:
>
> (defvar aa 0)
>
> (with-temp-buffer
> (setq-local aa 1)
> (let ((b1 (current-buffer)))
> (with-temp-buffer
> (let ((aa 2))
> (message "In b2: %S" aa)
> (with-current-buffer b1
> (message "In b1: %S" aa))))))
My point was that the setq-local (or make-local-variable) is required
and that defvar-local (or make-variable-buffer-local) is not enough.
Compare:
(defvar-local bb 0)
(with-temp-buffer
(let ((b1 (current-buffer)))
(with-temp-buffer
(let ((bb 2))
(message "In b2: %S" bb)
(with-current-buffer b1
(message "In b1: %S" bb))))))