From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#70541: track-changes-mode logs warnings (with input method, in Eglot buffer) Date: Mon, 29 Apr 2024 16:27:42 -0400 Message-ID: References: <86ttjr2pzw.fsf@gnu.org> <86edau3gyy.fsf@gnu.org> <8634ra36ny.fsf@gnu.org> <861q6ou2cs.fsf@gnu.org> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19144"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: rcopley@gmail.com, 70541@debbugs.gnu.org, Eli Zaretskii To: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Apr 29 22:32:07 2024 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 1s1XfS-0004ks-EL for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 29 Apr 2024 22:32:06 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s1Xf6-0004KC-C8; Mon, 29 Apr 2024 16:31:44 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s1Xf3-0004JA-Ql for bug-gnu-emacs@gnu.org; Mon, 29 Apr 2024 16:31:42 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s1Xf3-0001iU-HY for bug-gnu-emacs@gnu.org; Mon, 29 Apr 2024 16:31:41 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1s1XfN-0002ok-LD for bug-gnu-emacs@gnu.org; Mon, 29 Apr 2024 16:32:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 29 Apr 2024 20:32:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70541 X-GNU-PR-Package: emacs Original-Received: via spool by 70541-submit@debbugs.gnu.org id=B70541.171442267310820 (code B ref 70541); Mon, 29 Apr 2024 20:32:01 +0000 Original-Received: (at 70541) by debbugs.gnu.org; 29 Apr 2024 20:31:13 +0000 Original-Received: from localhost ([127.0.0.1]:58742 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s1Xeb-0002oS-5L for submit@debbugs.gnu.org; Mon, 29 Apr 2024 16:31:13 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:59327) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s1XeX-0002oM-Dt for 70541@debbugs.gnu.org; Mon, 29 Apr 2024 16:31:11 -0400 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 6E19280A6A; Mon, 29 Apr 2024 16:30:43 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1714422642; bh=RuMnQMHNZC/i+MaFXh/1JywUpfuYCn2pgMZN6lfo8Ug=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=eTJh2ERihztAd8KmJpuYhlOlEq88H4vcE3Fi0Omxs+rbjCt0QYvOL7TPgCge+rIZ2 4MXiv5/IVgH2wQfU7lJytwBtLeFVtXE9SsaUOwZOmK6RFwH03yBLIMc1nfMJqkZny5 hquS869TnwEbcW5bzyw49Agc7o8XVTuT+8pwxWFtpz2byj+y8m9JvykdI08i9kVfNs ubWCvcCMZJbEjtwqvlWIo6fmImcB0ZM27NNNU8wJ9KxwaPCrnqzYTgJgvDhZ9BRms/ 7n2eK1Pxs8O8rEj8X0QqZPWs5roqVQeKxeJ94ij3/YvsOW4Tu0AIZUBofm4sf4e2JK dEziaN+7AQdrg== Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 3C874806AA; Mon, 29 Apr 2024 16:30:42 -0400 (EDT) Original-Received: from lechazo (lechon.iro.umontreal.ca [132.204.27.242]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 2DF9B120250; Mon, 29 Apr 2024 16:30:42 -0400 (EDT) In-Reply-To: ("=?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?="'s message of "Mon, 29 Apr 2024 09:28:47 +0100") 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:284176 Archived-At: > This idea is good, if I understand it correctly, though I would > prefer if Eglot interfaced only with track-changes.el, and > it would tell it that it should momentarily halt reports > of changes to the server. I guess we could add a function `track-change-inconsistent-state-p` which Eglot could consult before calling `track-changes-fetch` and if that returns non-nil, Eglot could reschedule the update to "later". But that would just be a kludge usable by some packages like Eglot because they have the luxury to reschedule. For example, if some code is run (e.g. via font-lock) which uses `syntax-ppss` while Quail's extra chars are inserted, then `syntax-ppss` can't reschedule, and it may record the resulting state in its cache after which `inhibit-modification-hooks` may in turn prevent the cache from being properly flushed when Quail removes its extra chars. Removing the `inhibit-modification-hooks` would be a much cleaner solution. I asked Kenichi why he added that binding (back in 2005), but he hasn't replied yet. > Can someone clarify in a simple example exactly what Eglot tells > the LSP server as someone is inputting something with the Quail. > I need to understand exactly where the "lie" is happening. Here's the scenario: the user wants to insert `x=E1=B5=83` using the TeX in= put method (the same problem can occur with other methods, of course), so Emacs will receive the following inputs: x ^ a but let's assume the user pauses between `^` and `a`. At this point, the `before/after-change-functions` have been called to announce the insertion of `x` and nothing more, but the buffer also has an (unannounced) `^` inserted at point. So the buffer's content as seen by `before/after-change-functions` (and hence by the LSP server) is out of sync because of this additional `^`. Since Quail does not call the `before/after-change-functions`, Eglot doesn't specifically send Quail's input to the LSP server: in the above scenario, `eglot--signal-textDocument/didChange` is called because the `before/after-change-functions` was called in response to the previous `x`. Stefan