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: Fri, 09 Dec 2016 17:17:51 +0000 Message-ID: <87pol1kon4.fsf@russet.org.uk> References: <8360myl7ay.fsf@gnu.org> <87wpfbpual.fsf@russet.org.uk> <83eg1iiffm.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1481304865 6551 195.159.176.226 (9 Dec 2016 17:34:25 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 9 Dec 2016 17:34:25 +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 Fri Dec 09 18:34:16 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 1cFP3i-0008Ed-8R for geb-bug-gnu-emacs@m.gmane.org; Fri, 09 Dec 2016 18:34:10 +0100 Original-Received: from localhost ([::1]:48013 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cFP3m-0007zG-Cu for geb-bug-gnu-emacs@m.gmane.org; Fri, 09 Dec 2016 12:34:14 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39071) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cFP3e-0007qW-11 for bug-gnu-emacs@gnu.org; Fri, 09 Dec 2016 12:34:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cFP3a-0004D3-3d for bug-gnu-emacs@gnu.org; Fri, 09 Dec 2016 12:34:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:49064) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cFP3Z-0004Ct-Ou for bug-gnu-emacs@gnu.org; Fri, 09 Dec 2016 12:34:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cFP3Z-0001t1-Hr for bug-gnu-emacs@gnu.org; Fri, 09 Dec 2016 12:34: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: Fri, 09 Dec 2016 17:34: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.14813048117098 (code B ref 25111); Fri, 09 Dec 2016 17:34:01 +0000 Original-Received: (at 25111) by debbugs.gnu.org; 9 Dec 2016 17:33:31 +0000 Original-Received: from localhost ([127.0.0.1]:36230 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cFP35-0001qM-5A for submit@debbugs.gnu.org; Fri, 09 Dec 2016 12:33:31 -0500 Original-Received: from mailgw.mycpanelcloud.co.uk ([185.116.214.125]:25085) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cFP32-0001q7-Qy for 25111@debbugs.gnu.org; Fri, 09 Dec 2016 12:33:29 -0500 Original-Received: from mailgw.mycpanelcloud.co.uk (localhost [127.0.0.1]) by mailgw.mycpanelcloud.co.uk (Postfix) with ESMTP id 388C2C40B9 for <25111@debbugs.gnu.org>; Fri, 9 Dec 2016 18:17:37 +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 B4BF7C41C6 for <25111@debbugs.gnu.org>; Fri, 9 Dec 2016 18:17:35 +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 A6E00C40C2 for <25111@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==; Original-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 ) id 1cFOnv-0007ze-Vl; Fri, 09 Dec 2016 17:17:52 +0000 In-Reply-To: <83eg1iiffm.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 08 Dec 2016 17:55:09 +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:126777 Archived-At: Eli Zaretskii writes: >> From: phillip.lord@russet.org.uk (Phillip Lord) >> Cc: 25111@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