From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ihor Radchenko 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: Sat, 13 Nov 2021 22:43:17 +0800 Message-ID: <87sfw0glq2.fsf@localhost> References: <87mtmalrs1.fsf@localhost> <837dde200c.fsf@gnu.org> <87k0helmig.fsf@localhost> <831r3m1tpk.fsf@gnu.org> <8735o1r31q.fsf@localhost> <834k8hzi10.fsf@gnu.org> <87zgq9pmb6.fsf@localhost> <831r3lzfk4.fsf@gnu.org> <87wnldpk5x.fsf@localhost> <83zgq9xv1y.fsf@gnu.org> <87r1bkpgjw.fsf@localhost> <83pmr4xt4c.fsf@gnu.org> <87o86opa3j.fsf@localhost> <83k0hcxjju.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3941"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 51766@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Nov 13 15:42:29 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 1mluEe-0000ty-TY for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 13 Nov 2021 15:42:29 +0100 Original-Received: from localhost ([::1]:45816 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mluEd-00079J-Kn for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 13 Nov 2021 09:42:27 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:41068) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mluEE-00077O-Ls for bug-gnu-emacs@gnu.org; Sat, 13 Nov 2021 09:42:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:35271) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mluEE-00050k-Bd for bug-gnu-emacs@gnu.org; Sat, 13 Nov 2021 09:42:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mluEE-00077U-70 for bug-gnu-emacs@gnu.org; Sat, 13 Nov 2021 09:42:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Ihor Radchenko Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 13 Nov 2021 14:42: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.163681452027360 (code B ref 51766); Sat, 13 Nov 2021 14:42:02 +0000 Original-Received: (at 51766) by debbugs.gnu.org; 13 Nov 2021 14:42:00 +0000 Original-Received: from localhost ([127.0.0.1]:46817 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mluEC-00077E-CX for submit@debbugs.gnu.org; Sat, 13 Nov 2021 09:42:00 -0500 Original-Received: from mail-pj1-f54.google.com ([209.85.216.54]:55948) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mluEA-000771-8Z for 51766@debbugs.gnu.org; Sat, 13 Nov 2021 09:41:59 -0500 Original-Received: by mail-pj1-f54.google.com with SMTP id v23so9118544pjr.5 for <51766@debbugs.gnu.org>; Sat, 13 Nov 2021 06:41:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=laN2nZPljR3c3/mQEluY8eWtpKJoPnHi8KmlzZ0mUjo=; b=XldTVeqSIjkncGfL5U03acFXHazvTpx2gb/lSM2j9Gl2dvfbGj9WY3iS4NlD07wVhW yRmjIdZPjNKkoZFwYxlPzS7Og2YpJailh9s35vsY5uPxEygKpHg7Mitj0onoIEoe8MyB WxFL8Wb59uB9lq/9+3Sws5d1WeHP5//CgWLD1wbgXb6fN7lDMLI615OAQEJavKzHD7Na g7lsNL/yhSMi/xjAiYbhc13B6ReiIeGf+IznPNxLGY+MZhGrgM5exX/lXOF660vFoVGW /YLKOV9SP1NaCqpBJugYYNAZBelBe1x1hkFjLD5PGRINnZzZlc5HaCKgd5/rBz3dKpvy byGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=laN2nZPljR3c3/mQEluY8eWtpKJoPnHi8KmlzZ0mUjo=; b=FWKnELOTCNhdW7RNbCjJIEj2VN2/hMO5leFvD3IStn2N5ZV+OEdizlVXWkn//PKc1i v63ZueK90BEyQ2iTtQgWazx05Wqng2Snn/n/pCXtf075Xq2KarFAdHDyyppG0dw4LWxZ +V5zUiVABKV3tFwfiYl9N7aoY2/hpTlivxfcykg2QF6/Qd/QqUjq4iXeaJp5+aftFO5o qvYQQaxL3umIesoKFWmf0fADtFq1jD3ynkYOXU6SflaJNDzwil2bKXURjwF4QwrOBluv 0oRO7qQpUj8ebG40ijq4kKRwyIa+sCSjfB+M4bWAWZxUw1feLEplwkEgtCGexue47m18 kLrw== X-Gm-Message-State: AOAM533M8ED3mWbEkvf57PTqQbpFoNR/JMSIcJLfMn9YDnfMtkVEcGYM 7uBHhE6P+Hqucl8ODzDTmYv67FObhIHzZg== X-Google-Smtp-Source: ABdhPJwN/99VZwhvXDm4ZDiYxldzG9Z1PUdTidsSBaq6xB2JlfCCu85aOyYFM9fDiMh7bsoLF/4jXQ== X-Received: by 2002:a17:90b:4acd:: with SMTP id mh13mr46768549pjb.230.1636814512462; Sat, 13 Nov 2021 06:41:52 -0800 (PST) Original-Received: from localhost ([103.125.234.210]) by smtp.gmail.com with ESMTPSA id c20sm10886573pfl.201.2021.11.13.06.41.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 13 Nov 2021 06:41:51 -0800 (PST) In-Reply-To: <83k0hcxjju.fsf@gnu.org> 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:219813 Archived-At: Eli Zaretskii writes: >> Not exactly. Org uses modification hooks as the only mechanism to >> process buffer changes because Org needs to know the region where the >> buffer text changes. buffer-chars-modified-tick is used for error >> detection - when buffer text is changed, but Org modification hooks are >> not called for some reason. quail triggers false positives during the error >> detection. > > Is that any different from what I said, which is that you need error > detection only when the modification hooks are not called? And that > the quail behavior is only the issue when using this error detection, > i.e. when the modification hooks are not called? Your understanding is correct. >> It seems that we have some misunderstanding here. Org does not care >> about the value of buffer-chars-modified-tick - just whether >> buffer-chars-modified-tick is changed or not (see the above). > > But if buffer-modified-tick completely explains the change in > buffer-chars-modified-tick, you can conclude that > buffer-chars-modified-tick didn't change for your purposes, and then > all's well, no? I looked into it again and tried to play with non-cyrillic input looking at the values of buffer-chars-modified-tick and buffer-modified-tick. You are right, there seems to be a special relation between the values when I use non-latin input method (buffer-chars-modified-tick=buffer-modified-tick). Thanks! However, I am not sure if equality of the chars-modified-tick and modified-tick is unique to non-changing edits. Can test in the wild though. > So what does Org do if the modification hooks were not called, and > buffer-chars-modified-tick says the text was changed? The cache is potentially invalid, so it is dropped altogether by org-element-cache-reset. >> > But Org is not interested in just any moidification, AFAIU. It is >> > only interested in modifications that change the buffer text. Isn't >> > that true? Or what else is Org interested in for this purpose. >> >> You are right. Org is interested in modifications that change buffer >> text. Also, Org is interested to be not affected by >> inhibit-modification-hooks. > > Then maybe this is the missing infrastructure you'd like to see > implemented. Yes, I think. In practical terms, it may something like a new pair of hooks: before/after-change-no-inhibit-functions. The hooks work exactly like before/after-change-functions, but cannot be suppressed by let-binding inhibit-modification-hooks and before/after-change-functions. If necessary they can still be explicitly let-bound to nil, but it should be discouraged. WDYT? Best, Ihor