From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: phillip.lord@russet.org.uk (Phillip Lord) Newsgroups: gmane.emacs.bugs Subject: bug#25111: Date: Sun, 11 Dec 2016 22:11:14 +0000 Message-ID: <878trmxgjh.fsf@russet.org.uk> References: <8360myl7ay.fsf@gnu.org> <87wpfbpual.fsf@russet.org.uk> <83eg1iiffm.fsf@gnu.org> <87pol1kon4.fsf@russet.org.uk> <83bmwlggix.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1481494343 25024 195.159.176.226 (11 Dec 2016 22:12:23 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 11 Dec 2016 22:12:23 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) Cc: 25111@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Dec 11 23:12:17 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 1cGCLv-0005Wl-7o for geb-bug-gnu-emacs@m.gmane.org; Sun, 11 Dec 2016 23:12:15 +0100 Original-Received: from localhost ([::1]:57324 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cGCLz-0007gv-FH for geb-bug-gnu-emacs@m.gmane.org; Sun, 11 Dec 2016 17:12:19 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45872) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cGCLm-0007gV-9e for bug-gnu-emacs@gnu.org; Sun, 11 Dec 2016 17:12:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cGCLi-0002hu-8w for bug-gnu-emacs@gnu.org; Sun, 11 Dec 2016 17:12:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:51335) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cGCLi-0002hi-1T for bug-gnu-emacs@gnu.org; Sun, 11 Dec 2016 17:12:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cGCLh-0002NV-Na for bug-gnu-emacs@gnu.org; Sun, 11 Dec 2016 17:12:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: phillip.lord@russet.org.uk (Phillip Lord) Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 11 Dec 2016 22:12:01 +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.14814942899100 (code B ref 25111); Sun, 11 Dec 2016 22:12:01 +0000 Original-Received: (at 25111) by debbugs.gnu.org; 11 Dec 2016 22:11:29 +0000 Original-Received: from localhost ([127.0.0.1]:38501 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cGCLA-0002Mh-Sa for submit@debbugs.gnu.org; Sun, 11 Dec 2016 17:11:29 -0500 Original-Received: from mailgw.mycpanelcloud.co.uk ([185.116.214.205]:36873) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cGCL8-0002MT-D2 for 25111@debbugs.gnu.org; Sun, 11 Dec 2016 17:11:28 -0500 Original-Received: from mailgw.mycpanelcloud.co.uk (localhost [127.0.0.1]) by mailgw.mycpanelcloud.co.uk (Postfix) with ESMTP id 97BEFC4702 for <25111@debbugs.gnu.org>; Sun, 11 Dec 2016 23:11:03 +0000 (GMT) X-Virus-Scanned: by SpamTitan at mycpanelcloud.co.uk Original-Received: from mailgw.mycpanelcloud.co.uk (localhost [127.0.0.1]) by mailgw.mycpanelcloud.co.uk (Postfix) with ESMTP id 9915BC4666 for <25111@debbugs.gnu.org>; Sun, 11 Dec 2016 23:10:59 +0000 (GMT) Original-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@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==; Original-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 ) id 1cGCKy-001MBf-2r; Sun, 11 Dec 2016 22:11:16 +0000 In-Reply-To: <83bmwlggix.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 09 Dec 2016 19:26:46 +0200") 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@russet.org.uk X-Authenticated-Sender: cloud103.planethippo.com: phillip.lord@russet.org.uk 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:126889 Archived-At: Eli Zaretskii writes: >> From: phillip.lord@russet.org.uk (Phillip Lord) >> Cc: 25111@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