From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Karl Fogel Newsgroups: gmane.emacs.devel Subject: Re: Detect all changes in a buffer Date: Fri, 15 Jul 2016 16:07:03 -0500 Message-ID: <87r3autxu0.fsf@red-bean.com> References: Reply-To: Karl Fogel NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1468630459 28592 80.91.229.3 (16 Jul 2016 00:54:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 16 Jul 2016 00:54:19 +0000 (UTC) Cc: emacs-devel@gnu.org To: Lars Tveito Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jul 16 02:54:10 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1bODr2-0007pf-0E for ged-emacs-devel@m.gmane.org; Sat, 16 Jul 2016 02:53:16 +0200 Original-Received: from localhost ([::1]:34963 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bOAKk-00015G-IZ for ged-emacs-devel@m.gmane.org; Fri, 15 Jul 2016 17:07:42 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60132) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bOAKD-00014e-9a for emacs-devel@gnu.org; Fri, 15 Jul 2016 17:07:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bOAKA-0005ZN-2L for emacs-devel@gnu.org; Fri, 15 Jul 2016 17:07:09 -0400 Original-Received: from mail-it0-x22b.google.com ([2607:f8b0:4001:c0b::22b]:38287) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bOAK9-0005ZI-Ug for emacs-devel@gnu.org; Fri, 15 Jul 2016 17:07:06 -0400 Original-Received: by mail-it0-x22b.google.com with SMTP id h190so29530186ith.1 for ; Fri, 15 Jul 2016 14:07:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:references:reply-to:date:in-reply-to :message-id:user-agent:mime-version; bh=CjihPX6D02IPIwi5/5LO8J+cxzVKgg+dqA5XBl1lXlQ=; b=eum8njcqVQ+GjIVqk+UMc9cM9OdajWPc0bORId2uxIWDMWrtMAFecHlrzH6/SBQShC uYnq7mJeLFjR8k/Y8+r+w9VLQRVwyabZOdEGdafv/UWMAe8h8O99lRDmMKRNyUcEyw0L F33uqwxPdV9S41r9IeVxmnqalqdQhYkafAh2N2sapa8ultbj7qvMVKspFLmS0raqS6h8 7csRUUe+66ZDfnb1iYak9iVhshI7vGzGURdXb/nUsYx2waIKypVR7XjAkf9wvPtRDauC S4o1ALz3HFm62oQdOUbOhl690r/sf37T4II6CR9pAq0tYICUZCEaDIHOmVAh4OWcLB9g AUcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:references:reply-to :date:in-reply-to:message-id:user-agent:mime-version; bh=CjihPX6D02IPIwi5/5LO8J+cxzVKgg+dqA5XBl1lXlQ=; b=aH2vuQWbtZvmCfTIQcU3KmMwMDFpPqHLEeba0LGHLseJ1HVohm/yjz4imXWDbC90mO s8SvvB1FCh9wd7RZpgfbXZs0pYaexnm4TK0ZT9gbGQ7bAIntWqlDb4ZytNFU8NOl6t44 4H2Zj+LKClLsbHz1KG7/QB7v38MhPbCHFetx3W7eYgCv4MsrfLWrhfw0a66QmBcWoX5T uoVAO2F7Ai6Em6iTgmeOUvbelEMOCulnxY/EWqitb+Tj3w0uvaBKvIIkkOOAksrCWItd BuD/WQw3yDe5ZpeMpp2XL9KD2aqEWhEKSnWb+7QIEqGwCv62W2gTsbbDs0gaUtkTWD+e ytsw== X-Gm-Message-State: ALyK8tLmkwkRBHwp0aNqDBQgRsyLCTazdzDLUTC2wzyzSvDHM5nF8VOMGKrOr686i1bhZQ== X-Received: by 10.36.26.194 with SMTP id 185mr38868190iti.28.1468616825236; Fri, 15 Jul 2016 14:07:05 -0700 (PDT) Original-Received: from floss (74-92-190-114-Illinois.hfc.comcastbusiness.net. [74.92.190.114]) by smtp.gmail.com with ESMTPSA id d15sm183308itb.12.2016.07.15.14.07.04 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 15 Jul 2016 14:07:04 -0700 (PDT) In-Reply-To: (Lars Tveito's message of "Fri, 15 Jul 2016 18:37:35 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:4001:c0b::22b X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:205742 Archived-At: Lars Tveito writes: >I am developing a minor mode that enables real-time collaboration. I >wish to detect /all/ changes made to a buffer. So far I'm using >`before-change-functions' to detect deletions and >`after-change-functions' to detect insertions. You might already know about these, but just in case: There was some work on this in the past -- the effort I remember was based on a collaboration protocol called "Obby", but now that I look at https://www.emacswiki.org/emacs/CollaborativeEditing I see there were some other efforts as well. I don't know if anything there would save you time, but wanted to point it out just in case. (You raise a good question about `inhibit-modification-hooks', and I don't know the answer to it.) Best regards, -Karl >The problem is that some functions utilizes >`inhibit-modification-hooks', even though they make changes to the >buffer. An example is `eshell-send-input'. > >The first question is whether you have any suggestions as to how to get >around this? The second is whether it is considered OK for functions to >use this hook even though the function makes changes to the buffer? The >documentation for change hooks states "These hook variables let you >arrange to take notice of all changes in all buffers" which is not >really true if changes are done whilst `inhibit-modification-hooks' is >non-nil. > >- Lars