From mboxrd@z Thu Jan 1 00:00:00 1970 From: npostavs@users.sourceforge.net Subject: bug#25132: 26.0.50; emacs hangs when loading org file with python source blocks Date: Mon, 23 Jan 2017 22:36:13 -0500 Message-ID: <874m0puo2a.fsf__9512.02887013114$1485229016$gmane$org@users.sourceforge.net> References: <4aa23451-b6cd-88b0-369e-99f6fe5f2175@gmail.com> <87y3yn2x4j.fsf@users.sourceforge.net> <87eg0e36un.fsf@users.sourceforge.net> <878tq6wo1p.fsf@users.sourceforge.net> <345079d3-9578-9ab9-1444-353843a70f8b@yandex.ru> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:58604) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cVrtt-000792-4B for emacs-orgmode@gnu.org; Mon, 23 Jan 2017 22:36:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cVrtq-0000U6-1b for emacs-orgmode@gnu.org; Mon, 23 Jan 2017 22:36:05 -0500 Sender: "Debbugs-submit" Resent-Message-ID: In-Reply-To: <345079d3-9578-9ab9-1444-353843a70f8b@yandex.ru> (Dmitry Gutov's message of "Mon, 23 Jan 2017 06:53:21 +0300") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Dmitry Gutov Cc: David Dynerman , 25132@debbugs.gnu.org, =?UTF-8?Q?Cl=C3=A9ment?= Pit--Claudel Dmitry Gutov writes: > On 20.01.2017 03:52, npostavs@users.sourceforge.net wrote: > >> My feeling is that inhibit-modification-hooks should usually be buffer >> local anyway. > > Maybe you're right. > > inhibit-read-only, bound nearby, seems to be in the same situation. > >>> If we are not, why not make inhibit-modification-hooks always >>> buffer-local instead? >> >> It would have to be in addition to, 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'. > > You're right, and that sounds a little too complicated for my taste. > > So, personally, I'd try to fix the particular instance > first. Switching buffers inside with-silent-modifications is not a > very common usage, I think. > > Maybe org-src should itself let-bind the aforementioned variable(s) > where it visits other buffers. Yeah, that works, and is my proposal for emacs-25, but I'm still leaning towards solving this more broadly in with-silent-modifications, probably also add a mention about this to the inhibit-modification-hooks docstring. I think doing the same to inhibit-read-only isn't worth the trouble because if it happens to be let-bound to t in a buffer where it wasn't "supposed" to be, the worst that happens is that an error *isn't* thrown.