From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#51766: 29.0.50; Return value of buffer-chars-modified-tick changes when buffer text is not yet changed before inserting a character for non-latin input methods Date: Fri, 12 Nov 2021 14:15:55 +0200 Message-ID: <834k8hzi10.fsf@gnu.org> References: <87mtmalrs1.fsf@localhost> <837dde200c.fsf@gnu.org> <87k0helmig.fsf@localhost> <831r3m1tpk.fsf@gnu.org> <8735o1r31q.fsf@localhost> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8565"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 51766@debbugs.gnu.org To: Ihor Radchenko Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Nov 12 13:17:14 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mlVUX-00021u-RZ for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 12 Nov 2021 13:17:14 +0100 Original-Received: from localhost ([::1]:41620 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mlVUW-0001Cm-NR for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 12 Nov 2021 07:17:12 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:50658) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mlVUM-0001CU-Sl for bug-gnu-emacs@gnu.org; Fri, 12 Nov 2021 07:17:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:60338) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mlVUM-0007eU-Km for bug-gnu-emacs@gnu.org; Fri, 12 Nov 2021 07:17:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mlVUM-0004Ll-9y for bug-gnu-emacs@gnu.org; Fri, 12 Nov 2021 07:17: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: Fri, 12 Nov 2021 12:17:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 51766 X-GNU-PR-Package: emacs Original-Received: via spool by 51766-submit@debbugs.gnu.org id=B51766.163671938316669 (code B ref 51766); Fri, 12 Nov 2021 12:17:02 +0000 Original-Received: (at 51766) by debbugs.gnu.org; 12 Nov 2021 12:16:23 +0000 Original-Received: from localhost ([127.0.0.1]:43651 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mlVTj-0004Kn-Ac for submit@debbugs.gnu.org; Fri, 12 Nov 2021 07:16:23 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:49782) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mlVTf-0004KY-Id for 51766@debbugs.gnu.org; Fri, 12 Nov 2021 07:16:22 -0500 Original-Received: from [2001:470:142:3::e] (port=56896 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mlVTa-0007V3-Cu; Fri, 12 Nov 2021 07:16:14 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=nZFkcptkVnDk4Tn9xgxCv2vMXTwo89/u99Ho6uEY96U=; b=kQTqOqW1I6o5 nFLio8WsRRFVE8NVkP6oV4Q15tYAbaKJpMxjKfVufZZV/rLC92sF6JCazZyIrChvaw50NgYkNgipM 2UcmqlUle5YCvlxSjfLkurvOB9x0shRlmmdgJGS4uXNlE1DtSbQzobCWvuW8qV5VjoXuk+M2hC66c HlEdolGDmtd6O59EmIDsKYYz7N0bwmGUJ3ffn6lofCq7ehgxf5OohshChdft0vOyJ65gU1k3gHiuT Fvh0ipOtlL3/YdGVAMxgSANz7fO9UjF69r/GXUUNKzfApDopABIpKSpDVE/EVI43wcdR+dzzwHmQu DSBzOy6O61VtW5tOGRjQcw==; Original-Received: from [87.69.77.57] (port=4339 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mlVTZ-00027H-Vr; Fri, 12 Nov 2021 07:16:14 -0500 In-Reply-To: <8735o1r31q.fsf@localhost> (message from Ihor Radchenko on Fri, 12 Nov 2021 20:06:41 +0800) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:219765 Archived-At: > From: Ihor Radchenko > Cc: 51766@debbugs.gnu.org > Date: Fri, 12 Nov 2021 20:06:41 +0800 > > Org has a caching mechanism (org-element-cache) that keeps parsed buffer > representation in memory and updates it on the fly as the buffer > changes. To make the mechanism work, Org must keep track of all the > changes in buffer and update the affected Org elements in memory. > Naturally, this is done using before/after-change-functions. > > However, some third-party code carelessly uses > inhibit-modification-hooks and some edits may be missed by element > cache. If we just ignore the possibility of such edits, cache can be > broken badly. So, there is currently a control code that detects if > buffer has been changed outside the Org's change functions. The control > code uses buffer-chars-modified-tick. > > The behaviour of quail.el makes the control code useless - > buffer-chars-modified-tick can no longer be reliably used to detect > unfavourable "stealthy" changes. This last part I don't think I understand: why does quail's behavior make the control code useless? The value returned by buffer-chars-modified-tick still increases in your recipe, so what exactly is the aspect of that behavior that makes the control code useless? I think some additional details here are missing from your description which could explain the issue. > > quail.el inhibit buffer modifications in places, since otherwise you'd > > have too many of them. It wants to pretend that just one character > > was inserted. > > I understand the idea behind suppressing the modification hooks by > quail. Though it would be helpful if before-change-functions were called > before inserting+deleting a character by quail is done. I don't understand this, either. Are you saying that inserting a character via an input method doesn't call buffer-modification hooks even once? If the hooks are called, then what exactly is the problem with the hooks in this scenario?