From unknown Tue Jun 17 22:28:12 2025 X-Loop: help-debbugs@gnu.org Subject: bug#78530: 31.0.50; [PATCH] eglot-code-action-suggestion doesn't call the callback function in the original buffer Resent-From: Yuan Fu Original-Sender: "Debbugs-submit" Resent-CC: joaotavora@gmail.com, bug-gnu-emacs@gnu.org Resent-Date: Wed, 21 May 2025 07:43:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 78530 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: 78530@debbugs.gnu.org Cc: joaotavora@gmail.com X-Debbugs-Original-To: Bug Report Emacs X-Debbugs-Original-Xcc: joaotavora@gmail.com Received: via spool by submit@debbugs.gnu.org id=B.17478133709062 (code B ref -1); Wed, 21 May 2025 07:43:02 +0000 Received: (at submit) by debbugs.gnu.org; 21 May 2025 07:42:50 +0000 Received: from localhost ([127.0.0.1]:44032 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uHe6D-0002M6-Jz for submit@debbugs.gnu.org; Wed, 21 May 2025 03:42:49 -0400 Received: from lists.gnu.org ([2001:470:142::17]:48418) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uHe68-0002LM-6v for submit@debbugs.gnu.org; Wed, 21 May 2025 03:42:47 -0400 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 1uHe62-0003Rv-Ee for bug-gnu-emacs@gnu.org; Wed, 21 May 2025 03:42:38 -0400 Received: from mail-pf1-x42b.google.com ([2607:f8b0:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uHe60-0002xo-OK for bug-gnu-emacs@gnu.org; Wed, 21 May 2025 03:42:38 -0400 Received: by mail-pf1-x42b.google.com with SMTP id d2e1a72fcca58-73c17c770a7so7004511b3a.2 for ; Wed, 21 May 2025 00:42:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1747813355; x=1748418155; darn=gnu.org; h=to:date:message-id:subject:mime-version:from:from:to:cc:subject :date:message-id:reply-to; bh=0o+uWU1d/sZZb7Z0d/o/b1GOndnb6WMTqcIe0fbZnuY=; b=SuH/8dsSQG1G9+WMcqSAdtDG765z3/Nqv0zGpW7n+hvMjenmLzv50fyK2uRpG993oS GMFu/v/+kXnadgNx2IN4A66ZeEUYWKYZrdWc/QpACUaQcowLioOQKhNO6iPLl5M8Uu9e kXOew6chcSQ2aGeXxaci3NCgE2PysmX6U/b2g7EuX65/Yg1c83zYBUVZ6RPTRRezcjvm 885K+ouPKCFM3iv1aOM6mcYKFILl8qYN8qEKJkjrbG1ouUWqC8E8vyTGgRAMi89juYO+ xG2H5EZJ8Q+BsXKpb4GQ6SNnjeYCUg3EeIWP8OcUTsf/Ou7N4t7LmpH+2Uv7rjQfgO82 HlsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747813355; x=1748418155; h=to:date:message-id:subject:mime-version:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=0o+uWU1d/sZZb7Z0d/o/b1GOndnb6WMTqcIe0fbZnuY=; b=xURjZn7LoiERsjO83321b+gDbUWCSXNBmntAKybBWYeYJ9kevEKRMEWFUrrr+dTMNk cFDhasaLcMj5OFZRQyXkb8Szws59gtXTZ3kYkzoAEnwN7a8mcUVPuF9RoPF8uemdLsBG gGbq+5wKAS/aejlYEJq5KvY4MVZVgMtJ3XVMeSPMir/IxgjjrHa5BpnIssWP5JbS5U0H F5Q1AGqhD2QQRSKiGhhe73zrjQ/2yeLxtRIlLXW7yjOphry3ChQAiQ8ziHcPnZ7PNWR4 y4ujZb7ULTii1CkPYji0lCynM/C9Jv2dEvTJ2P+9Ua5UsXPGVFnyYrJPLg7SUiW4a6Bh 1EYg== X-Gm-Message-State: AOJu0YyAtp5A8VOdZaAfpdqFceVUHVwbSiYfFcMLzbGbvGd0nFc7m5q4 tyMT2iUTASyG78wHSe6WNbZYQXDvYrO/j3NpYAd/0fV6RI942USifcbwiMICkQ== X-Gm-Gg: ASbGnctO+D8nvVXyKMP+n1yP58hj48AgqTEjXFvES+zUkeYacNLc6KbwabYboFv+H42 gQQWV1daTJILxK92HpAqA8GNzM8cY5DRmr1bWCwAnlmw222mC0qzOBFSb7FSE854LlV+NROreAJ 32TngiqWVDga3mnLvbrKQASWgBkXXRB5sbM0oCJ6H5u86csUVHLY+oBXcI6CXBndQBbg76Ft8EL mLNnY8nXQiEZF0P3G0lvtr/+Wv76xXSWfLWASOj074t5xcb5io1P2G4J4Z2dKOtRhC+OHpBMXFw ZKBIdn1wtlWcpSdFF32XD4q7GzyaFjF7V2rI7IuRN4pPDSIxAGuNkqhE4MOXcqMH6pD1/MvlTWI 2qVHP2kQyj+odr1J6dZj1BG2PtXAyMy5QfT4= X-Google-Smtp-Source: AGHT+IGQEACzDc9CxBxuW5xb7jUgjeY/hDCiVqiqYpANQ+TcRVWQIp762NLhUxp2XVFbaDOSaPLb3w== X-Received: by 2002:a05:6a21:103:b0:1fe:90c5:7d00 with SMTP id adf61e73a8af0-216219c82fcmr33211518637.28.1747813353393; Wed, 21 May 2025 00:42:33 -0700 (PDT) Received: from smtpclient.apple (c-24-4-247-194.hsd1.ca.comcast.net. [24.4.247.194]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-231d4adb3a2sm87530775ad.57.2025.05.21.00.42.32 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 21 May 2025 00:42:32 -0700 (PDT) From: Yuan Fu Content-Type: multipart/mixed; boundary="Apple-Mail=_E636F0BA-AD06-41F0-9B31-BEEC4A5D7D94" Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.500.181.1.5\)) Message-Id: Date: Wed, 21 May 2025 00:42:21 -0700 X-Mailer: Apple Mail (2.3826.500.181.1.5) Received-SPF: pass client-ip=2607:f8b0:4864:20::42b; envelope-from=casouri@gmail.com; helo=mail-pf1-x42b.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, FREEMAIL_REPLY=1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: 1.0 (+) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) --Apple-Mail=_E636F0BA-AD06-41F0-9B31-BEEC4A5D7D94 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 X-Debbugs-CC: joaotavora@gmail.com Copying from the commit message: Some minor modes adds their own eldoc display function to 'eldoc-display-functions' hook buffer-locally. So when eldoc uses 'eldoc-display-functions' to display docs, it should use the buffer-local value of the hook. In 'eldoc--invoke-strategy', the code that runs 'eldoc-display-functions' hook is wrapped in a callback function that eventually gets passed to each documentation function in 'eldoc-documentation-functions'. So now it's the documentation functions' responsibility to call the eldoc callback in the original buffer. All the eglot documentation functions indeed do that, using 'eglot--when-buffer-window' to switch to the original buffer when calling the eldoc callback. Except for 'eglot-code-action-suggestion'. This patch fixes that. This bug was originally reported on eldoc-box [1]. The user found that eldoc-box's display function are rarely used, while the minor mode is turned on. This patch fixes the issue. [1] = https://github.com/casouri/eldoc-box/issues/126#issuecomment-2896611278 I think we should fix the eldoc callback function so it always uses the hook value of the hook in the original buffer; at the very least we should document the pitfall in the docstring of eldoc-documentation-functions. Jo=C3=A3o, WDYT? Yuan --Apple-Mail=_E636F0BA-AD06-41F0-9B31-BEEC4A5D7D94 Content-Disposition: attachment; filename=eglot-code-action.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="eglot-code-action.patch" Content-Transfer-Encoding: quoted-printable =46rom=200a0a72d16b2508b629f1bda8caddac8844452707=20Mon=20Sep=2017=20= 00:00:00=202001=0AFrom:=20Yuan=20Fu=20=0ADate:=20Wed,=20= 21=20May=202025=2000:23:15=20-0700=0ASubject:=20[PATCH]=20Make=20= eglot-code-action-suggestion=20call=20callback=20in=20orig=0A=20buffer=0A= =0ASome=20minor=20modes=20adds=20their=20own=20eldoc=20display=20= function=20to=0A'eldoc-display-functions'=20hook=20buffer-locally.=20=20= So=20when=20eldoc=0Auses=20'eldoc-display-functions'=20to=20display=20= docs,=20it=20should=20use=0Athe=20buffer-local=20value=20of=20the=20= hook.=0A=0AIn=20'eldoc--invoke-strategy',=20the=20code=20that=20runs=0A= 'eldoc-display-functions'=20hook=20is=20wrapped=20in=20a=20callback=20= function=0Athat=20eventually=20gets=20passed=20to=20each=20documentation=20= function=20in=0A'eldoc-documentation-functions'.=20So=20now=20it's=20the=20= documentation=0Afunctions'=20responsibility=20to=20call=20the=20eldoc=20= callback=20in=20the=0Aoriginal=20buffer.=0A=0AAll=20the=20eglot=20= documentation=20functions=20indeed=20do=20that,=20using=0A= 'eglot--when-buffer-window'=20to=20switch=20to=20the=20original=20buffer=20= when=0Acalling=20the=20eldoc=20callback.=20Except=20for=0A= 'eglot-code-action-suggestion'.=0A=0AThis=20patch=20fixes=20that.=0A=0A= This=20bug=20was=20originally=20reported=20on=20eldoc-box=20[1].=20The=20= user=0Afound=20that=20eldoc-box's=20display=20function=20are=20rarely=20= used,=20while=0Athe=20minor=20mode=20is=20turned=20on.=20This=20patch=20= fixes=20the=20issue.=0A=0A[1]=20= https://github.com/casouri/eldoc-box/issues/126#issuecomment-2896611278=0A= =0A*=20lisp/progmodes/eglot.el=20(eglot-code-action-suggestion):=20Move=0A= the=20funcall=20form=20into=20the=20eglot--when-buffer-window=20form.=0A= ---=0A=20lisp/progmodes/eglot.el=20|=204=20++--=0A=201=20file=20changed,=20= 2=20insertions(+),=202=20deletions(-)=0A=0Adiff=20--git=20= a/lisp/progmodes/eglot.el=20b/lisp/progmodes/eglot.el=0Aindex=20= 6f6b05a393d..5bb825189f2=20100644=0A---=20a/lisp/progmodes/eglot.el=0A= +++=20b/lisp/progmodes/eglot.el=0A@@=20-4168,8=20+4168,8=20@@=20= eglot-code-action-suggestion=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= 'display=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20`((margin=20= left-margin)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= ,tooltip)))))=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (setq=20eglot--suggestion-overlay=20ov)))))=0A-=20=20=20=20=20=20=20=20=20= (when=20use-text-p=20(funcall=20cb=20blurb)))=0A+=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20(setq=20eglot--suggestion-overlay=20ov))))=0A= +=20=20=20=20=20=20=20=20=20=20=20(when=20use-text-p=20(funcall=20cb=20= blurb))))=0A=20=20=20=20=20=20=20=20:hint=20:textDocument/codeAction)=0A=20= =20=20=20=20=20=20(and=20use-text-p=20t))))=0A=20=0A--=20=0A2.39.5=20= (Apple=20Git-154)=0A=0A= --Apple-Mail=_E636F0BA-AD06-41F0-9B31-BEEC4A5D7D94-- From unknown Tue Jun 17 22:28:12 2025 X-Loop: help-debbugs@gnu.org Subject: bug#78530: 31.0.50; [PATCH] eglot-code-action-suggestion doesn't call the callback function in the original buffer Resent-From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 21 May 2025 11:21:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 78530 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Yuan Fu Cc: 78530@debbugs.gnu.org Received: via spool by 78530-submit@debbugs.gnu.org id=B78530.174782641518912 (code B ref 78530); Wed, 21 May 2025 11:21:02 +0000 Received: (at 78530) by debbugs.gnu.org; 21 May 2025 11:20:15 +0000 Received: from localhost ([127.0.0.1]:46076 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uHhUc-0004ur-Mb for submit@debbugs.gnu.org; Wed, 21 May 2025 07:20:15 -0400 Received: from mail-oi1-x230.google.com ([2607:f8b0:4864:20::230]:44333) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1uHhUZ-0004pm-28 for 78530@debbugs.gnu.org; Wed, 21 May 2025 07:20:11 -0400 Received: by mail-oi1-x230.google.com with SMTP id 5614622812f47-400fa6eafa9so4958188b6e.1 for <78530@debbugs.gnu.org>; Wed, 21 May 2025 04:20:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1747826405; x=1748431205; darn=debbugs.gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=MU7O3KLVqs8MK4PnqcfpuGQ30W7h4hy1F9R7M5fTwGU=; b=T76bHv8eUty7HHI99zWmKRRmCNF0Q7s2wIYhSzx9gpU0NA8nyUpmtSxjf2HX2q8oi0 W9TLkfkJaFBOwSXiLF5KDlFgIUEE9z/Srm1CdTJ3kFXJHDQTtAyTYn1Ojof+4rkcYrh/ XeO8LoMVi9L1obc6/oletuZA/xfsYV6/zYmKXYteXXo9ii5hXZSHYFiP6J3EQA4+t7nS Lg+hZkT0XK/nmlfFtXpoBiDj0AysWNRLAvan0lGgAQLQULNLU9e6W/iBMug6arGKwKU0 xG1UMyRR1RXc83P97oUCyyBH33KQ2iQk+k3g/dwjF215AXkbszgTxcguvwuyRG/UHZAL 0o+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747826405; x=1748431205; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=MU7O3KLVqs8MK4PnqcfpuGQ30W7h4hy1F9R7M5fTwGU=; b=cLaD8Cgjvi0FpX5PyU6japx9PvhS18xt5WSuJzmT5eGSAj6XwqIirkw/+st8YkOSRx NiL3NteM92g0xzvHuC9bsXabzV0s5jCEuaCcRByPBGYBfBWCov29VIY2myMQ1dwYv6RQ 4HAdkaJYh5NImVeQ2ZuyNEh6FPt4vc+xzYkmq9oV3ZNlaMlwkh3eqDOWww4HSq36PdHE ogHtcSzxsS4hyiQ8/Cl93T/2LkCEskRRvNSW5tqO6/rzXwbNrQdSkLSh09iKnT5C6cua tSnQgpmYBDM9k8cMXLDWHoAJ9lZdQOOIE9stJbUtY4iUXF5k0rPPhrl/U8ndqUeMBNOG P1BQ== X-Gm-Message-State: AOJu0Yz+y0Tl4jx4jD20ufuXC/Jy5Jaz4OIIzs8+bYwV4QLR0JiAoJ0F PcDcnkHDD8GGErn8FTzf1rEQEArE89rRfZtbPMagNZJ+yd8WtfuCvqMnNYdDMHRC4dgbiTa9hdl EJk7jJxB6b1MQtAPYGY7Inj1QDCiIinc= X-Gm-Gg: ASbGncvbspp4YTV+T1OfcXPfnO01lRTX4RF76/eFybn8ByuX0klnoEcsk8p6JO3HTXR iAyEOACveADIwcDPuFgq+LoICQib27Cs0jQMihBDgeOdIrOS4CUYwHFSU4Z9cvNWGIKkWRUm7al ZzZ1zF/7wSEdZUWCoHigU2vYhN2xNReaA= X-Google-Smtp-Source: AGHT+IF5H9QKuwZAjvj1cYlV5cmJVbtXaa7q67GmpunzbxT/Axqw78k8YpDLdFrG3MH5en5WMxefm9XaUZ1fsTkrBUU= X-Received: by 2002:a05:6808:80c2:b0:404:e2fe:ee9b with SMTP id 5614622812f47-404e2fef081mr9352495b6e.15.1747826403318; Wed, 21 May 2025 04:20:03 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Date: Wed, 21 May 2025 12:20:39 +0100 X-Gm-Features: AX0GCFuqhsJVGD2eZvK4BMvYuLp6UM6ZmTBdia-psAxEWO-oC3CdOLsAVmJVev8 Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Good catch, good analysis and great commit message. Just please rename the subject line of the commit message to start with "Eglot: " if you can. Makes it easier to identify. For example= : Eglot: always call ElDoc callbacks in correct buffer Then add a reference to this bug#78530 and push at will. Jo=C3=A3o From unknown Tue Jun 17 22:28:12 2025 X-Loop: help-debbugs@gnu.org Subject: bug#78530: 31.0.50; [PATCH] eglot-code-action-suggestion doesn't call the callback function in the original buffer Resent-From: Yuan Fu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 22 May 2025 05:49:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 78530 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Cc: 78530@debbugs.gnu.org Received: via spool by 78530-submit@debbugs.gnu.org id=B78530.17478929153819 (code B ref 78530); Thu, 22 May 2025 05:49:01 +0000 Received: (at 78530) by debbugs.gnu.org; 22 May 2025 05:48:35 +0000 Received: from localhost ([127.0.0.1]:58460 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uHynD-0000zX-AT for submit@debbugs.gnu.org; Thu, 22 May 2025 01:48:35 -0400 Received: from mail-pg1-x536.google.com ([2607:f8b0:4864:20::536]:56755) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1uHynB-0000yj-P4 for 78530@debbugs.gnu.org; Thu, 22 May 2025 01:48:34 -0400 Received: by mail-pg1-x536.google.com with SMTP id 41be03b00d2f7-b1ff9b276c2so4526636a12.1 for <78530@debbugs.gnu.org>; Wed, 21 May 2025 22:48:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1747892907; x=1748497707; darn=debbugs.gnu.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=LnPvn3gP+/2ugJRq9Y7kzQpAXMIbXLwtefgof7+Qrqs=; b=GCxOFKBunFNWdTlOCjAOGUlh8d2uEc9pD00RRH/xU3wDBGdONbxR95Ro0+LRi/pcWg 71PGKDE6Rm2C0RZX1eOwQcuQlxZyDPhsytEvZikIrzKZ8lsH/k/cbKKq6TF19taRu4U9 2Vds0rRpB1mgH7Hx8vm3e3DZN0EPUBxuX811dLDV1OBARX3y7FOqdkk/jS/uBFBdYjLy ZLbiwOgjNcV8I3VgfyZ4GGQzQIbGopLZWeaegI5s213qNGw219+c2g/9eFZ7p0M64DMx /ZsHSmsmBCxpXs/hpGsTBzxXKz6BWkOyZIHwsCpDT7sZI1yEkYv057DpVXapKR2hAB45 7OhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747892907; x=1748497707; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=LnPvn3gP+/2ugJRq9Y7kzQpAXMIbXLwtefgof7+Qrqs=; b=Ou5ONZ3VuPUPbaLJ372CX8Z6GiGSYzA0+73jcCY2c+yp38gO+SRiEcCONLe6TEcgfm hoVLfiNB49FfYPOII7fxwAL2+j/6TIQYPU/S8Fs1zBsLeSWLjGzZEPK4NEDN8YMQuiGj LrfSsCucCnlSi49jp9/NiDMYnZEIPJkx1n0ksprbIJYl/MpvbZaNBVps/X9eMJf2AGWB zckac+SL5Ne+Ucl7NxFIgR4qDBKIaCoWj5hs7Z/CEHMZlZDsSYFca5vdX3ReVG6kc2d6 ZICKcUvlYGSOIlsQb/wQ2zG3rJ5CfIE7PsTL9cZ4/EiXfDBVXyA/x1k2A90qnYDwnDpk BpGw== X-Gm-Message-State: AOJu0Ywwi9aHtdoJ2TFGT/14QmRDoHijXDJMx3z64o6F8M5TurLCl5dj BmpkfBv283d27N+YynLsx0Inro4TursX6SFag1GtOX93kkfKFjnJPPVu X-Gm-Gg: ASbGncuHZ+WwxQdcZGGFjWuEApDHL9HoPWEUqFzn2fApDZYexBa21cYA7gQotzBo6Kr VGmFQ7NcZgtesJDFK9VKQdX2zVJDDVOktV+L1ZQOu1bhHz6a9qF4ThVNf69d3zoOkA2kv0yJd9J 1nDKD8Hb7KHhNC6aI+niX7ZkDiw/Pl2NEqA1j6Ux9nj0CBIjBJ3zTYHKBPsomdoWcZ8nwVM1sJW 2xrQlDt8NPKJwE1ZR0RiyOmdNpt0IvpxLX/PADTJDLzugBPElbLlWFbOFA0TU/p8xLPir/82UPF WK6764ThQ48V7e+WaEoL51+iH8XZIFLl34qvbhIPqmFB1MEhV51lavoZ0MK51H3bXmAOrOcyMIa y4xL9nvTPDZTBaPsanMNGe9L6buDczEwxZhU= X-Google-Smtp-Source: AGHT+IHaMWj/ER42t797pU5YGt9yMftgx4HgNgloVpPW5e6OmNcw7t3yoSh65j97xiqhJqRUNYngcg== X-Received: by 2002:a17:902:e5ca:b0:22e:3b65:9265 with SMTP id d9443c01a7336-231d43d5556mr267495675ad.8.1747892907459; Wed, 21 May 2025 22:48:27 -0700 (PDT) Received: from smtpclient.apple (c-24-4-247-194.hsd1.ca.comcast.net. [24.4.247.194]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-231d4ed1946sm101891625ad.217.2025.05.21.22.48.26 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 21 May 2025 22:48:26 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.500.181.1.5\)) From: Yuan Fu In-Reply-To: Date: Wed, 21 May 2025 22:48:15 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <4F379C8B-67B9-4156-B7F9-166102B0D355@gmail.com> References: X-Mailer: Apple Mail (2.3826.500.181.1.5) X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > On May 21, 2025, at 4:20=E2=80=AFAM, Jo=C3=A3o T=C3=A1vora = wrote: >=20 > Good catch, good analysis and great commit message. >=20 > Just please rename the subject line of the commit message to > start with "Eglot: " if you can. Makes it easier to identify. For = example: >=20 > Eglot: always call ElDoc callbacks in correct buffer >=20 > Then add a reference to this bug#78530 and push at will. Cool. And thanks for the commit title, I was struggling to come up with = a good one :) I pushed the fix. But we should also think about fixing = the root cause. For example, switching to the original buffer = temporarily when running =E2=80=98eldoc-display-functions=E2=80=99, like = what eglot documentation functions do already. WDYT? Yuan= From unknown Tue Jun 17 22:28:12 2025 X-Loop: help-debbugs@gnu.org Subject: bug#78530: 31.0.50; [PATCH] eglot-code-action-suggestion doesn't call the callback function in the original buffer Resent-From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 22 May 2025 09:30:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 78530 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Yuan Fu Cc: 78530@debbugs.gnu.org Received: via spool by 78530-submit@debbugs.gnu.org id=B78530.17479061527731 (code B ref 78530); Thu, 22 May 2025 09:30:02 +0000 Received: (at 78530) by debbugs.gnu.org; 22 May 2025 09:29:12 +0000 Received: from localhost ([127.0.0.1]:60017 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uI2Eh-00020c-HO for submit@debbugs.gnu.org; Thu, 22 May 2025 05:29:11 -0400 Received: from mail-oo1-xc30.google.com ([2607:f8b0:4864:20::c30]:45420) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1uI2Ed-0001zf-LA for 78530@debbugs.gnu.org; Thu, 22 May 2025 05:29:08 -0400 Received: by mail-oo1-xc30.google.com with SMTP id 006d021491bc7-60638c07cabso4363540eaf.3 for <78530@debbugs.gnu.org>; Thu, 22 May 2025 02:29:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1747906141; x=1748510941; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=2YNaTWmjyEUAEPqxLOiYHegtq6yI53csXSfNU7u+Z5Q=; b=gxS3Ulu3uwOznGjUpVZQ7ntUgeYjCHRzDVeblOYZr6WFjWxCFx+2bn3+BVAQRmz18z esvZjy35fKk302qtZddBFDVB7smveoAKFV9q7/TmD3siehuRv6eFX9kA4A2Y1wPqtsMu WM7AG5lYPSz1nR419aDswBKZA3ZM0G32C0hGj/O50eE47m/Yti6gj6pgKNm+mzX1C+Rf qQGb1yNbf7LQC0Yew5epY5GNBnCO3zvkF9Ayiri9/vr5bT4OqR7Y46Mw5w0c9FM/QdvR 2fSlws8560SDL0fh/JljmbYBnoi1ycA3fm0XV5ptDRgeQBsPTzmt8D1AZ8VF0H67bRPh Zguw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747906141; x=1748510941; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=2YNaTWmjyEUAEPqxLOiYHegtq6yI53csXSfNU7u+Z5Q=; b=VPc2FF8PET0i5fbiwcEMKL3Y4bssPiHuJBHjjs1kobhzaq3Yu0GcPW6oDlfHloVkvJ LUtWY2+NcS+IFIWOU2p4uqD9fCuvctapr+uv7HaoLt/gMEho1QhRFamifC8YaOaYiYeB lk2MDGBphfN49bkIJIyT+JBxn4yGdm8JxpRSUG7mCAAQcn1ijffJ8wIPSojw/v8ADZhI IgKVoK+d+Jth+e4SbkWZgFOCNhJkST1cV1UwZ+D4efXSxkiO8+McRRVQ0Fy4uujqORNL wq1TAc3p75kT7dH6jfoC+fJ3YDBr5LoZxfV/IfsaDtETKuh9rmcmhOZYFJqrPQT6aJRC diiw== X-Gm-Message-State: AOJu0YyhGNjSZ7T7XE236JMmP9lHtYUJzNCo+JKhsU/f0KV2MSlEYtK1 0AnFU+wCUeMW4HwYUJ3rBUeOrHnPfsw3A3RIPprPX5i+2iXJ9q9zuXypxV/J9wZ+oUCiguR3N9N gbCf1m7JHqEmFiGwtkIHWkAYsyyRl7rmxqQ== X-Gm-Gg: ASbGncubQFWm0xY7WQvLey9irgyW5WR2hsxTAbYcw0WKp8iCdzhS4zXzWv0bzfAnFkv 2Yo5TBvKK00pLGY7ZUD+KvKA9gzRziuSRARo9LS/nMM5Twnm+CWbK2K0oHjj54hHzcHMkLOPmhB RaxO0o5ypwo0S66xyBxkI6KDg9B48M2mo= X-Google-Smtp-Source: AGHT+IFIXigwpFJ0D6DUYF0RTSfC5M05+AFPVj+5+TMGtDBWlkSj5FXkn2vA4nair4fOa+imuOHy+cbmqklOtUIo68w= X-Received: by 2002:a05:6808:3192:b0:402:2a3:57ea with SMTP id 5614622812f47-404d86e65femr15404147b6e.18.1747906130052; Thu, 22 May 2025 02:28:50 -0700 (PDT) MIME-Version: 1.0 References: <4F379C8B-67B9-4156-B7F9-166102B0D355@gmail.com> In-Reply-To: <4F379C8B-67B9-4156-B7F9-166102B0D355@gmail.com> From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Date: Thu, 22 May 2025 10:28:38 +0100 X-Gm-Features: AX0GCFsGmcOa___-omEu_4dBjs1hVwgo8EGADas6DzUAKg_BA1Q-MCOqThhAmF8 Message-ID: Content-Type: multipart/alternative; boundary="000000000000fb8dde0635b61b5d" X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --000000000000fb8dde0635b61b5d Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Ok, To understand exactly what you mean, just show a patch to eldoc.el. Even though I'm not directly maintaining it anymore lately, I can look at it. Jo=C3=A3o T=C3=A1vora On Thu, May 22, 2025, 06:48 Yuan Fu wrote: > > > > On May 21, 2025, at 4:20=E2=80=AFAM, Jo=C3=A3o T=C3=A1vora wrote: > > > > Good catch, good analysis and great commit message. > > > > Just please rename the subject line of the commit message to > > start with "Eglot: " if you can. Makes it easier to identify. For > example: > > > > Eglot: always call ElDoc callbacks in correct buffer > > > > Then add a reference to this bug#78530 and push at will. > > Cool. And thanks for the commit title, I was struggling to come up with a > good one :) I pushed the fix. But we should also think about fixing the > root cause. For example, switching to the original buffer temporarily whe= n > running =E2=80=98eldoc-display-functions=E2=80=99, like what eglot docume= ntation functions > do already. WDYT? > > Yuan --000000000000fb8dde0635b61b5d Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Ok,=C2=A0

To understand exactly what you mean, just show a patch to eldoc.e= l. Even though I'm not directly maintaining it anymore lately, I can lo= ok at it.=C2=A0

Jo=C3=A3o T=C3=A1vora

On Thu, May 22, 2025, 06:= 48 Yuan Fu <casouri@gmail.com&g= t; wrote:


> On May 21, 2025, at 4:20=E2=80=AFAM, Jo=C3=A3o T=C3=A1vora <joaot= avora@gmail.com> wrote:
>
> Good catch, good analysis and great commit message.
>
> Just please rename the subject line of the commit message to
> start with "Eglot: " if you can.=C2=A0 Makes it easier to id= entify.=C2=A0 For example:
>
> Eglot: always call ElDoc callbacks in correct buffer
>
> Then add a reference to this bug#78530 and push at will.

Cool. And thanks for the commit title, I was struggling to come up with a g= ood one :) I pushed the fix. But we should also think about fixing the root= cause. For example, switching to the original buffer temporarily when runn= ing =E2=80=98eldoc-display-functions=E2=80=99, like what eglot documentatio= n functions do already. WDYT?

Yuan
--000000000000fb8dde0635b61b5d-- From unknown Tue Jun 17 22:28:12 2025 X-Loop: help-debbugs@gnu.org Subject: bug#78530: 31.0.50; [PATCH] eglot-code-action-suggestion doesn't call the callback function in the original buffer Resent-From: Yuan Fu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 23 May 2025 01:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 78530 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Cc: 78530@debbugs.gnu.org Received: via spool by 78530-submit@debbugs.gnu.org id=B78530.17479620345565 (code B ref 78530); Fri, 23 May 2025 01:01:02 +0000 Received: (at 78530) by debbugs.gnu.org; 23 May 2025 01:00:34 +0000 Received: from localhost ([127.0.0.1]:41163 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uIGm1-0001Rf-0v for submit@debbugs.gnu.org; Thu, 22 May 2025 21:00:33 -0400 Received: from mail-pf1-x42e.google.com ([2607:f8b0:4864:20::42e]:51430) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1uIGlw-0001Pn-36 for 78530@debbugs.gnu.org; Thu, 22 May 2025 21:00:30 -0400 Received: by mail-pf1-x42e.google.com with SMTP id d2e1a72fcca58-7370a2d1981so6508340b3a.2 for <78530@debbugs.gnu.org>; Thu, 22 May 2025 18:00:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1747962022; x=1748566822; darn=debbugs.gnu.org; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:from:to:cc:subject:date:message-id:reply-to; bh=umd7zrO+GwL1tiVEGR8LF7GG1wz+U7mSS5Bbo41WA3M=; b=G4jX4XzbsFXAhRG8sSJ/b+ZAa64f7H7JRd1p4BhUAknh8xJP82j5Sl9Ni7lR6psLLE LVVX50fW4RpPUPc6zRR9sSrjk15VHlL93dAYE35gE6edk7/wUk2D+gcKHluY/5UM5w0O 1Mh7Ja7d9bXDqbOpqy+H4t8Ke3eUQk8InRMip62b+IK25ugBjwjiBptQfwi2g+2Fn0RW sqDlq5NOO7RjXy4YgGDlVsImQET2f1LK2DTreUoEX29vXm+a6pwGxzbvgY9lNq9/CaAF pkxhOZOSBbD6PktSPbLEamHz28XWbCKJlfk+qtBLXI+XrO3Mb13i3ntRcsBSQjLjzV/C pl+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747962022; x=1748566822; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=umd7zrO+GwL1tiVEGR8LF7GG1wz+U7mSS5Bbo41WA3M=; b=g+ywg9wAYIauL2DmFIk6S2uVpZILQBSxl6drwr5OI0Q/MN+1SdEuVBd9Se9JNPyO7+ IQ6gWg+OBcgFdxAOScZixP9Qsz4svLC48ozm/VTWsQFQR++/TP4kPTQT89dfeKra10Zg pEuXAHgLEJfpqP5teuOJgTf8nV80JcAj9sri9s8VfhciLoeHpZowCeEUxdrf1P2Gm6cU 91bjwqxkDQSzSCL65BFlsP0Ep9vMjwvmnm+ZjKRmjt8HkdS3LMweGMA915tmgs/5lfa8 yYlzZdzB5gHvI1DmLU425/4tiidSpYH+LddE60oMDxlWGs34+GG4XKB9MrGyDlMmRKnQ T/mw== X-Gm-Message-State: AOJu0Yz7i65uy3VfdN4fKEBHAfZhkgEPeaOzFOl0lmm30hVoIpnlgkbg CamHf91ubkVYP0uFzf/aS/srFG/nlSnUhdAx2nk7WKysVohOlaQUYBkX X-Gm-Gg: ASbGnctNyPifRvuYgY+DEFIr9Sqi6dIijtT7L4nGkjZ+XwXQs6U542oQvrwoIfeW6Ul pLU7pU4W5xg0lQ0fEErz89BuH/xwNbGhBWWEWL5JVg2c5aBTwHX9JsMcSq7xz26faGs8jbnIB2S /3Jvo4eiK3uOT2CJan80878Bwpm4NPUGSzmuNMZZAAMmAA3TJ3MlLyaaQZH61wucDJtYApscsVN 5S93U0z+S8gdTw//bfhHHApFXviBCQz4S479BL927VFj+NhrUMtAyTmCgrqI/1zNii3QokTRCxp LcwnvSxje59hGZPv4gq4tXbi+bcFwzrl968sSzDVsgui1OSNBpc8/J4XLpz9YbGkG3lueO/o/xq NXiicKOwLNqaU39h57dCVaiUr X-Google-Smtp-Source: AGHT+IHkGXppnmEjsbbBEdrPksQ+n6aYSxF8Mozb3KzzH/zxGnSY2EHKI2Q3zy9SoR+lE3ckD7BU+Q== X-Received: by 2002:a05:6a00:e0e:b0:736:9f20:a175 with SMTP id d2e1a72fcca58-742acc8d8f4mr36933555b3a.2.1747962021461; Thu, 22 May 2025 18:00:21 -0700 (PDT) Received: from smtpclient.apple (c-24-4-247-194.hsd1.ca.comcast.net. [24.4.247.194]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-742a98a3380sm12148386b3a.170.2025.05.22.18.00.20 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 22 May 2025 18:00:20 -0700 (PDT) From: Yuan Fu Message-Id: Content-Type: multipart/mixed; boundary="Apple-Mail=_793184EA-49C1-4652-B7FC-93669E7078FD" Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.500.181.1.5\)) Date: Thu, 22 May 2025 18:00:09 -0700 In-Reply-To: References: <4F379C8B-67B9-4156-B7F9-166102B0D355@gmail.com> X-Mailer: Apple Mail (2.3826.500.181.1.5) X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --Apple-Mail=_793184EA-49C1-4652-B7FC-93669E7078FD Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On May 22, 2025, at 2:28=E2=80=AFAM, Jo=C3=A3o T=C3=A1vora = wrote: >=20 > Ok,=20 >=20 > To understand exactly what you mean, just show a patch to eldoc.el. = Even though I'm not directly maintaining it anymore lately, I can look = at it.=20 Something like this. This way, documentation functions don=E2=80=99t = need to worry about running the callback in the original buffer. Yuan --Apple-Mail=_793184EA-49C1-4652-B7FC-93669E7078FD Content-Disposition: attachment; filename=eldoc-invoke-strategy.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="eldoc-invoke-strategy.patch" Content-Transfer-Encoding: quoted-printable =46rom=20a8145feaee2491718d06f725da8624c251895e29=20Mon=20Sep=2017=20= 00:00:00=202001=0AFrom:=20Yuan=20Fu=20=0ADate:=20Thu,=20= 22=20May=202025=2017:57:37=20-0700=0ASubject:=20[PATCH]=20Eldoc:=20Run=20= eldoc-display-functions=20with=20original=20buffer=0A=20(bug#78530)=0A=0A= *=20lisp/emacs-lisp/eldoc.el=20(eldoc--invoke-strategy):=20Run=20the=0A= hook=20with=20the=20original=20buffer=20as=20the=20current=20buffer.=20= This=20way=0Awe're=20certain=20that=20the=20buffer-local=20value=20of=0A= 'eldoc-display-functions'=20is=20used.=0A---=0A=20= lisp/emacs-lisp/eldoc.el=20|=2016=20+++++++++-------=0A=201=20file=20= changed,=209=20insertions(+),=207=20deletions(-)=0A=0Adiff=20--git=20= a/lisp/emacs-lisp/eldoc.el=20b/lisp/emacs-lisp/eldoc.el=0Aindex=20= 9e193580106..3d8202c34fa=20100644=0A---=20a/lisp/emacs-lisp/eldoc.el=0A= +++=20b/lisp/emacs-lisp/eldoc.el=0A@@=20-896,7=20+896,8=20@@=20= eldoc--invoke-strategy=0A=20=20=20=20=20=20=20=20=20=20(want=200)=0A=20=20= =20=20=20=20=20=20=20=20;;=20The=20doc=20strings=20and=20corresponding=20= options=20registered=20so=0A=20=20=20=20=20=20=20=20=20=20;;=20far.=0A-=20= =20=20=20=20=20=20=20=20(docs-registered=20'()))=0A+=20=20=20=20=20=20=20= =20=20(docs-registered=20'())=0A+=20=20=20=20=20=20=20=20=20(orig-buffer=20= (current-buffer)))=0A=20=20=20=20=20(cl-labels=0A=20=20=20=20=20=20=20=20= =20((register-doc=0A=20=20=20=20=20=20=20=20=20=20=20(pos=20string=20= plist=20origin)=0A@@=20-905,12=20+906,13=20@@=20eldoc--invoke-strategy=0A= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= docs-registered)))=0A=20=20=20=20=20=20=20=20=20=20(display-doc=0A=20=20=20= =20=20=20=20=20=20=20=20()=0A-=20=20=20=20=20=20=20=20=20=20= (run-hook-with-args=0A-=20=20=20=20=20=20=20=20=20=20=20= 'eldoc-display-functions=20(mapcar=20#'cdr=0A-=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20(setq=20docs-registered=0A-=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(sort=20= docs-registered=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20(lambda=20(a=20b)=20(<=20(car=20= a)=20(car=20b))))))=0A-=20=20=20=20=20=20=20=20=20=20=20interactive))=0A= +=20=20=20=20=20=20=20=20=20=20(with-current-buffer=20orig-buffer=0A+=20=20= =20=20=20=20=20=20=20=20=20=20(run-hook-with-args=0A+=20=20=20=20=20=20=20= =20=20=20=20=20=20'eldoc-display-functions=20(mapcar=20#'cdr=0A+=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(setq=20= docs-registered=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20(sort=20docs-registered=0A+=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20(lambda=20(a=20b)=20(<=20(car=20a)=20(car=20b))))))=0A+=20=20=20=20=20= =20=20=20=20=20=20=20=20interactive)))=0A=20=20=20=20=20=20=20=20=20=20= (make-callback=0A=20=20=20=20=20=20=20=20=20=20=20(method=20origin)=0A=20= =20=20=20=20=20=20=20=20=20=20(let=20((pos=20(prog1=20howmany=20(cl-incf=20= howmany))))=0A--=20=0A2.39.5=20(Apple=20Git-154)=0A=0A= --Apple-Mail=_793184EA-49C1-4652-B7FC-93669E7078FD-- From unknown Tue Jun 17 22:28:12 2025 X-Loop: help-debbugs@gnu.org Subject: bug#78530: 31.0.50; [PATCH] eglot-code-action-suggestion doesn't call the callback function in the original buffer Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 07 Jun 2025 08:10:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 78530 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: joaotavora@gmail.com, Yuan Fu Cc: 78530@debbugs.gnu.org Received: via spool by 78530-submit@debbugs.gnu.org id=B78530.174928374315136 (code B ref 78530); Sat, 07 Jun 2025 08:10:02 +0000 Received: (at 78530) by debbugs.gnu.org; 7 Jun 2025 08:09:03 +0000 Received: from localhost ([127.0.0.1]:46649 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uNobu-0003w2-Fm for submit@debbugs.gnu.org; Sat, 07 Jun 2025 04:09:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44600) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uNobr-0003vU-Uf for 78530@debbugs.gnu.org; Sat, 07 Jun 2025 04:09:00 -0400 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 1uNobm-0002Ct-I6; Sat, 07 Jun 2025 04:08:54 -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=XGaTEeGCvi6hDjY4Mj7E6TKVdrVxPVyGJSc2p0rItmI=; b=DZR/2iXC6U5xZLdLyDaL f17HySiKzjR0aSFCKjxKeT6ceEY7tg6YLVTqyBh8Q7GBspQkNRkVhTcxvk+QV7p1ctpZuRKmlUB/L U15HPgGzLvrNvqvqQ9Vp8Qv/7LuQdgY4sk57Ip7/ld/60UzN4xxfziDJO7nl25Ulmc7DdypzA64MG kEGKkpbhQfFZGbLsCFSmBSIBXjMDI6mWMp2lHZZWo8oNeJCm6MoO8UJaJxqurliRR3QKYGTn5a1Mw 5G3oLXaz5B7XVjfrZSwvCPdTJfJ1gNukwFGd9rV/kczbMVfSrkDRTnq0VwhnxOEdDkakVm6hYhdJ6 0dLtxGSk70390A==; Date: Sat, 07 Jun 2025 11:08:51 +0300 Message-Id: <86tt4sj7n0.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: (message from Yuan Fu on Thu, 22 May 2025 18:00:09 -0700) References: <4F379C8B-67B9-4156-B7F9-166102B0D355@gmail.com> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Ping! João, any comments or suggestions? > Cc: 78530@debbugs.gnu.org > From: Yuan Fu > Date: Thu, 22 May 2025 18:00:09 -0700 > > > On May 22, 2025, at 2:28 AM, João Távora wrote: > > > > Ok, > > > > To understand exactly what you mean, just show a patch to eldoc.el. Even though I'm not directly maintaining it anymore lately, I can look at it. > > Something like this. This way, documentation functions don’t need to worry about running the callback in the original buffer. > > Yuan > > > From a8145feaee2491718d06f725da8624c251895e29 Mon Sep 17 00:00:00 2001 > From: Yuan Fu > Date: Thu, 22 May 2025 17:57:37 -0700 > Subject: [PATCH] Eldoc: Run eldoc-display-functions with original buffer > (bug#78530) > > * lisp/emacs-lisp/eldoc.el (eldoc--invoke-strategy): Run the > hook with the original buffer as the current buffer. This way > we're certain that the buffer-local value of > 'eldoc-display-functions' is used. > --- > lisp/emacs-lisp/eldoc.el | 16 +++++++++------- > 1 file changed, 9 insertions(+), 7 deletions(-) > > diff --git a/lisp/emacs-lisp/eldoc.el b/lisp/emacs-lisp/eldoc.el > index 9e193580106..3d8202c34fa 100644 > --- a/lisp/emacs-lisp/eldoc.el > +++ b/lisp/emacs-lisp/eldoc.el > @@ -896,7 +896,8 @@ eldoc--invoke-strategy > (want 0) > ;; The doc strings and corresponding options registered so > ;; far. > - (docs-registered '())) > + (docs-registered '()) > + (orig-buffer (current-buffer))) > (cl-labels > ((register-doc > (pos string plist origin) > @@ -905,12 +906,13 @@ eldoc--invoke-strategy > docs-registered))) > (display-doc > () > - (run-hook-with-args > - 'eldoc-display-functions (mapcar #'cdr > - (setq docs-registered > - (sort docs-registered > - (lambda (a b) (< (car a) (car b)))))) > - interactive)) > + (with-current-buffer orig-buffer > + (run-hook-with-args > + 'eldoc-display-functions (mapcar #'cdr > + (setq docs-registered > + (sort docs-registered > + (lambda (a b) (< (car a) (car b)))))) > + interactive))) > (make-callback > (method origin) > (let ((pos (prog1 howmany (cl-incf howmany)))) > -- > 2.39.5 (Apple Git-154) > From unknown Tue Jun 17 22:28:12 2025 X-Loop: help-debbugs@gnu.org Subject: bug#78530: 31.0.50; [PATCH] eglot-code-action-suggestion doesn't call the callback function in the original buffer Resent-From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 08 Jun 2025 23:20:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 78530 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Eli Zaretskii Cc: 78530@debbugs.gnu.org, Yuan Fu Received: via spool by 78530-submit@debbugs.gnu.org id=B78530.174942474713113 (code B ref 78530); Sun, 08 Jun 2025 23:20:01 +0000 Received: (at 78530) by debbugs.gnu.org; 8 Jun 2025 23:19:07 +0000 Received: from localhost ([127.0.0.1]:53222 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uOPIA-0003PP-Rn for submit@debbugs.gnu.org; Sun, 08 Jun 2025 19:19:07 -0400 Received: from mail-oo1-xc35.google.com ([2607:f8b0:4864:20::c35]:53619) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1uOPI5-0003Ot-Hi for 78530@debbugs.gnu.org; Sun, 08 Jun 2025 19:19:04 -0400 Received: by mail-oo1-xc35.google.com with SMTP id 006d021491bc7-60bd30dd387so1991067eaf.3 for <78530@debbugs.gnu.org>; Sun, 08 Jun 2025 16:19:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1749424736; x=1750029536; darn=debbugs.gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=EwZw7YGjtuCWOAZ1OSwXmj/9JELCGZ88+ekKOp70X9s=; b=YQk+ey4zUMKiQMvp0bZPyYzrNV/sHZOznLPzWZQHC8kl67fTFBa4v8O0BXUMPi4mhh LP6oYfu36Rz1d4XQpk/FBDxyeUKphxBYQs8d7qB7fS68+YB0rabrbWay41DWnv9pXp3z L0zC42WqAvJV1auRu8SZOqCwHwaxLTeIkZjWb47hW7rKeknEDWBYD8bzkKdqZwhkqCM4 PMWGYte9EWSKpsVSgNN/zHQRm/p+r7+8V5Jt7gdDy5K3NkK5bt6/yuHXApWWG4QdVxo2 +Po5zAeZIwAI10hzfD50Mp1FfZIr2H37pJdUju8xsDE50jobO5XW6r4ow6Wn2VI1m+Qg qXpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749424736; x=1750029536; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=EwZw7YGjtuCWOAZ1OSwXmj/9JELCGZ88+ekKOp70X9s=; b=JzhVyw0ULBEXb3h7vson19nzyEHhA84KNOAK1Nsb867Fh1yEyq4DrVNJXMXldaEMNO 1wS5j1+tK2oIOuGUeem4luGQUzZyyI8BqHWpqB4Yln+NFkr69aoCbWazoWPZ8U6Po+sQ wGh75RITDf2lJp+lYoN+km48Ktu3+AEVZPE8zA5IcA7VAUVRSdTr3TJOrA1gNOhCJq1M 4FPvwYHgzCCvaoY7rzw0mvUf6vQ8rsGiYh68N4QWJIoF8N2Vo3+aDnf0aP9uokBp6PMJ 3gHCTq+2Wx3t/kfK4xBuCYSm9RXuzBCAVeQujrNN6QhoDgcooNHd7X8YnFNgug0pPJby g64Q== X-Forwarded-Encrypted: i=1; AJvYcCXXUUm+nCkAFyRik6BbUCIxMhAyE2SjzMGxKDeRoWPh1SliyAXV11y+vsfSaxH9z9Ht2L32+A==@debbugs.gnu.org X-Gm-Message-State: AOJu0YytPL+30TqoTW1/fS9veSQ07HaGpcBoBi228HLcAr9WpTxL53fi 4EbHLXF75rxstgYPxkaWOpmBWa9Ay/XJYNVeOi8TSBWVJ37vhnzLgdr9acmLEjOBgCKKQaOBAAE dAnOQoT00Pj2hqRgAHg/+xKR5B6u66Kw= X-Gm-Gg: ASbGncviQPvkvXJSmtGKOQUG2zeKsloI4H9f9SspQAFtKE1zjEUdPyaN7OgMbzxUEFM bmSDSXgy/6/YH2z80UYeBa8beLb7KiT54FSdHqedswHZ7yECkMhZSFcfyodx9uLlGQ+kduMEW8C u+QzM7U75aGt/jqL6FK/SGFtHHwJYsJzk= X-Google-Smtp-Source: AGHT+IGIevTYr5GpP8Hm1vuZSAMKryWWrZi93W1q+gr0aGGAQwqeX1Ll8M/Wb7LxF+2JJdf47Y5d7zLmO4u2cw5GW70= X-Received: by 2002:a4a:ec41:0:b0:60f:3442:96b6 with SMTP id 006d021491bc7-60f3cf1a772mr6658736eaf.3.1749424735702; Sun, 08 Jun 2025 16:18:55 -0700 (PDT) MIME-Version: 1.0 References: <4F379C8B-67B9-4156-B7F9-166102B0D355@gmail.com> <86tt4sj7n0.fsf@gnu.org> In-Reply-To: <86tt4sj7n0.fsf@gnu.org> From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Date: Mon, 9 Jun 2025 00:19:36 +0100 X-Gm-Features: AX0GCFtdtsGtJRqN0WAYN7qphTheuIVMDAmdGykIjV2Mbv5AGz6wJju-35BoO34 Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On Sat, Jun 7, 2025 at 9:08=E2=80=AFAM Eli Zaretskii wrote: > > Ping! Jo=C3=A3o, any comments or suggestions? I think the patch is definitely in the right direction, but it would make even more sense if it checked if the "original buffer" is still live by the time the lambda is called. If it's not, probably the callback lambda shouldn't get called. This is why Eglot uses its own macro eglot--when-buffer-live. And this new "rule" should be encoded in the documentation (docstring and/or manual). No need for lots of text, just a note. And we should think a little bit if we're breaking backward compatibility. Though I don't think we are: not many ElDoc clients are relying on the fact that the buffer the callbacks are run in is somewhat arbitrary. Finally the patch could come with some changes to Eglot as well, because this allows for eglot.el to be simplified. But be careful: the way to do this is to do the eldoc.el change bumping its :core package version, and then make the eglot.el change bumping its Package-requires: eldoc version. That way we guarantee that older Emacsen pulling in new eglot.el also pull in the new suitable eldoc.el. Thanks, Jo=C3=A3o From unknown Tue Jun 17 22:28:12 2025 X-Loop: help-debbugs@gnu.org Subject: bug#78530: 31.0.50; [PATCH] eglot-code-action-suggestion doesn't call the callback function in the original buffer Resent-From: Yuan Fu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 10 Jun 2025 01:31:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 78530 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Cc: 78530@debbugs.gnu.org, Eli Zaretskii Received: via spool by 78530-submit@debbugs.gnu.org id=B78530.174951904122721 (code B ref 78530); Tue, 10 Jun 2025 01:31:04 +0000 Received: (at 78530) by debbugs.gnu.org; 10 Jun 2025 01:30:41 +0000 Received: from localhost ([127.0.0.1]:59411 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uOnp1-0005uE-Ug for submit@debbugs.gnu.org; Mon, 09 Jun 2025 21:30:41 -0400 Received: from mail-pl1-x62d.google.com ([2607:f8b0:4864:20::62d]:44424) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1uOnov-0005pw-In for 78530@debbugs.gnu.org; Mon, 09 Jun 2025 21:30:35 -0400 Received: by mail-pl1-x62d.google.com with SMTP id d9443c01a7336-2363497cc4dso5905385ad.1 for <78530@debbugs.gnu.org>; Mon, 09 Jun 2025 18:30:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1749519027; x=1750123827; darn=debbugs.gnu.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=U9jafzF4HaBlumE66b6WYdwQwBjpT4G5lY4u70oyYt0=; b=dx0wl/w2l+Fo705tiB97QoggUcoX2Or8hvXAvQQv7t/0aX34k1/y4I9ga0B2pVrp5S EZuwYDMUBws5uMtTVrdrtxPA8Ee7wCVxaN3TdzIeL3tdIUvm3+C15K/PjgMsPo4MOOlA sGdwpEL8AijodiITTjHtWPWU3sKyRt5GmO0hnOm9mUeuvjfFBDMYKLWGa4BxivJJ3COM llRj8S7eQU1jQNJpeQwc1kEXDSFPOIQoClI0uNVYTlxk+TTRvlT80c5cOGRXGfa51FCj GrOwqaqA9eusamEizyJEJTrC98YRfLvUbk+sbbsx15gtvUS6O/oR4gVWqq49rxutZHBJ c9YA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749519027; x=1750123827; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=U9jafzF4HaBlumE66b6WYdwQwBjpT4G5lY4u70oyYt0=; b=cmEdEuw8cDaarlN8hVLHaKjXWoA2L8Ajz6zb1joE5tIFaryeuJAdZqO/W3jYG4zXns LIVVEauqJY7FkpigEBJg/ajc7PvU/9reVmj1miJGnIDIk7BzCiVKQXVSyrDYa4icHU/7 AAaF0dOlPDxpde5tifopBLPlZ2By7aXqMKBhGqWw5t9oNZ088mVuY9b1sHvA4D3q66Fe hvMxOPrKkPjCoSSlHTJ4F7InoFhbTZ0+eYFOSkSjj1s25vO7I5TNrK2XN2lQZbHLyBZu Jvc/hBua2SvJXIE32/pQ/vbGWzuHRSsf5K8BCd26UL5uIB9N6e7E7mG/jERWn8Fv5F0n EYSg== X-Forwarded-Encrypted: i=1; AJvYcCUZC45cdEhBOXOPg7C5VaDIbgiGRrQQeA3QVeZqBK89MWa4i1WHzgWViMB/5wkehj2VlU+bJw==@debbugs.gnu.org X-Gm-Message-State: AOJu0YwYMJvL0CNthJpA+/GKhGgk3a0jdWOGdTakWYLAIJi12Jw7YaJL gh7xadgitlOVZpvp6PPsLtsS6OPwnspssaSJHf9QhbkXbDC4TI5ztLQs X-Gm-Gg: ASbGncvaPFU/q7x9V56cTY4AvCNKSz0hw+55v29WY+QRIWHt8roMG4gWQCEI4eFgMbF Dk0aLKxtC32ATAth90/o9+jL28ed4UkIqdOYCIuwbm18q7SqtHR7AZWnA/HVUS5UZFbma2F/h00 3MGFDg0k2aV5GIM19p99f97UJ1gd8h2jdDi91YN/VeEEKGa/jbygRXxAjXThOm4fO5ECdW0LFdZ vIZ/8DZnhXGNVyplyBpzCZCiI51DMi1EDj1Z3mCE45884XDRAflEG51vKyhdxzXt91xfw8rklPd qCyA049BxPs6iam9MR7p/7NL7Wbkoe/9Z5fllTwIar8/pE4TK1Zf3KGCcy52n0ZhG5XAxUHvPZi uzYJtMu6gGduK2nk8DHmNbh1NUxND7qdou/4= X-Google-Smtp-Source: AGHT+IH2n2lRLxmeoSFcdShbagOBVz2XhIEmKcWaruAKPnz//0MsKokgaT6kUQOqV01UQlD9YHzh3w== X-Received: by 2002:a17:903:166e:b0:234:ba37:87ae with SMTP id d9443c01a7336-23601cefdd1mr237321495ad.4.1749519027311; Mon, 09 Jun 2025 18:30:27 -0700 (PDT) Received: from smtpclient.apple (c-24-4-247-194.hsd1.ca.comcast.net. [24.4.247.194]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-b2f5e3927d6sm5922369a12.0.2025.06.09.18.30.26 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Jun 2025 18:30:26 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.500.181.1.5\)) From: Yuan Fu In-Reply-To: Date: Mon, 9 Jun 2025 18:30:15 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <1AE3B9A1-172D-4FCA-B08C-DC46CD22E020@gmail.com> References: <4F379C8B-67B9-4156-B7F9-166102B0D355@gmail.com> <86tt4sj7n0.fsf@gnu.org> X-Mailer: Apple Mail (2.3826.500.181.1.5) X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > On Jun 8, 2025, at 4:19=E2=80=AFPM, Jo=C3=A3o T=C3=A1vora = wrote: >=20 > On Sat, Jun 7, 2025 at 9:08=E2=80=AFAM Eli Zaretskii = wrote: >>=20 >> Ping! Jo=C3=A3o, any comments or suggestions? >=20 > I think the patch is definitely in the right direction, but it would = make > even more sense if it checked if the "original buffer" is still live = by > the time the lambda is called. If it's not, probably the callback > lambda shouldn't get called. This is why Eglot uses its own macro > eglot--when-buffer-live. Ohh yeah, good call. >=20 > And this new "rule" should be encoded in the documentation (docstring > and/or manual). No need for lots of text, just a note. Will do. >=20 > And we should think a little bit if we're breaking backward > compatibility. Though I don't think we are: not many ElDoc clients = are > relying on the fact that the buffer the callbacks are run in is = somewhat > arbitrary. Plus usually the callback _is_ ran in the original buffer, unless the = provider of the documentation function does something weird. (In our = case, eglot runs the callback in a temp buffer.) > Finally the patch could come with some changes to Eglot as well, = because > this allows for eglot.el to be simplified. But be careful: the way to > do this is to do the eldoc.el change bumping its :core package = version, > and then make the eglot.el change bumping its Package-requires: eldoc > version. That way we guarantee that older Emacsen pulling in new = eglot.el > also pull in the new suitable eldoc.el. Cool. Let me check if we really don=E2=80=99t need the = eglot--when-buffer-window wrapper in the documentation functions. Or = you=E2=80=99re certain that we don=E2=80=99t? Yuan