From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#25111: How modification-hooks let-bind inhibit-modification-hooks? Date: Mon, 05 Dec 2016 20:37:09 +0200 Message-ID: <83oa0qjk8a.fsf@gnu.org> References: Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1480963095 2908 195.159.176.226 (5 Dec 2016 18:38:15 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 5 Dec 2016 18:38:15 +0000 (UTC) Cc: 25111@debbugs.gnu.org, phillip.lord@russet.org.uk To: Noam Postavsky Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Dec 05 19:38:10 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cDy9S-0008Mj-IP for geb-bug-gnu-emacs@m.gmane.org; Mon, 05 Dec 2016 19:38:10 +0100 Original-Received: from localhost ([::1]:43864 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cDy9W-0006Yp-Eg for geb-bug-gnu-emacs@m.gmane.org; Mon, 05 Dec 2016 13:38:14 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50930) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cDy9L-0006Xq-Pv for bug-gnu-emacs@gnu.org; Mon, 05 Dec 2016 13:38:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cDy9K-0007rm-Vr for bug-gnu-emacs@gnu.org; Mon, 05 Dec 2016 13:38:03 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:41853) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cDy9K-0007rg-SM for bug-gnu-emacs@gnu.org; Mon, 05 Dec 2016 13:38:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cDy9K-0006EE-K1 for bug-gnu-emacs@gnu.org; Mon, 05 Dec 2016 13:38:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 05 Dec 2016 18:38:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25111 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 25111-submit@debbugs.gnu.org id=B25111.148096302623871 (code B ref 25111); Mon, 05 Dec 2016 18:38:02 +0000 Original-Received: (at 25111) by debbugs.gnu.org; 5 Dec 2016 18:37:06 +0000 Original-Received: from localhost ([127.0.0.1]:57251 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cDy8Q-0006Cw-L3 for submit@debbugs.gnu.org; Mon, 05 Dec 2016 13:37:06 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:59757) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cDy8P-0006CT-MV for 25111@debbugs.gnu.org; Mon, 05 Dec 2016 13:37:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cDy8I-0007eq-0h for 25111@debbugs.gnu.org; Mon, 05 Dec 2016 13:37:00 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:49440) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cDy8H-0007em-Ti; Mon, 05 Dec 2016 13:36:57 -0500 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3410 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1cDy8G-00026x-GO; Mon, 05 Dec 2016 13:36:57 -0500 In-reply-to: (message from Noam Postavsky on Mon, 5 Dec 2016 12:39:29 -0500) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:126521 Archived-At: > From: Noam Postavsky > Date: Mon, 5 Dec 2016 12:39:29 -0500 > Cc: Phillip Lord , 25111@debbugs.gnu.org > > >> The documentation for "modification-hooks" on overlays says: > >> > >> If these functions modify the buffer, they should bind > >> ‘inhibit-modification-hooks’ to ‘t’ around doing so, to avoid > >> confusing the internal mechanism that calls these hooks. > >> > >> But as far as I can see, the only place these gets called > >> "signal_after_change" > >> and "signal_before_change", inhibit-modification-hooks is already specbound > >> to t, so this advice is unnecessary. > >> > >> Also, the documentation for inhibit-modification-hooks says: > >> > >> If you do want modification hooks to be run in a particular > >> piece of code that is itself run from a modification hook, then > >> rebind locally ‘inhibit-modification-hooks’ to ‘nil’. > >> > >> which suggests that, in fact, it is possible to call the modification > >> hooks from inside another call to these functions. > > > > Given these two excerpts, it seems to me that there's no inaccuracies > > in the manual, perhaps we just need to tell both stories in the same > > place or something? Or do you still think there's something incorrect > > in these two fragments? > > Would following the advice in the second fragment confuse the > "internal mechanism" (as suggested in the first fragment) or not? Only if the other hooks that modify buffer, and do NOT want hooks to be run, don't bind inhibit-modification-hooks to t. AFAIU, at least.