GNU bug report logs - #25111
How modification-hooks let-bind inhibit-modification-hooks?

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Severity: minor; Reported by: "Phillip Lord" <phillip.lord@HIDDEN>; dated Sun, 4 Dec 2016 20:55:01 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 25111 <at> debbugs.gnu.org:


Received: (at 25111) by debbugs.gnu.org; 9 Mar 2017 19:34:14 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Mar 09 14:34:14 2017
Received: from localhost ([127.0.0.1]:48050 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1cm3pG-0003eW-G6
	for submit <at> debbugs.gnu.org; Thu, 09 Mar 2017 14:34:14 -0500
Received: from mail-ot0-f175.google.com ([74.125.82.175]:34219)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <npostavs@HIDDEN>) id 1cm3pE-0003eG-Ht
 for 25111 <at> debbugs.gnu.org; Thu, 09 Mar 2017 14:34:12 -0500
Received: by mail-ot0-f175.google.com with SMTP id o24so63070134otb.1
 for <25111 <at> debbugs.gnu.org>; Thu, 09 Mar 2017 11:34:12 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=mime-version:sender:from:date:message-id:subject:to:cc;
 bh=H4omAFqfFqddR5LdjcqUr0CplokaRl838YJx9V8tD58=;
 b=c5QhN4OvenzSvzy0QZAVXZneZw+wnjAciHfueAI85i6WfFfXRr0FUz5hyBO7G4UhGP
 CCcJjOcGEC1AoFBi2lAzZQ8jFNvr1zia5yKRuh9TDV018gabIri8stAfEQETxrmyEk7O
 UuhdzFkF/A66uXa8/p/20O3GiQDR8SHFo2LrddGVUSg6f/8NXh0sbK1hMWJaDUvg3k16
 txKi5JJhUF9dwmf2uw7dMNn3/5l9FuPixizSUXZD2ugIO+CONX2LBkQmlAYn1DVMGvQU
 zytHcBHPLSJ8ZU0KWiSJ9zKz3HuRubUpLXpU2aPpxiHaqccedlcPcHUVfrMIw7+S/LVC
 GvpA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:sender:from:date:message-id:subject
 :to:cc;
 bh=H4omAFqfFqddR5LdjcqUr0CplokaRl838YJx9V8tD58=;
 b=c4Hd5rljId8Be2oFOmBMtt6cCF68aE8xr1POpqKI+0Pv3H9xWNFLoYjeDdejSuDubR
 WLN1mwb7IAyrKuxjhQIhoSEPHbSZfn/e8je+B0NtBbM87VY0kQec54H49cRGMpIwjO8m
 KKXrj3Mcd6Xxqp0DvDGRGrufwQnc27AqvRcaWoKC47iyOI5J1CiU92Ky/3vctHlxCMKU
 Vy3j0RmiZTrMcq9xVJN76c5gYxWtnXhkTZ/DwMeWUfkS6OHMueJuevrcJw8q2rSw6rNZ
 i9IIVei85IOCFQHpCKr7NLn2iXPr8jj8UCRkAm6XJjEtf/ZFGRVOLBG3aAlOmr67yqX0
 1a0A==
X-Gm-Message-State: AFeK/H3r7uOBQilo3A/gBY/pgxVHCZSha7ohvnNVB5qWNhXuuxUWINLuBu798SNwONoZHvQS1i4BkdTdkxsC1g==
X-Received: by 10.157.42.39 with SMTP id t36mr9112593ota.79.1489088046494;
 Thu, 09 Mar 2017 11:34:06 -0800 (PST)
MIME-Version: 1.0
Received: by 10.157.80.172 with HTTP; Thu, 9 Mar 2017 11:34:06 -0800 (PST)
From: Noam Postavsky <npostavs@HIDDEN>
Date: Thu, 9 Mar 2017 14:34:06 -0500
X-Google-Sender-Auth: W7aQ4P1fVeNqXgDYlrxTNFBfQbc
Message-ID: <CAM-tV-8ViDrcy8F9yUitkqwv1SWGTQpa52wHTTAuhUFzak+bsw@HIDDEN>
Subject: Re: bug#25111: How modification-hooks let-bind
 inhibit-modification-hooks?
To: Phillip Lord <phillip.lord@HIDDEN>
Content-Type: text/plain; charset=UTF-8
X-Spam-Score: 0.7 (/)
X-Debbugs-Envelope-To: 25111
Cc: Eli Zaretskii <eliz@HIDDEN>, 25111 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.7 (/)

On Wed, Dec 7, 2016 at 11:40 AM, Phillip Lord
<phillip.lord@HIDDEN> wrote:
>
> The reason I ask all of this as a result of a concrete use
> case. yasnippet modifies the buffer in these hooks, in turn breaks my
> own package, lentic, which uses these hooks to respond to changes.
>
>
> https://github.com/joaotavora/yasnippet/issues/756
> https://github.com/phillord/lentic/issues/51

By the way, text-clone--maintain in subr.el seems to have the same problem.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#25111; Package emacs. Full text available.

Message received at 25111 <at> debbugs.gnu.org:


Received: (at 25111) by debbugs.gnu.org; 12 Dec 2016 16:06:08 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Dec 12 11:06:07 2016
Received: from localhost ([127.0.0.1]:39411 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1cGT79-0000qs-NU
	for submit <at> debbugs.gnu.org; Mon, 12 Dec 2016 11:06:07 -0500
Received: from eggs.gnu.org ([208.118.235.92]:40385)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1cGT78-0000qH-4D
 for 25111 <at> debbugs.gnu.org; Mon, 12 Dec 2016 11:06:06 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <eliz@HIDDEN>) id 1cGT6z-0007YN-5g
 for 25111 <at> debbugs.gnu.org; Mon, 12 Dec 2016 11:06:01 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_40,RP_MATCHES_RCVD
 autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:59123)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1cGT6z-0007YH-2V; Mon, 12 Dec 2016 11:05:57 -0500
Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:4666
 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1cGT6y-00046i-Cy; Mon, 12 Dec 2016 11:05:56 -0500
Date: Mon, 12 Dec 2016 18:06:34 +0200
Message-Id: <83lgvlcet1.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: phillip.lord@HIDDEN (Phillip Lord)
In-reply-to: <878trmxgjh.fsf@HIDDEN> (phillip.lord@HIDDEN)
Subject: Re: bug#25111:
References: <f5f413ee50ce5808ca0e8597ce95cdc3.squirrel@HIDDEN>
 <8360myl7ay.fsf@HIDDEN> <87wpfbpual.fsf@HIDDEN>
 <WM!2f8d5bad87de09a0621b1f025704a97dd719ed1ae7d08e03f6b419e215cd51bc54917b522795d7421de3533c07950608!@mailhub-mx1>
 <83eg1iiffm.fsf@HIDDEN> <87pol1kon4.fsf@HIDDEN>
 <83bmwlggix.fsf@HIDDEN> <878trmxgjh.fsf@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2001:4830:134:3::e
X-Spam-Score: -8.1 (--------)
X-Debbugs-Envelope-To: 25111
Cc: 25111 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Reply-To: Eli Zaretskii <eliz@HIDDEN>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -8.1 (--------)

> From: phillip.lord@HIDDEN (Phillip Lord)
> Cc: 25111 <at> debbugs.gnu.org
> Date: Sun, 11 Dec 2016 22:11:14 +0000
> 
> So, instead of this:
> 
>      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.
> 
> 
> We could have:
> 
>     These functions should avoid unnecessarily modifying the buffer.
>     Emacs binds 'inhibit-modification-hooks' to `t' during their
>     evaluation, which means that any modifications will not be signalled
>     to other hook functions listening for them.
> 
> 
> Perhaps a better solution would be:
> 
> 
>     These functions should avoid unnecessarily modifying the buffer; see
>     Change Hooks for further details.
> 
> 
> Then a new paragraph can be added to the Change Hooks section talking
> about the complexity of modifying buffers on these hooks, with
> alternatives.
> 
> I am happy to draft something if you wish.

Sure, please do.

Thanks.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#25111; Package emacs. Full text available.

Message received at 25111 <at> debbugs.gnu.org:


Received: (at 25111) by debbugs.gnu.org; 11 Dec 2016 22:11:29 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Dec 11 17:11:29 2016
Received: from localhost ([127.0.0.1]:38501 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1cGCLA-0002Mh-Sa
	for submit <at> debbugs.gnu.org; Sun, 11 Dec 2016 17:11:29 -0500
Received: from mailgw.mycpanelcloud.co.uk ([185.116.214.205]:36873)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <phillip.lord@HIDDEN>) id 1cGCL8-0002MT-D2
 for 25111 <at> debbugs.gnu.org; Sun, 11 Dec 2016 17:11:28 -0500
Received: from mailgw.mycpanelcloud.co.uk (localhost [127.0.0.1])
 by mailgw.mycpanelcloud.co.uk (Postfix) with ESMTP id 97BEFC4702
 for <25111 <at> debbugs.gnu.org>; Sun, 11 Dec 2016 23:11:03 +0000 (GMT)
X-Virus-Scanned: by SpamTitan at mycpanelcloud.co.uk
Received: from mailgw.mycpanelcloud.co.uk (localhost [127.0.0.1])
 by mailgw.mycpanelcloud.co.uk (Postfix) with ESMTP id 9915BC4666
 for <25111 <at> debbugs.gnu.org>; Sun, 11 Dec 2016 23:10:59 +0000 (GMT)
Received: from cloud103.planethippo.com (unknown [31.216.48.128])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (No client certificate requested)
 by mailgw.mycpanelcloud.co.uk (Postfix) with ESMTPS id 750B3C45FB
 for <25111 <at> debbugs.gnu.org>; Sun, 11 Dec 2016 23:10:59 +0000 (GMT)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
 d=russet.org.uk; s=default; h=Content-Transfer-Encoding:Content-Type:
 MIME-Version:Message-ID:In-Reply-To:Date:References:Subject:Cc:To:From:Sender
 :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:
 Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:
 List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=7QEUhlLC7dPEb+X9rJZCff8zOn6vy4utxnL3tc/jWTg=; b=E7/+7ta2+2lLnOK6Bs5q/GPjFW
 kzgQrkmjICqPEeoNnLwXHrYeUiTm3FynQV8jF4ixK+epuIwoVd51zcueHfu474leTfbleLVtyW4MH
 iypPehWDW6lagD0360qznIdv8a2wFCjOg5Sdn05ljVDLxy+a5uaRCY+KR5j/q1+rfnGiVeHQZudti
 Os50A2hkOPu30L/rZdfNNkwBKuNa7NR0vDquzwucgzKac9sdwrS7YgNi9W4wrHFsycV3lfr1VEW/c
 c7s2J+ZY8jwYtKDxgQHBAdWh9ncbwG6f/aJHXDhd0l1lc4hwUYyvT3x3FpI3B8+KGOSuAFk6mtIQ7
 rjTwaLEw==;
Received: from cpc2-benw10-2-0-cust42.gate.cable.virginm.net
 ([77.103.60.43]:49106 helo=russet.org.uk)
 by cloud103.planethippo.com with esmtpsa
 (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.87)
 (envelope-from <phillip.lord@HIDDEN>)
 id 1cGCKy-001MBf-2r; Sun, 11 Dec 2016 22:11:16 +0000
From: phillip.lord@HIDDEN (Phillip Lord)
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#25111:
References: <f5f413ee50ce5808ca0e8597ce95cdc3.squirrel@HIDDEN>
 <8360myl7ay.fsf@HIDDEN> <87wpfbpual.fsf@HIDDEN>
 <WM!2f8d5bad87de09a0621b1f025704a97dd719ed1ae7d08e03f6b419e215cd51bc54917b522795d7421de3533c07950608!@mailhub-mx1>
 <83eg1iiffm.fsf@HIDDEN> <87pol1kon4.fsf@HIDDEN>
 <83bmwlggix.fsf@HIDDEN>
Date: Sun, 11 Dec 2016 22:11:14 +0000
In-Reply-To: <83bmwlggix.fsf@HIDDEN> (Eli Zaretskii's message of "Fri, 09 Dec
 2016 19:26:46 +0200")
Message-ID: <878trmxgjh.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-AntiAbuse: This header was added to track abuse,
 please include it with any abuse report
X-AntiAbuse: Primary Hostname - cloud103.planethippo.com
X-AntiAbuse: Original Domain - debbugs.gnu.org
X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12]
X-AntiAbuse: Sender Address Domain - russet.org.uk
X-Get-Message-Sender-Via: cloud103.planethippo.com: authenticated_id:
 phillip.lord@HIDDEN
X-Authenticated-Sender: cloud103.planethippo.com: phillip.lord@HIDDEN
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 25111
Cc: 25111 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.0 (/)

Eli Zaretskii <eliz@HIDDEN> writes:

>> From: phillip.lord@HIDDEN (Phillip Lord)
>> Cc: 25111 <at> debbugs.gnu.org
>> Date: Fri, 09 Dec 2016 17:17:51 +0000
>>
>> My own feeling is that "inhibit-modification-hooks" should *only* be for
>> modifications that really should not be detected by anything else. I can
>> think of examples of this (I used to change the buffer to display a
>> completion string to the user for instance, although I now use an
>> "after-string" overlay property).
>>=20
>> The simplest advice makes calls to the modification hooks consistent is
>> to say "You should not modify the buffer on these hooks". The potential
>> solution, for instance, for yasnippet is to record the changes on
>> after-change-function, and then change the buffer on
>> post-command-hook. I think this would work? Is this what the manual
>> should say?
>
> IMO, the manual should advise the safe practices, and then tell how to
> behave if the code really needs to play it less safe.  The former
> would be what you say above, I think.  But since we know there are
> packages out there that don't choose the safe approach, we should
> cover those as well.


So, instead of this:

     If these functions modify the buffer, they should bind
     =E2=80=98inhibit-modification-hooks=E2=80=99 to =E2=80=98t=E2=80=99 ar=
ound doing so, to avoid
     confusing the internal mechanism that calls these hooks.


We could have:

    These functions should avoid unnecessarily modifying the buffer.
    Emacs binds 'inhibit-modification-hooks' to `t' during their
    evaluation, which means that any modifications will not be signalled
    to other hook functions listening for them.


Perhaps a better solution would be:


    These functions should avoid unnecessarily modifying the buffer; see
    Change Hooks for further details.


Then a new paragraph can be added to the Change Hooks section talking
about the complexity of modifying buffers on these hooks, with
alternatives.

I am happy to draft something if you wish.

Phil




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#25111; Package emacs. Full text available.

Message received at 25111 <at> debbugs.gnu.org:


Received: (at 25111) by debbugs.gnu.org; 9 Dec 2016 21:10:15 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Dec 09 16:10:15 2016
Received: from localhost ([127.0.0.1]:36308 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1cFSQp-00046L-1h
	for submit <at> debbugs.gnu.org; Fri, 09 Dec 2016 16:10:15 -0500
Received: from eggs.gnu.org ([208.118.235.92]:57572)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1cFRns-0007Wf-1K
 for 25111 <at> debbugs.gnu.org; Fri, 09 Dec 2016 15:30:00 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <eliz@HIDDEN>) id 1cFOw5-0001PA-6h
 for 25111 <at> debbugs.gnu.org; Fri, 09 Dec 2016 12:26:21 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD
 autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:42919)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1cFOw5-0001P6-3N; Fri, 09 Dec 2016 12:26:17 -0500
Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:4338
 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1cFOw4-0002nZ-CS; Fri, 09 Dec 2016 12:26:16 -0500
Date: Fri, 09 Dec 2016 19:26:46 +0200
Message-Id: <83bmwlggix.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: phillip.lord@HIDDEN (Phillip Lord)
In-reply-to: <87pol1kon4.fsf@HIDDEN> (phillip.lord@HIDDEN)
Subject: Re: bug#25111:
References: <f5f413ee50ce5808ca0e8597ce95cdc3.squirrel@HIDDEN>
 <8360myl7ay.fsf@HIDDEN> <87wpfbpual.fsf@HIDDEN>
 <WM!2f8d5bad87de09a0621b1f025704a97dd719ed1ae7d08e03f6b419e215cd51bc54917b522795d7421de3533c07950608!@mailhub-mx1>
 <83eg1iiffm.fsf@HIDDEN> <87pol1kon4.fsf@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2001:4830:134:3::e
X-Spam-Score: -8.0 (--------)
X-Debbugs-Envelope-To: 25111
Cc: 25111 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Reply-To: Eli Zaretskii <eliz@HIDDEN>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -8.0 (--------)

> From: phillip.lord@HIDDEN (Phillip Lord)
> Cc: 25111 <at> debbugs.gnu.org
> Date: Fri, 09 Dec 2016 17:17:51 +0000
> 
> > So how would you want the manual to help avert such calamities?
> 
> 
> My own feeling is that "inhibit-modification-hooks" should *only* be for
> modifications that really should not be detected by anything else. I can
> think of examples of this (I used to change the buffer to display a
> completion string to the user for instance, although I now use an
> "after-string" overlay property).
> 
> The simplest advice makes calls to the modification hooks consistent is
> to say "You should not modify the buffer on these hooks". The potential
> solution, for instance, for yasnippet is to record the changes on
> after-change-function, and then change the buffer on
> post-command-hook. I think this would work? Is this what the manual
> should say?

IMO, the manual should advise the safe practices, and then tell how to
behave if the code really needs to play it less safe.  The former
would be what you say above, I think.  But since we know there are
packages out there that don't choose the safe approach, we should
cover those as well.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#25111; Package emacs. Full text available.

Message received at 25111 <at> debbugs.gnu.org:


Received: (at 25111) by debbugs.gnu.org; 9 Dec 2016 17:33:31 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Dec 09 12:33:31 2016
Received: from localhost ([127.0.0.1]:36230 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1cFP35-0001qM-5A
	for submit <at> debbugs.gnu.org; Fri, 09 Dec 2016 12:33:31 -0500
Received: from mailgw.mycpanelcloud.co.uk ([185.116.214.125]:25085)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <phillip.lord@HIDDEN>) id 1cFP32-0001q7-Qy
 for 25111 <at> debbugs.gnu.org; Fri, 09 Dec 2016 12:33:29 -0500
Received: from mailgw.mycpanelcloud.co.uk (localhost [127.0.0.1])
 by mailgw.mycpanelcloud.co.uk (Postfix) with ESMTP id 388C2C40B9
 for <25111 <at> debbugs.gnu.org>; Fri,  9 Dec 2016 18:17:37 +0000 (GMT)
X-Virus-Scanned: by SpamTitan at mycpanelcloud.co.uk
Received: from mailgw.mycpanelcloud.co.uk (localhost [127.0.0.1])
 by mailgw.mycpanelcloud.co.uk (Postfix) with ESMTP id B4BF7C41C6
 for <25111 <at> debbugs.gnu.org>; Fri,  9 Dec 2016 18:17:35 +0000 (GMT)
Received: from cloud103.planethippo.com (unknown [31.216.48.128])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (No client certificate requested)
 by mailgw.mycpanelcloud.co.uk (Postfix) with ESMTPS id A6E00C40C2
 for <25111 <at> debbugs.gnu.org>; Fri,  9 Dec 2016 18:17:35 +0000 (GMT)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
 d=russet.org.uk; s=default; h=Content-Type:MIME-Version:Message-ID:
 In-Reply-To:Date:References:Subject:Cc:To:From:Sender:Reply-To:
 Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date:
 Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:
 List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=2Z6rTyJXSaH3N3cSx7vOGwdNKQBqoXqXX/IR/Y1DL9s=; b=yasTsAdaJmE47u7lfWleU+k4s
 +e5CiqyFkM1bUOTFlA7HiTl4LGu9ja49W4xFtUKdE48LEOUXRuva9BoYGd6hZP/nalzd69V9QAIF7
 L/YTAqwBTiqkUwyOCIWNeAwkOup63od8wYMZk2RNwYO+ZvvUhhnueqMPAIAUIoQqsZpYYdmCxZiNQ
 3I8EVYjZEOWQ5HdsK4LHvIKZ9lSdndIRKNC7ou+CCAS0XGlc8IiAr1RVyOrc86JJUqSEeWizptW3u
 BZbyA1QsaJ8c7rIVVWeUkas8vL6aewc6giJSRKYt3EGWB5AthGffXloFGrf7aYsYF6lREvf0cQD4d
 CMmbdazLw==;
Received: from janus-nat-128-240-225-37.ncl.ac.uk ([128.240.225.37]:46085
 helo=russet.org.uk) by cloud103.planethippo.com with esmtpsa
 (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.87)
 (envelope-from <phillip.lord@HIDDEN>)
 id 1cFOnv-0007ze-Vl; Fri, 09 Dec 2016 17:17:52 +0000
From: phillip.lord@HIDDEN (Phillip Lord)
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#25111:
References: <f5f413ee50ce5808ca0e8597ce95cdc3.squirrel@HIDDEN>
 <8360myl7ay.fsf@HIDDEN> <87wpfbpual.fsf@HIDDEN>
 <WM!2f8d5bad87de09a0621b1f025704a97dd719ed1ae7d08e03f6b419e215cd51bc54917b522795d7421de3533c07950608!@mailhub-mx1>
 <83eg1iiffm.fsf@HIDDEN>
Date: Fri, 09 Dec 2016 17:17:51 +0000
In-Reply-To: <83eg1iiffm.fsf@HIDDEN> (Eli Zaretskii's message of "Thu, 08 Dec
 2016 17:55:09 +0200")
Message-ID: <87pol1kon4.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-AntiAbuse: This header was added to track abuse,
 please include it with any abuse report
X-AntiAbuse: Primary Hostname - cloud103.planethippo.com
X-AntiAbuse: Original Domain - debbugs.gnu.org
X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12]
X-AntiAbuse: Sender Address Domain - russet.org.uk
X-Get-Message-Sender-Via: cloud103.planethippo.com: authenticated_id:
 phillip.lord@HIDDEN
X-Authenticated-Sender: cloud103.planethippo.com: phillip.lord@HIDDEN
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 25111
Cc: 25111 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.0 (/)

Eli Zaretskii <eliz@HIDDEN> writes:

>> From: phillip.lord@HIDDEN (Phillip Lord)
>> Cc: 25111 <at> debbugs.gnu.org
>> Date: Wed, 07 Dec 2016 16:40:02 +0000
>> 
>> I think that the first of these is incorrect. There is no need to bind
>> `inhibit-modification-hooks' to `t'. More over, there may be reasons by
>> bind `inhibit-modification-hooks' to `nil' (i.e. "If you do want
>> modification hooks to be run...").
>
> So if we envision that some hook will bind inhibit-modification-hooks
> to nil, then that is the reason to bind it to t in a hokk which
> doesn't want such hooks to be run.

Indeed, this is true, and it's a difficulty with the hook. I mean, it is
*meant* to run when the buffer is modified and yet here is an example of
where we cannot be sure that it will.


>> It possible that the documentation should say "Mostly, you should avoid
>> modifying the buffer on these hooks, any other functionality using these
>> modification-hooks will not be called."
>
> You mean, not mention the variable at all?  That'd be loss of useful
> information, I think.
>
>> The reason I ask all of this as a result of a concrete use
>> case. yasnippet modifies the buffer in these hooks, in turn breaks my
>> own package, lentic, which uses these hooks to respond to changes.
>
> So how would you want the manual to help avert such calamities?


My own feeling is that "inhibit-modification-hooks" should *only* be for
modifications that really should not be detected by anything else. I can
think of examples of this (I used to change the buffer to display a
completion string to the user for instance, although I now use an
"after-string" overlay property).

The simplest advice makes calls to the modification hooks consistent is
to say "You should not modify the buffer on these hooks". The potential
solution, for instance, for yasnippet is to record the changes on
after-change-function, and then change the buffer on
post-command-hook. I think this would work? Is this what the manual
should say?

Phil





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#25111; Package emacs. Full text available.

Message received at 25111 <at> debbugs.gnu.org:


Received: (at 25111) by debbugs.gnu.org; 8 Dec 2016 15:54:56 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Dec 08 10:54:56 2016
Received: from localhost ([127.0.0.1]:34724 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1cF128-0003kH-EG
	for submit <at> debbugs.gnu.org; Thu, 08 Dec 2016 10:54:56 -0500
Received: from eggs.gnu.org ([208.118.235.92]:37617)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1cF125-0003k4-W4
 for 25111 <at> debbugs.gnu.org; Thu, 08 Dec 2016 10:54:54 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <eliz@HIDDEN>) id 1cF11w-0007lt-78
 for 25111 <at> debbugs.gnu.org; Thu, 08 Dec 2016 10:54:48 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-3.5 required=5.0 tests=BAYES_05,RP_MATCHES_RCVD
 autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:41859)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1cF11w-0007ln-3m; Thu, 08 Dec 2016 10:54:44 -0500
Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2367
 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1cF11v-00084y-CO; Thu, 08 Dec 2016 10:54:43 -0500
Date: Thu, 08 Dec 2016 17:55:09 +0200
Message-Id: <83eg1iiffm.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: phillip.lord@HIDDEN (Phillip Lord)
In-reply-to: <WM!2f8d5bad87de09a0621b1f025704a97dd719ed1ae7d08e03f6b419e215cd51bc54917b522795d7421de3533c07950608!@mailhub-mx1>
 (phillip.lord@HIDDEN)
Subject: Re: bug#25111:
References: <f5f413ee50ce5808ca0e8597ce95cdc3.squirrel@HIDDEN>
 <8360myl7ay.fsf@HIDDEN> <87wpfbpual.fsf@HIDDEN>
 <WM!2f8d5bad87de09a0621b1f025704a97dd719ed1ae7d08e03f6b419e215cd51bc54917b522795d7421de3533c07950608!@mailhub-mx1>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2001:4830:134:3::e
X-Spam-Score: -8.0 (--------)
X-Debbugs-Envelope-To: 25111
Cc: 25111 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Reply-To: Eli Zaretskii <eliz@HIDDEN>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -8.0 (--------)

> From: phillip.lord@HIDDEN (Phillip Lord)
> Cc: 25111 <at> debbugs.gnu.org
> Date: Wed, 07 Dec 2016 16:40:02 +0000
> 
> I think that the first of these is incorrect. There is no need to bind
> `inhibit-modification-hooks' to `t'. More over, there may be reasons by
> bind `inhibit-modification-hooks' to `nil' (i.e. "If you do want
> modification hooks to be run...").

So if we envision that some hook will bind inhibit-modification-hooks
to nil, then that is the reason to bind it to t in a hokk which
doesn't want such hooks to be run.

> It possible that the documentation should say "Mostly, you should avoid
> modifying the buffer on these hooks, any other functionality using these
> modification-hooks will not be called."

You mean, not mention the variable at all?  That'd be loss of useful
information, I think.

> The reason I ask all of this as a result of a concrete use
> case. yasnippet modifies the buffer in these hooks, in turn breaks my
> own package, lentic, which uses these hooks to respond to changes.

So how would you want the manual to help avert such calamities?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#25111; Package emacs. Full text available.

Message received at 25111 <at> debbugs.gnu.org:


Received: (at 25111) by debbugs.gnu.org; 7 Dec 2016 16:57:26 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Dec 07 11:57:26 2016
Received: from localhost ([127.0.0.1]:59459 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1cEfX4-0003X0-30
	for submit <at> debbugs.gnu.org; Wed, 07 Dec 2016 11:57:26 -0500
Received: from mailhub-mx4.ncl.ac.uk ([128.240.234.84]:47630 helo=mailhub-mx4)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <phillip.lord@HIDDEN>) id 1cEfX1-0003Wr-EB
 for 25111 <at> debbugs.gnu.org; Wed, 07 Dec 2016 11:57:24 -0500
Received: (Haraka outbound); Wed, 07 Dec 2016 16:57:22 +0000
Authentication-Results: mailhub-mx4; spf=pass smtp.mailfrom=newcastle.ac.uk
X-Haraka-RcptSummary: valid=0/0 invalid=0/0 unverified=0/0 relay=1/1
 norelay=0/0
X-Haraka-Relay: true
Received-SPF: Pass (mailhub-mx4: domain of newcastle.ac.uk designates
 10.3.193.34 as permitted sender) receiver=mailhub-mx4; identity=mailfrom;
 client-ip=10.3.193.34; helo=mailhub-ncl4.ncl.ac.uk;
 envelope-from=<phillip.lord@HIDDEN>
Received: from mailhub-ncl4.ncl.ac.uk ([10.3.193.34])
 by mailhub-mx4 (DefenderMX/2.7.3) with ESMTP id
 BD4885A3-38E3-4524-A6C5-0AA344F2B5CA.1
 envelope-from <phillip.lord@HIDDEN>;
 Wed, 07 Dec 2016 16:57:21 +0000
Received: from smtpauth-vm.ncl.ac.uk ([10.8.233.129] helo=smtpauth.ncl.ac.uk)
 by mailhub-ncl4.ncl.ac.uk with esmtp (Exim 4.84_2)
 (envelope-from <phillip.lord@HIDDEN>)
 id 1cEfWz-00008e-Cg; Wed, 07 Dec 2016 16:57:21 +0000
Received: from cpc2-benw10-2-0-cust42.gate.cable.virginm.net ([77.103.60.43]
 helo=localhost)
 by smtpauth.ncl.ac.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.63)
 (envelope-from <phillip.lord@HIDDEN>)
 id 1cEfWy-0005iT-R2; Wed, 07 Dec 2016 16:57:21 +0000
From: phillip.lord@HIDDEN (Phillip Lord)
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#25111:
In-Reply-To: <8360myl7ay.fsf@HIDDEN> (Eli Zaretskii's message of "Mon, 05 Dec
 2016 17:33:25 +0200")
Date: Wed, 07 Dec 2016 16:40:02 +0000
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-NCL-mrate: cflags=() mflags=()
X-Haraka-Syntax: mail_case=upper mail_leading_spaces=N mail_trailing_spaces=N
 mail_missing_brackets=N rcpt_case=upper rcpt_leading_spaces=N
 rcpt_missing_brackets=N rcpt_trailing_spaces=N
X-Haraka-HostID: 10.3.193.34
X-Haraka-SenderAuth: 10.3.193.34 newcastle.ac.uk
X-Haraka-AccessMap: connect:10 OK
X-Haraka-Domain-Info: domain="russet.org.uk" last_update=284
 primary_ns="dns5.planethippo.com" serial=2016022702 refresh=3600 retry=7200
 expiration=1209600 minimum=86400 flags="NS_SAME_NET, MX_IS_NS, MX_SINGLE"
 domain="newcastle.ac.uk" last_update=0 primary_ns="dns0.ncl.ac.uk"
 serial=2016120712 refresh=10800 retry=3600 expiration=604800 minimum=3600
 flags="SOA_UPDATE_1"
X-Haraka-SubjectNonLatin: 0
X-Haraka-NonLatin: 0.458
References: <f5f413ee50ce5808ca0e8597ce95cdc3.squirrel@HIDDEN>
 <8360myl7ay.fsf@HIDDEN> <87wpfbpual.fsf@HIDDEN>
Message-Id: <WM!08631043a461faa2014e54646579c74ae1c68e53d4fe52c5edb2b78f283ac8d2fad293ba1dc436fc679abccaa13a4e20!@mailhub-mx4>
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 25111
Cc: 25111 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.0 (/)

Eli Zaretskii <eliz@HIDDEN> writes:

>> Date: Sun, 4 Dec 2016 20:53:24 -0000
>> From: "Phillip Lord" <phillip.lord@HIDDEN>
>>=20
>> The documentation for "modification-hooks" on overlays says:
>>=20
>>      If these functions modify the buffer, they should bind
>>      =E2=80=98inhibit-modification-hooks=E2=80=99 to =E2=80=98t=E2=80=99=
 around doing so, to avoid
>>      confusing the internal mechanism that calls these hooks.
>>=20
>> 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 specbo=
und
>> to t, so this advice is unnecessary.
>>=20
>> Also, the documentation for inhibit-modification-hooks says:
>>=20
>>      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 =E2=80=98inhibit-modification-hooks=E2=80=99 to =E2=
=80=98nil=E2=80=99.
>>=20
>> 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?

I think that the first of these is incorrect. There is no need to bind
`inhibit-modification-hooks' to `t'. More over, there may be reasons by
bind `inhibit-modification-hooks' to `nil' (i.e. "If you do want
modification hooks to be run..."). I am unclear whether this will
"confuse the internal mechanism", since I don't know exactly what this
means.

It possible that the documentation should say "Mostly, you should avoid
modifying the buffer on these hooks, any other functionality using these
modification-hooks will not be called."

The reason I ask all of this as a result of a concrete use
case. yasnippet modifies the buffer in these hooks, in turn breaks my
own package, lentic, which uses these hooks to respond to changes.


https://github.com/joaotavora/yasnippet/issues/756
https://github.com/phillord/lentic/issues/51

Phil




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#25111; Package emacs. Full text available.

Message received at 25111 <at> debbugs.gnu.org:


Received: (at 25111) by debbugs.gnu.org; 5 Dec 2016 18:37:06 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Dec 05 13:37:06 2016
Received: from localhost ([127.0.0.1]:57251 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1cDy8Q-0006Cw-L3
	for submit <at> debbugs.gnu.org; Mon, 05 Dec 2016 13:37:06 -0500
Received: from eggs.gnu.org ([208.118.235.92]:59757)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1cDy8P-0006CT-MV
 for 25111 <at> debbugs.gnu.org; Mon, 05 Dec 2016 13:37:06 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <eliz@HIDDEN>) id 1cDy8I-0007eq-0h
 for 25111 <at> debbugs.gnu.org; Mon, 05 Dec 2016 13:37:00 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD
 autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:49440)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1cDy8H-0007em-Ti; Mon, 05 Dec 2016 13:36:57 -0500
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 <eliz@HIDDEN>)
 id 1cDy8G-00026x-GO; Mon, 05 Dec 2016 13:36:57 -0500
Date: Mon, 05 Dec 2016 20:37:09 +0200
Message-Id: <83oa0qjk8a.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Noam Postavsky <npostavs@HIDDEN>
In-reply-to: <CAM-tV--B_g_LDRPi00gTqGxxBFvtiyERsw10__XxDu5HbTDORA@HIDDEN>
 (message from Noam Postavsky on Mon, 5 Dec 2016 12:39:29 -0500)
Subject: Re: bug#25111: How modification-hooks let-bind
 inhibit-modification-hooks?
References: <CAM-tV--B_g_LDRPi00gTqGxxBFvtiyERsw10__XxDu5HbTDORA@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2001:4830:134:3::e
X-Spam-Score: -7.9 (-------)
X-Debbugs-Envelope-To: 25111
Cc: 25111 <at> debbugs.gnu.org, phillip.lord@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Reply-To: Eli Zaretskii <eliz@HIDDEN>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -7.9 (-------)

> From: Noam Postavsky <npostavs@HIDDEN>
> Date: Mon, 5 Dec 2016 12:39:29 -0500
> Cc: Phillip Lord <phillip.lord@HIDDEN>, 25111 <at> 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.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#25111; Package emacs. Full text available.

Message received at 25111 <at> debbugs.gnu.org:


Received: (at 25111) by debbugs.gnu.org; 5 Dec 2016 17:39:37 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Dec 05 12:39:37 2016
Received: from localhost ([127.0.0.1]:57224 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1cDxEn-0004nK-Bu
	for submit <at> debbugs.gnu.org; Mon, 05 Dec 2016 12:39:37 -0500
Received: from mail-oi0-f47.google.com ([209.85.218.47]:35611)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <npostavs@HIDDEN>) id 1cDxEl-0004my-D9
 for 25111 <at> debbugs.gnu.org; Mon, 05 Dec 2016 12:39:35 -0500
Received: by mail-oi0-f47.google.com with SMTP id b126so348468310oia.2
 for <25111 <at> debbugs.gnu.org>; Mon, 05 Dec 2016 09:39:35 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=mime-version:sender:from:date:message-id:subject:to:cc
 :content-transfer-encoding;
 bh=zqFrjo7Orf6etu/CtYc8/RuoL7T6Djrb2pfLGYSc+08=;
 b=b5DMoe3pCTbjugs9xSFPexoMwZSugqLn+WqKA7PY8g/J/mWOXNnV96ALX/HlmHNO5A
 /kQ+qNjaUHX0Uf1R4Xsaqz93/HnasQkxXVbMEh+r0I5hrIwN5GDxxIAzRb4UqxNF6p2t
 immgWDNS0xnaKrFqpx1DOjeu+Gng60OfmYJj4Fyz03AT2bMViVPzaRKwIuV9q8yxIWGu
 tTOSqQajU9JMOkS/0PtqLuL2m+LL8ZwclyAO3U86bn9p/kfmB4DV1sBTjjErjUKvmRyj
 S18bRC5r1pI9rhvzU7lOgDvM1i4g74M83jaFi1NiiqDuEbLPxW7Wd/gjz80jNdpQQ9Uj
 U1Ww==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20130820;
 h=x-gm-message-state:mime-version:sender:from:date:message-id:subject
 :to:cc:content-transfer-encoding;
 bh=zqFrjo7Orf6etu/CtYc8/RuoL7T6Djrb2pfLGYSc+08=;
 b=Lm0U0HNiKrCnwjx5j2pO6IfHvcGcilBHgVImadW1iZD6b2fO3LUvjnwiV0+qLY8hUO
 LxZCgwSgR3U1baSSdbvHk4VRZefPIam/a+cO3dLD/v/I0txhwe25U5HF7lA71a1LzLh1
 pSUzBjQYtwZ1fy52+bQOEIolyxgX+J4bHoJ42gh3In8nG4jB97j5fzL0YHKIj6dPdmrn
 vQ3ZgcT0ivRwvTJYrCkpBbjhxKpEPgUGN8RIEhxfrr6bLQ6b47XWdgyjTkGxG7CUwQ9g
 vVkInz9fzbdffBiXu+4kv9g5BKtWIOnVO5p4iCdmG62a3DIuIaARUSkFbTNx6kN3rAsz
 /jEw==
X-Gm-Message-State: AKaTC02fVoVCtj6Eool802Q/um9hC3BNU72qE0VIrus4M0qFi8k92IFRs51VMw9qXeGDPHwz9gOJMjGEC5o7vA==
X-Received: by 10.202.63.65 with SMTP id m62mr30875343oia.167.1480959569775;
 Mon, 05 Dec 2016 09:39:29 -0800 (PST)
MIME-Version: 1.0
Received: by 10.157.6.234 with HTTP; Mon, 5 Dec 2016 09:39:29 -0800 (PST)
From: Noam Postavsky <npostavs@HIDDEN>
Date: Mon, 5 Dec 2016 12:39:29 -0500
X-Google-Sender-Auth: dtxryMXwZEJU3xN95yIxIRsnBtQ
Message-ID: <CAM-tV--B_g_LDRPi00gTqGxxBFvtiyERsw10__XxDu5HbTDORA@HIDDEN>
Subject: Re: bug#25111: How modification-hooks let-bind
 inhibit-modification-hooks?
To: Eli Zaretskii <eliz@HIDDEN>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.5 (/)
X-Debbugs-Envelope-To: 25111
Cc: 25111 <at> debbugs.gnu.org, Phillip Lord <phillip.lord@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.5 (/)

On Mon, Dec 5, 2016 at 10:33 AM, Eli Zaretskii <eliz@HIDDEN> wrote:
>> Date: Sun, 4 Dec 2016 20:53:24 -0000
>> From: "Phillip Lord" <phillip.lord@HIDDEN>
>>
>> The documentation for "modification-hooks" on overlays says:
>>
>>      If these functions modify the buffer, they should bind
>>      =E2=80=98inhibit-modification-hooks=E2=80=99 to =E2=80=98t=E2=80=99=
 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 specbo=
und
>> 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 =E2=80=98inhibit-modification-hooks=E2=80=99 to =E2=
=80=98nil=E2=80=99.
>>
>> 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?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#25111; Package emacs. Full text available.

Message received at 25111 <at> debbugs.gnu.org:


Received: (at 25111) by debbugs.gnu.org; 5 Dec 2016 15:33:22 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Dec 05 10:33:21 2016
Received: from localhost ([127.0.0.1]:57073 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1cDvGb-0001nJ-M3
	for submit <at> debbugs.gnu.org; Mon, 05 Dec 2016 10:33:21 -0500
Received: from eggs.gnu.org ([208.118.235.92]:34627)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1cDvGZ-0001n5-KG
 for 25111 <at> debbugs.gnu.org; Mon, 05 Dec 2016 10:33:19 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <eliz@HIDDEN>) id 1cDvGO-000262-R9
 for 25111 <at> debbugs.gnu.org; Mon, 05 Dec 2016 10:33:14 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD
 autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:46222)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1cDvGO-00025r-OP; Mon, 05 Dec 2016 10:33:08 -0500
Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3200
 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1cDvGN-0001cM-U7; Mon, 05 Dec 2016 10:33:08 -0500
Date: Mon, 05 Dec 2016 17:33:25 +0200
Message-Id: <8360myl7ay.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: "Phillip Lord" <phillip.lord@HIDDEN>
In-reply-to: <f5f413ee50ce5808ca0e8597ce95cdc3.squirrel@HIDDEN>
 (phillip.lord@HIDDEN)
Subject: Re: bug#25111:
References: <f5f413ee50ce5808ca0e8597ce95cdc3.squirrel@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2001:4830:134:3::e
X-Spam-Score: -7.9 (-------)
X-Debbugs-Envelope-To: 25111
Cc: 25111 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Reply-To: Eli Zaretskii <eliz@HIDDEN>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -7.9 (-------)

> Date: Sun, 4 Dec 2016 20:53:24 -0000
> From: "Phillip Lord" <phillip.lord@HIDDEN>
> 
> 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?

Thanks.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#25111; Package emacs. Full text available.
Set bug title to 'How modification-hooks let-bind inhibit-modification-hooks?'. Request was from npostavs@HIDDEN to control <at> debbugs.gnu.org. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 4 Dec 2016 20:54:23 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Dec 04 15:54:23 2016
Received: from localhost ([127.0.0.1]:56192 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1cDdnj-0000Y0-4G
	for submit <at> debbugs.gnu.org; Sun, 04 Dec 2016 15:54:23 -0500
Received: from eggs.gnu.org ([208.118.235.92]:41377)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <phillip.lord@HIDDEN>) id 1cDdnh-0000Xn-JB
 for submit <at> debbugs.gnu.org; Sun, 04 Dec 2016 15:54:21 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <phillip.lord@HIDDEN>) id 1cDdnb-0007vR-Ku
 for submit <at> debbugs.gnu.org; Sun, 04 Dec 2016 15:54:16 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,T_DKIM_INVALID
 autolearn=disabled version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:53216)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <phillip.lord@HIDDEN>)
 id 1cDdnb-0007vN-HX
 for submit <at> debbugs.gnu.org; Sun, 04 Dec 2016 15:54:15 -0500
Received: from eggs.gnu.org ([2001:4830:134:3::10]:60578)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <phillip.lord@HIDDEN>) id 1cDdna-0002K5-DB
 for bug-gnu-emacs@HIDDEN; Sun, 04 Dec 2016 15:54:15 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <phillip.lord@HIDDEN>) id 1cDdnV-0007um-JX
 for bug-gnu-emacs@HIDDEN; Sun, 04 Dec 2016 15:54:14 -0500
Received: from mailgw.mycpanelcloud.co.uk ([185.116.214.213]:28432)
 by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <phillip.lord@HIDDEN>)
 id 1cDdnV-0007rm-8w
 for bug-gnu-emacs@HIDDEN; Sun, 04 Dec 2016 15:54:09 -0500
Received: from mailgw.mycpanelcloud.co.uk (localhost [127.0.0.1])
 by mailgw.mycpanelcloud.co.uk (Postfix) with ESMTP id B74AAC46B6
 for <bug-gnu-emacs@HIDDEN>; Sun,  4 Dec 2016 21:53:09 +0000 (GMT)
X-Virus-Scanned: by SpamTitan at mycpanelcloud.co.uk
Received: from mailgw.mycpanelcloud.co.uk (localhost [127.0.0.1])
 by mailgw.mycpanelcloud.co.uk (Postfix) with ESMTP id DFDBFC445E
 for <bug-gnu-emacs@HIDDEN>; Sun,  4 Dec 2016 21:53:08 +0000 (GMT)
Received: from cloud103.planethippo.com (cloud103.planethippo.com
 [31.216.48.48])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (No client certificate requested)
 by mailgw.mycpanelcloud.co.uk (Postfix) with ESMTPS id D6596C4417
 for <bug-gnu-emacs@HIDDEN>; Sun,  4 Dec 2016 21:53:08 +0000 (GMT)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
 d=russet.org.uk; s=default; h=Content-Transfer-Encoding:Content-Type:
 MIME-Version:To:From:Subject:Date:Message-ID:Sender:Reply-To:Cc:Content-ID:
 Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc
 :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=qF/y+idlm+cA64TRgxGyU2RRuSl/3Q+xNMmbxJJ7kXA=; b=ZsXxa5W9AG6d0m+Svj2EMnRzY3
 G0hYkWb+qncT9kGHwm/ZsOxrC3CFS5E3VUMwT2i622mRuARK6lLsBe2/UGOJwXfeTYUG1n8zxY0QQ
 E4+88JZ2G3lcEzkSdqhT8PYuknXHS21B1i+6wVRlXFIxO6ahafdRszi6exVs+MyKfjwYguTSKYfG8
 nkGIEODIPcPiOisBkI80QFyXg1QIzE8iQGIv2BI0Cc53xQjLjZC2vkV6KO0mYN8eIGUiht9JZyqWt
 aLaANqe2NWD1KXsGQXvolsZ3uWwK9Ro+yzN8l2Z2hbjAvXen8V7rYxYUzUoMoB3+XMKlrDFsYgcqr
 ku/5bBZg==;
Received: from [127.0.0.1] (port=49121 helo=cloud103.planethippo.com)
 by cloud103.planethippo.com with esmtpa (Exim 4.87)
 (envelope-from <phillip.lord@HIDDEN>) id 1cDdmm-0022HK-PH
 for bug-gnu-emacs@HIDDEN; Sun, 04 Dec 2016 20:53:24 +0000
Received: from 77.103.60.43 ([77.103.60.43])
 (SquirrelMail authenticated user phillip.lord@HIDDEN)
 by cloud103.planethippo.com with HTTP; Sun, 4 Dec 2016 20:53:24 -0000
Message-ID: <f5f413ee50ce5808ca0e8597ce95cdc3.squirrel@HIDDEN>
Date: Sun, 4 Dec 2016 20:53:24 -0000
Subject: 
From: "Phillip Lord" <phillip.lord@HIDDEN>
To: bug-gnu-emacs@HIDDEN
User-Agent: SquirrelMail/1.5.2 [SVN]
MIME-Version: 1.0
Content-Type: text/plain;charset=utf-8
X-AntiAbuse: This header was added to track abuse,
 please include it with any abuse report
X-AntiAbuse: Primary Hostname - cloud103.planethippo.com
X-AntiAbuse: Original Domain - gnu.org
X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12]
X-AntiAbuse: Sender Address Domain - russet.org.uk
X-Get-Message-Sender-Via: cloud103.planethippo.com: authenticated_id:
 phillip.lord@HIDDEN
X-Authenticated-Sender: cloud103.planethippo.com: phillip.lord@HIDDEN
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: FreeBSD 8.x [fuzzy]
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 2001:4830:134:3::11
X-Spam-Score: -3.0 (---)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.0 (---)


The documentation for "modification-hooks" on overlays says:

     If these functions modify the buffer, they should bind
     =E2=80=98inhibit-modification-hooks=E2=80=99 to =E2=80=98t=E2=80=99 =
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 specbou=
nd
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 =E2=80=98inhibit-modification-hooks=E2=80=99 to =E2=80=
=98nil=E2=80=99.

which suggests that, in fact, it is possible to call the modification
hooks from inside another call to these functions.


This is true for both emacs-25 and master.





Acknowledgement sent to "Phillip Lord" <phillip.lord@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#25111; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Thu, 9 Mar 2017 19:45:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.