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#70541: track-changes-mode logs warnings (with input method, in Eglot buffer) Date: Wed, 24 Apr 2024 10:12:35 +0300 Message-ID: <86ttjr2pzw.fsf@gnu.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1488"; mail-complaints-to="usenet@ciao.gmane.io" Cc: rcopley@gmail.com, 70541@debbugs.gnu.org, joaotavora@gmail.com To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Apr 24 09:14:23 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 1rzWpj-0000AR-7A for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 24 Apr 2024 09:14:23 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rzWpH-0007lm-G4; Wed, 24 Apr 2024 03:13:55 -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 1rzWpG-0007lV-At for bug-gnu-emacs@gnu.org; Wed, 24 Apr 2024 03:13:54 -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 1rzWpG-0003ii-1n for bug-gnu-emacs@gnu.org; Wed, 24 Apr 2024 03:13:54 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rzWpW-00072u-97 for bug-gnu-emacs@gnu.org; Wed, 24 Apr 2024 03:14:10 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 24 Apr 2024 07:14:09 +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.171394283826973 (code B ref 70541); Wed, 24 Apr 2024 07:14:09 +0000 Original-Received: (at 70541) by debbugs.gnu.org; 24 Apr 2024 07:13:58 +0000 Original-Received: from localhost ([127.0.0.1]:56930 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rzWpB-00070B-Da for submit@debbugs.gnu.org; Wed, 24 Apr 2024 03:13:56 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46696) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rzWow-0006xE-On for 70541@debbugs.gnu.org; Wed, 24 Apr 2024 03:13:43 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rzWoW-0003f1-Ue; Wed, 24 Apr 2024 03:13:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=GiHqrLtMDFzhnbZ9M2wFJOFeMObRIM8da5hC21o7P7I=; b=JlGOD5JuW7Mhj8kso9d5 nMJZde1K2o1z/JH1t4eg5JQP/9KiY12QUpsvYU5bQklsV3TR4O/htsj1N9z7RDlPJArfpMBRElDCq gxAO97T2tMi4a9BXXXJebZCs2smDgNdlBuInVBXF1KU4ZXs3dIYlc5mcfT4Slb+vXm+a/aX4u3nL0 L95dFGmw5iiQdNPAgOqlK9PtUZFVOdF804jcuJeVkytfrfInWmD3LVtZQAIyoMpslreEgEa0uFaA5 6qkKcU09FsvC1Xs5tHxYxnxJOnhaq5AOxIZhj1GHWuwIZJsx3F/LeEq50wcvc3oxTnUX/fEDkOTwG 9xFhgVyZM3hcZw==; In-Reply-To: (bug-gnu-emacs@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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:283907 Archived-At: > Cc: 70541@debbugs.gnu.org, > João Távora > Date: Tue, 23 Apr 2024 23:14:16 -0400 > From: Stefan Monnier via "Bug reports for GNU Emacs, > the Swiss army knife of text editors" > > The problem is that Quail inserts an underlined `^` in the buffer to > show you the part of the input that's already been typed and it does so > stealthily (i.e. within `with-silent-modifications`), which implies that > the `before/after-change-functions` have not been called, and as > a consequence the size of the buffer is not the one that track-changes > expects (and the content of the buffer doesn't corresponds to what Eglot > will send to the LSP server based on the changes it has witnessed, > which can cause errors since Eglot has to send buffer positions and > those may not mean the same any more for the LSP server). > > I suggest the patch below (the second hunk is unrelated, I just bumped > into it while tracking this bug). Are you sure we want buffer-change hooks to be called here? Quail intentionally hides some of the modifications it does, because it many times replaces the inserted text with something else, and from the Emacs Lisp program's POV only the final input is the actual "insertion" Emacs should know about. So I'm not sure we should install this, as it could break something elsewhere. Aren't there any alternatives to this? More generally, why should Eglot care about these low-level details of Quail?