From unknown Sun Aug 10 10:55:10 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#78862 <78862@debbugs.gnu.org> To: bug#78862 <78862@debbugs.gnu.org> Subject: Status: 31.0.50; Eglot couldn't refresh Flymake diagnostics on Rust project Reply-To: bug#78862 <78862@debbugs.gnu.org> Date: Sun, 10 Aug 2025 17:55:10 +0000 retitle 78862 31.0.50; Eglot couldn't refresh Flymake diagnostics on Rust p= roject reassign 78862 emacs submitter 78862 Eason Huang severity 78862 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Sun Jun 22 03:12:57 2025 Received: (at submit) by debbugs.gnu.org; 22 Jun 2025 07:12:57 +0000 Received: from localhost ([127.0.0.1]:46327 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uTEsq-0006cf-Nx for submit@debbugs.gnu.org; Sun, 22 Jun 2025 03:12:57 -0400 Received: from lists.gnu.org ([2001:470:142::17]:37346) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uTEsm-0006cR-VU for submit@debbugs.gnu.org; Sun, 22 Jun 2025 03:12:55 -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 1uTEsg-0001UU-33 for bug-gnu-emacs@gnu.org; Sun, 22 Jun 2025 03:12:46 -0400 Received: from xmbghk7.mail.qq.com ([43.163.128.48]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uTEsZ-00066x-LE for bug-gnu-emacs@gnu.org; Sun, 22 Jun 2025 03:12:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com; s=s201512; t=1750576350; bh=+Soxj+DsaaIce+xqRMhdX1sRhFGLPP/LdI7vzosa3VM=; h=From:To:Subject:Date; b=tp1pciiD84Iuq6QsdvCxQIqKn2ElFchQRjNAIfXHtK6mcc+J0rbW1Zo/pjZ7kmqk/ LMKSboqwWs1ViHTR5MvXRVn8vRRz1QO9rByui4JNnGY81/caPN4E3xbTxNJrDiJ8C9 in5GxbsDvmQmNOXVvk9HDdGxzmmrUlhU7pCJkk9g= Received: from 192.168.1.9 ([240e:388:7d08:9700:89fa:b3d0:dbc4:c4de]) by newxmesmtplogicsvrszc13-0.qq.com (NewEsmtp) with SMTP id 14A2EADB; Sun, 22 Jun 2025 15:05:10 +0800 X-QQ-mid: xmsmtpt1750575910tdexoap41 Message-ID: X-QQ-XMAILINFO: NafziRg7Bx69buzRiu8nu/Ddz8BbBW/HF/AH1AZpGkTXknFc2v2/vlaF9IekTt NStHavo3rdC+KMEuc4DUawVFmy8NwCSOLYMrVbYUxGZaU8X0yk3BWwTI8RPEJY2oAc7BX4ibD7H+ DVF1r5PRtpx8WqZgU4ORFWlblk5cSr8SEPKmT3fw2yz6fj3D1I8XGn4mbrtWearaEQONNobogIgA uL+qV3KRBZ9SNbqfziLum3796T4hEmpwSh0RcMLaJsF+ue7GBGXZxid1A9rSGeR+aksikxBOkYLV WN309HkM7Nxf/ajvsF5zYJEzG/9npMSVJqsPrqF2w7Tt5LxIZhJehaR/Ubmzl8bNqaCaetILnv1R bkX1hdPrHgICq494acMqAfENUB9CboH6tuUhJIuZccqeIcIj04OFGYyFfk2gLOh/P1t7dLj+jD7d 8YiltDtfy1bHva0mIgjLv5GunpfONrC4VFXyvBIQHDaRARd4cdsYq3pAaBj6AcGNNVrtm69pxd6m QEeYh3cLYj8kXjRU446+afnudWKIA/7ssL3XM8uP+fRXE1iLSqDZQX20zzZz6hRbGB6tjSwoSu3Y ZJtj+h0/0nOrXb/3PHbvhrJLOTnZ8LIPQPsxwgk4T98XO202Uksfy9k0s5L2HNUvDMfH059/ucGN alZJfpw7N2HFbxPEG9JyoJbtSZmWGMHhQ0Qa7zf34b1dhX1fcK/Xkl5IedXNxqAmFEnnmBWPplGa Dwgy3pQyXtBPpev+KgtqhGT7YO95yygwXTwVJdyyaVrMVgQSzdi/yvZUpF/HBT2IXjDhNiWCyK6y W5EsfTd6laH6igm3jDwDd/A4Dr4zZnFhJ6ZdvciefVU2RmgLTibsjGal+A9GOODvAhuu5xlTbvFu cBrqaCQ1+8YtJYWHaINwvQUbT5Ed76bpg5T94Po3jJJm5qb+CK995o8nxG9PmeSPJu5cn+dr4KbP xUlwWsXWcS/mqZqkMRBC4L9dtU55ODWQgC1mTB50W4wE5f/qcHMdlCU18AV2DZWsw7nVZ4xhsABh OgIGuldQ== X-QQ-XMRINFO: M/715EihBoGSf6IYSX1iLFg= From: Eason Huang To: bug-gnu-emacs@gnu.org Subject: 31.0.50; Eglot couldn't refresh Flymake diagnostics on Rust project X-Debbugs-Cc: Date: Sun, 22 Jun 2025 15:05:06 +0800 X-OQ-MSGID: MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=43.163.128.48; envelope-from=aqua0210@foxmail.com; helo=xmbghk7.mail.qq.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 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_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 1.2 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Hello Emacs dev, Recently, I found that if flymake-mode enabled before eglot,eglot can not refresh the Flymake diagnostics. Disable flymake with `M-x flymake-mode`, and then enable eglot with `M-x eglot` can fix the i [...] Content analysis details: (1.2 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2001:470:142:0:0:0:0:17 listed in] [list.dnswl.org] 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (aqua0210[at]foxmail.com) -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (aqua0210[at]foxmail.com) 1.0 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) 0.0 SPOOFED_FREEMAIL No description available. X-Debbugs-Envelope-To: submit 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.2 (/) Hello Emacs dev, Recently, I found that if flymake-mode enabled before eglot,eglot can not refresh the Flymake diagnostics. Disable flymake with `M-x flymake-mode`, and then enable eglot with `M-x eglot` can fix the issue. Or with the below snippet can fix it: ``` (with-eval-after-load 'eglot (add-hook 'eglot-managed-mode-hook (lambda () (flymake-mode -1) (flymake-mode 1)))) ``` Steps to reproduce: 1. put below config into the init.el file ``` (use-package flymake :hook (prog-mode . flymake-mode)) (use-package rust-mode :ensure t :defer t :custom (rust-mode-treesitter-derive (and (fboundp 'treesit-available-p) (treesit-available-p)))) ``` 2. Start Emacs 31 3. Open any Rust project with a dependency 4. Open any Rust file in a rust project(make sure it use a dependency), such as main.rs, then flymake will report errors. Because I don't have flymake rust backends,the errors is expected. 5. Make sure `rust-analyzer` is in the PATH,My rust toolchain is as below: ``` rustc --version rustc 1.87.0 (17067e9ac 2025-05-09) rust-analyzer --version rust-analyzer 1.87.0 (17067e9ac6d 2025-05-09) `` 6. Start eglot with `M-x eglot`, now the errors still exist. This is the issue. 7. `M-x flymake-mode` to disable flymake 8. `M-x eglot-reconnect` will refresh the Flymake diagnostics,and no errors reported if your Rust project is compiled. The issue only happened on Emacs 31, it works as expected on Emacs 30. ---- Eason Huang In GNU Emacs 31.0.50 (build 1, x86_64-apple-darwin24.5.0, NS appkit-2575.60 Version 15.5 (Build 24F74), git sha1 c916f816e0f) of 2025-06-22 built on 192.168.1.9 Windowing system distributor 'Apple', version 10.3.2575 System Description: macOS 15.5 Configured using: 'configure --without-native-compilation --without-dbus 'CPPFLAGS=-I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk' 'LDFLAGS=-L/opt/local/lib -Wl,-headerpad_max_install_names -Wl,-rpath /opt/local/lib/gcc14 -Wl,-syslibroot,/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -arch x86_64'' Configured features: ACL GIF GLIB GMP GNUTLS JPEG LCMS2 LIBXML2 MODULES NOTIFY KQUEUE NS PDUMPER PNG RSVG SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER WEBP XIM ZLIB Important settings: value of $LANG: zh_CN.UTF-8 locale-coding-system: utf-8-unix Major mode: Elisp/l Minor modes in effect: flymake-mode: t tooltip-mode: t global-eldoc-mode: t eldoc-mode: t show-paren-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t minibuffer-regexp-mode: t line-number-mode: t transient-mark-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message yank-media puny rfc822 mml mml-sec epa derived epg rfc6068 epg-config gnus-util mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils noutline outline eglot tree-widget wid-edit external-completion jsonrpc xref diff ert pp ewoc debug backtrace find-func filenotify imenu pcase vc-git diff-mode track-changes easy-mmode files-x vc-dispatcher rust-utils rust-mode-treesitter rust-ts-mode rx c-ts-common treesit rust-mode rust-playpen rust-compile rust-cargo rust-common rust-rustfmt dired-aux dired dired-loaddefs time-date checkdoc lisp-mnt flymake project compile text-property-search comint ansi-osc ansi-color ring warnings thingatpt use-package-ensure cl-extra help-mode use-package-core emacs-git-version rust-mode-autoloads package browse-url xdg url url-proxy url-privacy url-expand url-methods url-history url-cookie generate-lisp-file url-domsuf url-util mailcap url-handlers url-parse auth-source cl-seq eieio eieio-core cl-macs icons password-cache json subr-x map byte-opt gv bytecomp byte-compile url-vars cl-loaddefs cl-lib china-util rmc iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/ns-win ns-win ucs-normalize mule-util term/common-win tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors frame minibuffer nadvice seq simple cl-generic indonesian philippine cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite emoji-zwj charscript charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget keymap hashtable-print-readable backquote threads kqueue cocoa ns lcms2 multi-tty make-network-process tty-child-frames emacs) Memory information: ((conses 16 124358 19418) (symbols 48 13713 0) (strings 32 38113 1660) (string-bytes 1 1006591) (vectors 16 25656) (vector-slots 8 302210 13180) (floats 8 63 99) (intervals 56 820 2) (buffers 1064 21)) -- Eason Huang From debbugs-submit-bounces@debbugs.gnu.org Sun Jun 22 03:59:42 2025 Received: (at 78862) by debbugs.gnu.org; 22 Jun 2025 07:59:42 +0000 Received: from localhost ([127.0.0.1]:46440 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uTFc5-0000Lw-UN for submit@debbugs.gnu.org; Sun, 22 Jun 2025 03:59:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45148) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uTFc3-0000Lh-5p for 78862@debbugs.gnu.org; Sun, 22 Jun 2025 03:59:40 -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 1uTFbu-0006D1-Cb; Sun, 22 Jun 2025 03:59:30 -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=R5SSuRONWIHV/BNvMgQKAHHdYeJ3IUq0xoFfmJAX/Rk=; b=L+WY3CcnzsYblKAznnCW uKN2tyikduD7m6XG54l6DtuA1eSF5TkAH9nx8cxd175+u0JE4GaRBHlSRDgS3msKjtzgtXX/3/WZX WNye4j+IOyefIPFrySop0Y2EAxH0xzl21MJZTpaRRlGOfVebnB925HtrFtW/E3DrwTUIURjw6wY2N T44Kjc6EnuLNvhnX/DeWznXyHI/QTAI1v6ww/+t01Z5NtySLDcjYD+AAz9QuMY5CgCvcDY/+WcmDd ZXPF7RSf8RT12tGCgdlFa/pNJXmiEf1TkoOTLZcxh/WI4rPi+rWEtL9XTU1MnjWMwGlWJSpoKtMcq M4xHPUcDRN6xlw==; Date: Sun, 22 Jun 2025 10:59:27 +0300 Message-Id: <86plewgqao.fsf@gnu.org> From: Eli Zaretskii To: Eason Huang , =?iso-8859-1?Q?Jo=E3o_T=E1vora?= , Spencer Baugh In-Reply-To: (message from Eason Huang on Sun, 22 Jun 2025 15:05:06 +0800) Subject: Re: bug#78862: 31.0.50; Eglot couldn't refresh Flymake diagnostics on Rust project References: MIME-version: 1.0 Content-type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 78862 Cc: 78862@debbugs.gnu.org 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 (---) > From: Eason Huang > Date: Sun, 22 Jun 2025 15:05:06 +0800 > > Hello Emacs dev, > > Recently, I found that if flymake-mode enabled before eglot,eglot can not > refresh the Flymake diagnostics. > Disable flymake with `M-x flymake-mode`, and then enable eglot > with `M-x eglot` can fix the issue. Or with the below snippet can fix > it: > > ``` > (with-eval-after-load 'eglot > (add-hook 'eglot-managed-mode-hook (lambda () > (flymake-mode -1) > (flymake-mode 1)))) > > ``` > > Steps to reproduce: > > 1. put below config into the init.el file > ``` > (use-package flymake > :hook (prog-mode . flymake-mode)) > > (use-package rust-mode > :ensure t > :defer t > :custom (rust-mode-treesitter-derive (and (fboundp 'treesit-available-p) > (treesit-available-p)))) > ``` > 2. Start Emacs 31 > 3. Open any Rust project with a dependency > 4. Open any Rust file in a rust project(make sure it use a dependency), > such as main.rs, then flymake will report errors. Because I don't have > flymake rust backends,the errors is expected. > > 5. Make sure `rust-analyzer` is in the PATH,My rust toolchain is as > below: > > ``` > rustc --version > rustc 1.87.0 (17067e9ac 2025-05-09) > > rust-analyzer --version > rust-analyzer 1.87.0 (17067e9ac6d 2025-05-09) > `` > 6. Start eglot with `M-x eglot`, now the errors still exist. This is the > issue. > > 7. `M-x flymake-mode` to disable flymake > 8. `M-x eglot-reconnect` will refresh the Flymake diagnostics,and no > errors reported if your Rust project is compiled. > > > The issue only happened on Emacs 31, it works as expected on Emacs 30. Thanks, I hope João and Spencer will have comments or suggestions about this. > ---- > Eason Huang > > > In GNU Emacs 31.0.50 (build 1, x86_64-apple-darwin24.5.0, NS > appkit-2575.60 Version 15.5 (Build 24F74), git sha1 c916f816e0f) of > 2025-06-22 built on 192.168.1.9 > Windowing system distributor 'Apple', version 10.3.2575 > System Description: macOS 15.5 > > Configured using: > 'configure --without-native-compilation --without-dbus > 'CPPFLAGS=-I/opt/local/include > -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk' > 'LDFLAGS=-L/opt/local/lib -Wl,-headerpad_max_install_names -Wl,-rpath > /opt/local/lib/gcc14 > -Wl,-syslibroot,/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk > -arch x86_64'' > > Configured features: > ACL GIF GLIB GMP GNUTLS JPEG LCMS2 LIBXML2 MODULES NOTIFY KQUEUE NS > PDUMPER PNG RSVG SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER > WEBP XIM ZLIB > > Important settings: > value of $LANG: zh_CN.UTF-8 > locale-coding-system: utf-8-unix > > Major mode: Elisp/l > > Minor modes in effect: > flymake-mode: t > tooltip-mode: t > global-eldoc-mode: t > eldoc-mode: t > show-paren-mode: t > electric-indent-mode: t > mouse-wheel-mode: t > tool-bar-mode: t > menu-bar-mode: t > file-name-shadow-mode: t > global-font-lock-mode: t > font-lock-mode: t > blink-cursor-mode: t > minibuffer-regexp-mode: t > line-number-mode: t > transient-mark-mode: t > auto-composition-mode: t > auto-encryption-mode: t > auto-compression-mode: t > > Load-path shadows: > None found. > > Features: > (shadow sort mail-extr emacsbug message yank-media puny rfc822 mml > mml-sec epa derived epg rfc6068 epg-config gnus-util mm-decode mm-bodies > mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail > rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils noutline > outline eglot tree-widget wid-edit external-completion jsonrpc xref diff > ert pp ewoc debug backtrace find-func filenotify imenu pcase vc-git > diff-mode track-changes easy-mmode files-x vc-dispatcher rust-utils > rust-mode-treesitter rust-ts-mode rx c-ts-common treesit rust-mode > rust-playpen rust-compile rust-cargo rust-common rust-rustfmt dired-aux > dired dired-loaddefs time-date checkdoc lisp-mnt flymake project compile > text-property-search comint ansi-osc ansi-color ring warnings thingatpt > use-package-ensure cl-extra help-mode use-package-core emacs-git-version > rust-mode-autoloads package browse-url xdg url url-proxy url-privacy > url-expand url-methods url-history url-cookie generate-lisp-file > url-domsuf url-util mailcap url-handlers url-parse auth-source cl-seq > eieio eieio-core cl-macs icons password-cache json subr-x map byte-opt > gv bytecomp byte-compile url-vars cl-loaddefs cl-lib china-util rmc > iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook > vc-hooks lisp-float-type elisp-mode mwheel term/ns-win ns-win > ucs-normalize mule-util term/common-win tool-bar dnd fontset image > regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode > prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu > timer select scroll-bar mouse jit-lock font-lock syntax font-core > term/tty-colors frame minibuffer nadvice seq simple cl-generic > indonesian philippine cham georgian utf-8-lang misc-lang vietnamese > tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek > romanian slovak czech european ethiopic indian cyrillic chinese > composite emoji-zwj charscript charprop case-table epa-hook > jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs > theme-loaddefs faces cus-face macroexp files window text-properties > overlay sha1 md5 base64 format env code-pages mule custom widget keymap > hashtable-print-readable backquote threads kqueue cocoa ns lcms2 > multi-tty make-network-process tty-child-frames emacs) > > Memory information: > ((conses 16 124358 19418) (symbols 48 13713 0) (strings 32 38113 1660) > (string-bytes 1 1006591) (vectors 16 25656) > (vector-slots 8 302210 13180) (floats 8 63 99) (intervals 56 820 2) > (buffers 1064 21)) > > -- > Eason Huang > > > > > From debbugs-submit-bounces@debbugs.gnu.org Sun Jun 22 07:33:21 2025 Received: (at 78862) by debbugs.gnu.org; 22 Jun 2025 11:33:21 +0000 Received: from localhost ([127.0.0.1]:46947 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uTIwp-0006Ne-HL for submit@debbugs.gnu.org; Sun, 22 Jun 2025 07:33:20 -0400 Received: from xmbghk7.mail.qq.com ([43.163.128.48]:58913) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uTIwj-0006MD-NW for 78862@debbugs.gnu.org; Sun, 22 Jun 2025 07:33:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com; s=s201512; t=1750591678; bh=elxMoNwXIuoih2WLa8xwHdY9fC/VHpQK900LYNWfh3A=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=LrHAgdODoyTm6feOm3zJnKTBLc5nhedQlNy9O+2oq7LKR4ZY8iizeiBu4NRGnaOI8 IEM4MDrGBaQH8UrGpaqnb5k0n5PyrAbmo4J+3uF0dvCBZNKzWWs4iPqma8Lu+kiQVx knCLa8RD9aQfLaJAwXyU7Bq5Qs1zrxQ9MVRBSfHQ= Received: from 192.168.1.9 ([240e:388:7d08:9700:9cf7:4fa4:c7d4:2ac5]) by newxmesmtplogicsvrszb21-0.qq.com (NewEsmtp) with SMTP id 6F93A252; Sun, 22 Jun 2025 19:27:57 +0800 X-QQ-mid: xmsmtpt1750591677t1ihez2o5 Message-ID: X-QQ-XMAILINFO: Mg/0DM1Zd+nHj8EanemNr+YuiIT5dG8m41NJ0BhB/OH64vWUy1GCdzx49VV/Op neu1SyK9g1dQcmxijf/1zInEAsrbmplRiSWidS17w7VLNeajtF5ImTsL4m+aZF0uNCkB5UKFtocz VI8xN1Z02tdCTxi2WHctogDPxXbyQE2yEoBOTnF3m4UNR1qCs70GLSOHqra8PpqXqXTLyKdiUjI2 HenlGeTPyL4Zl4Q2JrbX336zGi0EAgZV4GebaVvY1Po3KEZvERznHr14h+PKwtLw8Um/sJLWIobh CnTSKkw5oXJTyQugMaB5q7TMfTuC0gbm6vFUE2q7OVWdPTiHV4BnYr8iykchiHwDzpyrVwdKxaNN XssksTB+a06mXA0qgBPiLMeEfOFrCFlBCkl4CTvf2smPFAtpW3EaTbHqQ+mfnRgejMDkbFClc/rj BWhpehVE7358JOw4v64GcAThO147lPV1A/ZVc/HkcVPYjqCx9sHS2fSMvMJ8WabrTP5pKV/h/CZr dX1gEGD6Lpb2Qm1uJMCJn9qtUNbas/YVx/ijfSrC0QWUbl2dS7GadMrFh15gTbZIUQGDB16Qb7N+ WlgKRUbz2EkslAmCwHwPYYlNfFWR7OnX8cV3qBev7oHjErI+b0a+eU+Sg1I0ciFxZH8wMpP3+Lqc 38dtIHI3fm9+I98uplsFD7shRhze4cPOXwrkWxm+x7jdz1+IazBsScAlqDWZXQ3mxMHtEGTCqIeu PCwvmpSAsIVv82LXcPp//4jn1YRFvliMpKAZ0YczGMj+WWgVbO9eDjBl6o1YqyqApOblsd1SMcWY DV2S0IdLRXDhr13bBIsYV5ZwjJFBHXdxh2KCUfPaSWerjnbDiySPFnbAk38h0o6Nuv6wkYSfS4Cb NT+W1shnBOaeDdph0feY5bovL8+6Hc9clySXH5hXao1b9MwbNOfo2m08/UHCUKJCyxejzjRbYUY5 foFYr6UqS0ZWZrGwHFyTDeWrpNFB2hJErW1o8LkkbrYT8whuU55H+Q+QtfByXp8UyVPiRrASRbj2 bHjTaDPXD7beeA5ZPXfGN2GH9Aew0= X-QQ-XMRINFO: NI4Ajvh11aEj8Xl/2s1/T8w= From: Eason Huang To: Eli Zaretskii Subject: Re: bug#78862: 31.0.50; Eglot couldn't refresh Flymake diagnostics on Rust project In-Reply-To: <86plewgqao.fsf@gnu.org> References: <86plewgqao.fsf@gnu.org> Date: Sun, 22 Jun 2025 19:27:56 +0800 X-OQ-MSGID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 78862 Cc: Spencer Baugh , 78862@debbugs.gnu.org, =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= 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.7 (/) Eli Zaretskii writes: >> From: Eason Huang >> Date: Sun, 22 Jun 2025 15:05:06 +0800 >>=20 >> Hello Emacs dev, >>=20 >> Recently, I found that if flymake-mode enabled before eglot,eglot can not >> refresh the Flymake diagnostics. >> Disable flymake with `M-x flymake-mode`, and then enable eglot >> with `M-x eglot` can fix the issue. Or with the below snippet can fix >> it: >>=20 >> ``` >> (with-eval-after-load 'eglot >> (add-hook 'eglot-managed-mode-hook (lambda () >> (flymake-mode -1) >> (flymake-mode 1)))) >>=20 >> ``` >>=20 >> Steps to reproduce: >>=20 >> 1. put below config into the init.el file >> ``` >> (use-package flymake >> :hook (prog-mode . flymake-mode)) >>=20 >> (use-package rust-mode >> :ensure t >> :defer t >> :custom (rust-mode-treesitter-derive (and (fboundp 'treesit-available-= p) >> (treesit-available-p)))) >> ``` >> 2. Start Emacs 31 >> 3. Open any Rust project with a dependency >> 4. Open any Rust file in a rust project(make sure it use a dependency), >> such as main.rs, then flymake will report errors. Because I don't have >> flymake rust backends,the errors is expected. >>=20=20=20 >> 5. Make sure `rust-analyzer` is in the PATH,My rust toolchain is as >> below: >>=20 >> ``` >> rustc --version >> rustc 1.87.0 (17067e9ac 2025-05-09) >>=20 >> rust-analyzer --version >> rust-analyzer 1.87.0 (17067e9ac6d 2025-05-09) >> `` >> 6. Start eglot with `M-x eglot`, now the errors still exist. This is the >> issue. >>=20 >> 7. `M-x flymake-mode` to disable flymake >> 8. `M-x eglot-reconnect` will refresh the Flymake diagnostics,and no >> errors reported if your Rust project is compiled. >>=20 >>=20 >> The issue only happened on Emacs 31, it works as expected on Emacs 30.= =20=20 > > Thanks, I hope Jo=C3=A3o and Spencer will have comments or suggestions > about this. > > > Hello Eli, Jo=C3=A3o and Spencer, I find out that it is related to `rust-ts-flymake-command`, when customize it's value to `'("cargo" "clippy")`, it works as expected. It works with below rust config: ``` (use-package rust-mode :defer t :custom (rust-mode-treesitter-derive (and (fboundp 'treesit-available-p) (treesit-available-p))) (rust-ts-flymake-command '("cargo" "clippy"))) ``` May be this information help. --=20 Eason Huang From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 05 03:28:59 2025 Received: (at 78862) by debbugs.gnu.org; 5 Jul 2025 07:28:59 +0000 Received: from localhost ([127.0.0.1]:39060 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uXxKU-0001Ej-QM for submit@debbugs.gnu.org; Sat, 05 Jul 2025 03:28:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37940) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uXxKR-0001Df-W3 for 78862@debbugs.gnu.org; Sat, 05 Jul 2025 03:28:57 -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 1uXxKM-00078m-3x; Sat, 05 Jul 2025 03:28:50 -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=imZdsg4I8+K2ED0kATMnBfwvGzIPr6kjS6+HqXOVIVk=; b=Nn/gYf2yOB/CDeI9lpMp kIQ5K3ZtMdc9rKdXi46Kn0a8M07KKInYkdtTOVFWsnfp88BLH6kKk9dZJmji6Uo5vXgfolFsAvpEw E7BAIC5kIvD5Dr/vYjX6VtP3EU3S2YcI38Mir171FPy5wUe75Og9+fNT0zeyW4Kg95SbobermlI2w +0XfBS2BERK2QZWJnZbYN++69UIvlFoXgZjoc7NN/N/Jz5j8DOdFvbLXc7+8xe+G/T9w9W1pAEOcn 3YxJe3D/E+gL7K12DEcde2WEDXkgrrSvm9ezOJTXv0CmFLkF3/0l24PnD+52yeHuIu1CDT38ytcul /PxaNOZx6orUHg==; Date: Sat, 05 Jul 2025 10:28:47 +0300 Message-Id: <8634bbxfio.fsf@gnu.org> From: Eli Zaretskii To: joaotavora@gmail.com, sbaugh@janestreet.com In-Reply-To: (message from Eason Huang on Sun, 22 Jun 2025 19:27:56 +0800) Subject: Re: bug#78862: 31.0.50; Eglot couldn't refresh Flymake diagnostics on Rust project References: <86plewgqao.fsf@gnu.org> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 78862 Cc: Eason Huang , 78862@debbugs.gnu.org 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! > From: Eason Huang > Cc: João Távora , Spencer Baugh > , 78862@debbugs.gnu.org > Date: Sun, 22 Jun 2025 19:27:56 +0800 > > Eli Zaretskii writes: > > >> From: Eason Huang > >> Date: Sun, 22 Jun 2025 15:05:06 +0800 > >> > >> Hello Emacs dev, > >> > >> Recently, I found that if flymake-mode enabled before eglot,eglot can not > >> refresh the Flymake diagnostics. > >> Disable flymake with `M-x flymake-mode`, and then enable eglot > >> with `M-x eglot` can fix the issue. Or with the below snippet can fix > >> it: > >> > >> ``` > >> (with-eval-after-load 'eglot > >> (add-hook 'eglot-managed-mode-hook (lambda () > >> (flymake-mode -1) > >> (flymake-mode 1)))) > >> > >> ``` > >> > >> Steps to reproduce: > >> > >> 1. put below config into the init.el file > >> ``` > >> (use-package flymake > >> :hook (prog-mode . flymake-mode)) > >> > >> (use-package rust-mode > >> :ensure t > >> :defer t > >> :custom (rust-mode-treesitter-derive (and (fboundp 'treesit-available-p) > >> (treesit-available-p)))) > >> ``` > >> 2. Start Emacs 31 > >> 3. Open any Rust project with a dependency > >> 4. Open any Rust file in a rust project(make sure it use a dependency), > >> such as main.rs, then flymake will report errors. Because I don't have > >> flymake rust backends,the errors is expected. > >> > >> 5. Make sure `rust-analyzer` is in the PATH,My rust toolchain is as > >> below: > >> > >> ``` > >> rustc --version > >> rustc 1.87.0 (17067e9ac 2025-05-09) > >> > >> rust-analyzer --version > >> rust-analyzer 1.87.0 (17067e9ac6d 2025-05-09) > >> `` > >> 6. Start eglot with `M-x eglot`, now the errors still exist. This is the > >> issue. > >> > >> 7. `M-x flymake-mode` to disable flymake > >> 8. `M-x eglot-reconnect` will refresh the Flymake diagnostics,and no > >> errors reported if your Rust project is compiled. > >> > >> > >> The issue only happened on Emacs 31, it works as expected on Emacs 30. > > > > Thanks, I hope João and Spencer will have comments or suggestions > > about this. > > > > > > > > > Hello Eli, João and Spencer, > > I find out that it is related to `rust-ts-flymake-command`, when > customize it's value to `'("cargo" "clippy")`, it works as expected. > > It works with below rust config: > > ``` > (use-package rust-mode > :defer t > :custom > (rust-mode-treesitter-derive (and (fboundp 'treesit-available-p) > (treesit-available-p))) > (rust-ts-flymake-command '("cargo" "clippy"))) > > ``` > > May be this information help. > > -- > Eason Huang > > From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 19 03:05:00 2025 Received: (at 78862) by debbugs.gnu.org; 19 Jul 2025 07:05:00 +0000 Received: from localhost ([127.0.0.1]:39121 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ud1cy-0000gy-3l for submit@debbugs.gnu.org; Sat, 19 Jul 2025 03:05:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58262) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ud1cv-0000gW-FM for 78862@debbugs.gnu.org; Sat, 19 Jul 2025 03:04:58 -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 1ud1cp-0007Lb-L9; Sat, 19 Jul 2025 03:04:51 -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=TYBNHAvaBq2MKe+aJOBNBe3xXNPxxAN2vT2zss3eoYA=; b=MEUyGhjpFIEE49XuBhH+ /+8/nGzXuIgexDHYhoCsAtX77cK6uEKdZoe1DvxYJy99S05SriGiuKr7QqDfjoQwNFToAvBnygVay v/IUH1qYPL1n3j1DXRbmc1h6Dfjo9U8XT+DDokJMdZDCK9ko7ZOZmrunMGDKza3iS6EoGB7xeMY2h PAv/gDDA+w2zH928SjkgyxnI9mH5YePPpOfycTA3QQzdg8nzfzp7/RQnqy3huxtwZ0o+mfMwC06dU BU/pplRHEIWAfBr655OON9vuYhXMSZ4WRinz6WOt6QeiL1SZeRurwvIpKjK8moHjibMcgr4416qun 1qot7xnh/7a9Mg==; Date: Sat, 19 Jul 2025 10:04:47 +0300 Message-Id: <861pqcfypc.fsf@gnu.org> From: Eli Zaretskii To: joaotavora@gmail.com, sbaugh@janestreet.com In-Reply-To: <8634bbxfio.fsf@gnu.org> (message from Eli Zaretskii on Sat, 05 Jul 2025 10:28:47 +0300) Subject: Re: bug#78862: 31.0.50; Eglot couldn't refresh Flymake diagnostics on Rust project References: <86plewgqao.fsf@gnu.org> <8634bbxfio.fsf@gnu.org> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 78862 Cc: aqua0210@foxmail.com, 78862@debbugs.gnu.org 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! Ping! João and Spencer, please respond. > Cc: Eason Huang , 78862@debbugs.gnu.org > Date: Sat, 05 Jul 2025 10:28:47 +0300 > From: Eli Zaretskii > > Ping! > > > From: Eason Huang > > Cc: João Távora , Spencer Baugh > > , 78862@debbugs.gnu.org > > Date: Sun, 22 Jun 2025 19:27:56 +0800 > > > > Eli Zaretskii writes: > > > > >> From: Eason Huang > > >> Date: Sun, 22 Jun 2025 15:05:06 +0800 > > >> > > >> Hello Emacs dev, > > >> > > >> Recently, I found that if flymake-mode enabled before eglot,eglot can not > > >> refresh the Flymake diagnostics. > > >> Disable flymake with `M-x flymake-mode`, and then enable eglot > > >> with `M-x eglot` can fix the issue. Or with the below snippet can fix > > >> it: > > >> > > >> ``` > > >> (with-eval-after-load 'eglot > > >> (add-hook 'eglot-managed-mode-hook (lambda () > > >> (flymake-mode -1) > > >> (flymake-mode 1)))) > > >> > > >> ``` > > >> > > >> Steps to reproduce: > > >> > > >> 1. put below config into the init.el file > > >> ``` > > >> (use-package flymake > > >> :hook (prog-mode . flymake-mode)) > > >> > > >> (use-package rust-mode > > >> :ensure t > > >> :defer t > > >> :custom (rust-mode-treesitter-derive (and (fboundp 'treesit-available-p) > > >> (treesit-available-p)))) > > >> ``` > > >> 2. Start Emacs 31 > > >> 3. Open any Rust project with a dependency > > >> 4. Open any Rust file in a rust project(make sure it use a dependency), > > >> such as main.rs, then flymake will report errors. Because I don't have > > >> flymake rust backends,the errors is expected. > > >> > > >> 5. Make sure `rust-analyzer` is in the PATH,My rust toolchain is as > > >> below: > > >> > > >> ``` > > >> rustc --version > > >> rustc 1.87.0 (17067e9ac 2025-05-09) > > >> > > >> rust-analyzer --version > > >> rust-analyzer 1.87.0 (17067e9ac6d 2025-05-09) > > >> `` > > >> 6. Start eglot with `M-x eglot`, now the errors still exist. This is the > > >> issue. > > >> > > >> 7. `M-x flymake-mode` to disable flymake > > >> 8. `M-x eglot-reconnect` will refresh the Flymake diagnostics,and no > > >> errors reported if your Rust project is compiled. > > >> > > >> > > >> The issue only happened on Emacs 31, it works as expected on Emacs 30. > > > > > > Thanks, I hope João and Spencer will have comments or suggestions > > > about this. > > > > > > > > > > > > > > > Hello Eli, João and Spencer, > > > > I find out that it is related to `rust-ts-flymake-command`, when > > customize it's value to `'("cargo" "clippy")`, it works as expected. > > > > It works with below rust config: > > > > ``` > > (use-package rust-mode > > :defer t > > :custom > > (rust-mode-treesitter-derive (and (fboundp 'treesit-available-p) > > (treesit-available-p))) > > (rust-ts-flymake-command '("cargo" "clippy"))) > > > > ``` > > > > May be this information help. > > > > -- > > Eason Huang > > > > > > > > From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 19 07:31:25 2025 Received: (at 78862) by debbugs.gnu.org; 19 Jul 2025 11:31:25 +0000 Received: from localhost ([127.0.0.1]:40627 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ud5mm-0007bd-US for submit@debbugs.gnu.org; Sat, 19 Jul 2025 07:31:25 -0400 Received: from mxout1.mail.janestreet.com ([38.105.200.78]:48817) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ud5mi-0007LP-7g for 78862@debbugs.gnu.org; Sat, 19 Jul 2025 07:31:22 -0400 Received: from mail-ej1-f72.google.com ([209.85.218.72]) by mxgoog2.mail.janestreet.com with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) (Exim 4.98.2) id 1ud5mc-0000000375J-0ux7 for 78862@debbugs.gnu.org; Sat, 19 Jul 2025 07:31:14 -0400 Received: by mail-ej1-f72.google.com with SMTP id a640c23a62f3a-ae0a3511145so235684366b.3 for <78862@debbugs.gnu.org>; Sat, 19 Jul 2025 04:31:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=google; t=1752924673; x=1753529473; 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=eC2O1jbjrw7JjXEuERY/Xd1AGYMF3djyPuPEDNQWixo=; b=dBYc9U4WE5VJ2BIUkgndJr/SfHxcmGkG76V5puAY4eJXxhO+MwjW2AdfRXZJkT5oDW C/TUUpGGV26tfoWA8vpT+6VKqQp2UrhE5wSLjfzpMOHqt/ofjKvfOUl4jUvIVnEac98O 1u6VEjfy9CXDdflB+t/s0JBx9sRdD70mk4rNI= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=waixah; t=1752924674; bh=eC2O1jbjrw7JjXEuERY/Xd1AGYMF3djyPuPEDNQWixo=; h=References:In-Reply-To:From:Date:Subject:To:Cc; b=SFt6NVtkxJlI3fEEOOxK/yGTwocDWdmoO0eYJ2Q7ztvs1Rim6D93NOXLdc7PZIyBE YCCQZV3VSLzkxW7Aits3vAguY59ZNO2uSTeQ+J+ElGGxh1PE8ZThNWxGlC0sHfPiMy JLW1WkhD4occGffwhVC+pju9c957vPbPrzpIyB0tdo19c8moyDfXxWu0Qjv30HJCmB 8guJu8Vv43xH8lJIFtN/BgDVRLLXIBwBS9h3lofg4QORBNLOLfH4W/AGlP6ryAfcom pQhO4lFMwSlXljXAeaJmk6UtEGElmaKwjQRMZEB9j1QUlhs9MOwlRDw2++2Hu4jQER 0WywvyAi8s+4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752924673; x=1753529473; 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=eC2O1jbjrw7JjXEuERY/Xd1AGYMF3djyPuPEDNQWixo=; b=b7lFIR4lPQGotlb5FwS7fKdxcG0aD6/CaiuI1Vyj+k2lIwwQiSJmCZCY9Ena3Fi6gL o5iHXQNSdDq+YIKGKcwxoxwjlzSj3E/4LgJnkOuWdgfMJTdnwZryD1kTx28wDlN1C+CL bTZsR5kox1ST10kQDTTTL4iCJlS+ZAR7IHatAn184toypEfhPUv5Dt4h150e8O1EMcIW vKAdLt28PXqEfDNYbp9T0cMmum37LjuU9jlgKWJfU4Or7NOGsd39AHzarXB+/fyLMvF9 7/c3qYA+DTne8UW+zRzrYTgcUhercq4s/Xv1pFIpDKZ+NLRzCaQhYDlKLhyChBp5O4jS 7/eA== X-Forwarded-Encrypted: i=1; AJvYcCVH3xf+9LYcwPmtgG2fbAhtqkZDbi4niZWpTja3+++JlINL7taLWCh+gOLq+M5A7IqaBZ4EzA==@debbugs.gnu.org X-Gm-Message-State: AOJu0YxdNzGKzDMwUb22nWM3HudYjwBnebTsKaBXn71JWtx3oF8WlQgg AEmhBGqfpC/jj79Bo7JkXHWNNytYd98aa0MedmX/w0kPRqAo1MDoFo4xO/WtWfNQgPNLQh6NfyU ooHweF7fFra4L8vzv6vS4jCCqwIe5tOFkLjHl80IkI2UEP7+xuKfaJ/FfQyAXXdb910RtrtC6hh ud8gxe7zAsJEf/zqhgWgu4mGPjrwTfIw== X-Gm-Gg: ASbGnctQr8XEcaVM5sYjOuHMYLvvQ3NLxA0gkoxZACr/xhaBDnJ+p8lkL5fyapkQiDC 0Qm/iC8p+LnZzECOyZ1TXI6zXJUHm7r4ANOwi+R9LrjkBXspXZ0pR/+f69EkHgnDhueVbtWjjIu s+m08uh3FXZmKkZy+VE+VzUxQmsFycJUMS6jLhHiJ2iA0Ek3UJHM3fxA== X-Received: by 2002:a17:907:f1ea:b0:ae0:aa0d:7bfa with SMTP id a640c23a62f3a-ae9c9b14746mr1384072366b.50.1752924673440; Sat, 19 Jul 2025 04:31:13 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEtqgBpqrbYGR/Bbo9xUHNX93ypWi4J4Ue+sZsZanFsC7d1ME58rR0el5p4rJ1CrQsp9GhzbC1/n+lBaaS83u4= X-Received: by 2002:a17:907:f1ea:b0:ae0:aa0d:7bfa with SMTP id a640c23a62f3a-ae9c9b14746mr1384070866b.50.1752924672986; Sat, 19 Jul 2025 04:31:12 -0700 (PDT) MIME-Version: 1.0 References: <86plewgqao.fsf@gnu.org> <8634bbxfio.fsf@gnu.org> <861pqcfypc.fsf@gnu.org> In-Reply-To: <861pqcfypc.fsf@gnu.org> From: Spencer Baugh Date: Sat, 19 Jul 2025 07:31:01 -0400 X-Gm-Features: Ac12FXwHHhMRHuxLfSluS91gJVin8LsFsNpeE3cEJBtpaxrhrW3XqrGjtzdyk8U Message-ID: Subject: Re: bug#78862: 31.0.50; Eglot couldn't refresh Flymake diagnostics on Rust project To: Eli Zaretskii Content-Type: multipart/alternative; boundary="00000000000073ac74063a46940c" X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 78862 Cc: aqua0210@foxmail.com, 78862@debbugs.gnu.org, =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= 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 (---) --00000000000073ac74063a46940c Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable I'm working on this. On Sat, Jul 19, 2025, 3:04=E2=80=AFAM Eli Zaretskii wrote: > Ping! Ping! Jo=C3=A3o and Spencer, please respond. > > > Cc: Eason Huang , 78862@debbugs.gnu.org > > Date: Sat, 05 Jul 2025 10:28:47 +0300 > > From: Eli Zaretskii > > > > Ping! > > > > > From: Eason Huang > > > Cc: Jo=C3=A3o T=C3=A1vora , Spencer Baugh > > > , 78862@debbugs.gnu.org > > > Date: Sun, 22 Jun 2025 19:27:56 +0800 > > > > > > Eli Zaretskii writes: > > > > > > >> From: Eason Huang > > > >> Date: Sun, 22 Jun 2025 15:05:06 +0800 > > > >> > > > >> Hello Emacs dev, > > > >> > > > >> Recently, I found that if flymake-mode enabled before eglot,eglot > can not > > > >> refresh the Flymake diagnostics. > > > >> Disable flymake with `M-x flymake-mode`, and then enable eglot > > > >> with `M-x eglot` can fix the issue. Or with the below snippet can > fix > > > >> it: > > > >> > > > >> ``` > > > >> (with-eval-after-load 'eglot > > > >> (add-hook 'eglot-managed-mode-hook (lambda () > > > >> (flymake-mode -1) > > > >> (flymake-mode 1)))) > > > >> > > > >> ``` > > > >> > > > >> Steps to reproduce: > > > >> > > > >> 1. put below config into the init.el file > > > >> ``` > > > >> (use-package flymake > > > >> :hook (prog-mode . flymake-mode)) > > > >> > > > >> (use-package rust-mode > > > >> :ensure t > > > >> :defer t > > > >> :custom (rust-mode-treesitter-derive (and (fboundp > 'treesit-available-p) > > > >> (treesit-available-p))= )) > > > >> ``` > > > >> 2. Start Emacs 31 > > > >> 3. Open any Rust project with a dependency > > > >> 4. Open any Rust file in a rust project(make sure it use a > dependency), > > > >> such as main.rs, then flymake will report errors. Because I don't > have > > > >> flymake rust backends,the errors is expected. > > > >> > > > >> 5. Make sure `rust-analyzer` is in the PATH,My rust toolchain is a= s > > > >> below: > > > >> > > > >> ``` > > > >> rustc --version > > > >> rustc 1.87.0 (17067e9ac 2025-05-09) > > > >> > > > >> rust-analyzer --version > > > >> rust-analyzer 1.87.0 (17067e9ac6d 2025-05-09) > > > >> `` > > > >> 6. Start eglot with `M-x eglot`, now the errors still exist. This > is the > > > >> issue. > > > >> > > > >> 7. `M-x flymake-mode` to disable flymake > > > >> 8. `M-x eglot-reconnect` will refresh the Flymake diagnostics,and = no > > > >> errors reported if your Rust project is compiled. > > > >> > > > >> > > > >> The issue only happened on Emacs 31, it works as expected on Emacs > 30. > > > > > > > > Thanks, I hope Jo=C3=A3o and Spencer will have comments or suggesti= ons > > > > about this. > > > > > > > > > > > > > > > > > > > > > Hello Eli, Jo=C3=A3o and Spencer, > > > > > > I find out that it is related to `rust-ts-flymake-command`, when > > > customize it's value to `'("cargo" "clippy")`, it works as expected. > > > > > > It works with below rust config: > > > > > > ``` > > > (use-package rust-mode > > > :defer t > > > :custom > > > (rust-mode-treesitter-derive (and (fboundp 'treesit-available-p) > > > (treesit-available-p))) > > > (rust-ts-flymake-command '("cargo" "clippy"))) > > > > > > ``` > > > > > > May be this information help. > > > > > > -- > > > Eason Huang > > > > > > > > > > > > > > > --00000000000073ac74063a46940c Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I'm working on this.

On Sat, Jul= 19, 2025, 3:04=E2=80=AFAM Eli Zaretskii <eliz@gnu.org> wrote:
Ping!= Ping! Jo=C3=A3o and Spencer, please respond.

> Cc: Eason Huang <aqua0210@foxmail.com>, 78862@debbugs.g= nu.org
> Date: Sat, 05 Jul 2025 10:28:47 +0300
> From: Eli Zaretskii <eliz@gnu.org>
>
> Ping!
>
> > From: Eason Huang <aqua0210@foxmail.com>
> > Cc: Jo=C3=A3o T=C3=A1vora <joaotavora@gmail.com>,=C2= =A0 Spencer Baugh
> >=C2=A0 <sbaugh@janestreet.com>,=C2=A0 78862@debbug= s.gnu.org
> > Date: Sun, 22 Jun 2025 19:27:56 +0800
> >
> > Eli Zaretskii <eliz@gnu.org> writes:
> >
> > >> From: Eason Huang <aqua0210@foxmail.com>
> > >> Date: Sun, 22 Jun 2025 15:05:06 +0800
> > >>
> > >> Hello Emacs dev,
> > >>
> > >> Recently, I found that if flymake-mode enabled before eg= lot,eglot can not
> > >> refresh the Flymake diagnostics.
> > >> Disable flymake with `M-x flymake-mode`, and then enable= eglot
> > >> with `M-x eglot` can fix the issue. Or with the below sn= ippet can fix
> > >> it:
> > >>
> > >> ```
> > >> (with-eval-after-load 'eglot
> > >>=C2=A0 =C2=A0 =C2=A0(add-hook 'eglot-managed-mode-hoo= k (lambda ()
> > >>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 (flymake-mode -1)
> > >>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 (flymake-mode 1))))
> > >>
> > >> ```
> > >>
> > >> Steps to reproduce:
> > >>
> > >> 1. put below config into the init.el file
> > >> ```
> > >> (use-package flymake
> > >>=C2=A0 =C2=A0:hook (prog-mode . flymake-mode))
> > >>
> > >> (use-package rust-mode
> > >>=C2=A0 =C2=A0:ensure t
> > >>=C2=A0 =C2=A0:defer t
> > >>=C2=A0 =C2=A0:custom (rust-mode-treesitter-derive (and (f= boundp 'treesit-available-p)
> > >>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(treesit-available-p))))
> > >> ```
> > >> 2. Start Emacs 31
> > >> 3. Open any Rust project with a dependency
> > >> 4. Open any Rust file in a rust project(make sure it use= a dependency),
> > >> such as main.rs, then flymake will report errors. Be= cause I don't have
> > >> flymake rust backends,the errors is expected.
> > >>=C2=A0 =C2=A0
> > >> 5. Make sure `rust-analyzer` is in the PATH,My rust tool= chain is as
> > >> below:
> > >>
> > >> ```
> > >> rustc --version
> > >> rustc 1.87.0 (17067e9ac 2025-05-09)
> > >>
> > >> rust-analyzer --version
> > >> rust-analyzer 1.87.0 (17067e9ac6d 2025-05-09)
> > >> ``
> > >> 6. Start eglot with `M-x eglot`, now the errors still ex= ist. This is the
> > >> issue.
> > >>
> > >> 7. `M-x flymake-mode` to disable flymake
> > >> 8. `M-x eglot-reconnect` will refresh the Flymake diagno= stics,and no
> > >> errors reported if your Rust project is compiled.
> > >>
> > >>
> > >> The issue only happened on Emacs 31, it works as expecte= d on Emacs 30.=C2=A0
> > >
> > > Thanks, I hope Jo=C3=A3o and Spencer will have comments or s= uggestions
> > > about this.
> > >
> >
> > >
> > >
> >
> > Hello Eli, Jo=C3=A3o and Spencer,
> >
> > I find out that it is related to `rust-ts-flymake-command`, when<= br> > > customize it's value to `'("cargo" "clippy= ")`, it works as expected.
> >
> > It works with below rust config:
> >
> > ```
> > (use-package rust-mode
> >=C2=A0 =C2=A0:defer t
> >=C2=A0 =C2=A0:custom
> >=C2=A0 =C2=A0(rust-mode-treesitter-derive (and (fboundp 'trees= it-available-p)
> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(treesit-= available-p)))
> >=C2=A0 =C2=A0(rust-ts-flymake-command '("cargo" &quo= t;clippy")))
> >
> > ```
> >
> > May be this information help.
> >
> > --
> > Eason Huang
> >
> >
>
>
>
>
--00000000000073ac74063a46940c-- From debbugs-submit-bounces@debbugs.gnu.org Wed Jul 23 12:53:38 2025 Received: (at 78862) by debbugs.gnu.org; 23 Jul 2025 16:53:38 +0000 Received: from localhost ([127.0.0.1]:51470 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uecin-0004t2-Hi for submit@debbugs.gnu.org; Wed, 23 Jul 2025 12:53:38 -0400 Received: from mail-qt1-x82b.google.com ([2607:f8b0:4864:20::82b]:53269) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1uecik-0004se-MJ for 78862@debbugs.gnu.org; Wed, 23 Jul 2025 12:53:35 -0400 Received: by mail-qt1-x82b.google.com with SMTP id d75a77b69052e-4ab8403b6daso1068191cf.2 for <78862@debbugs.gnu.org>; Wed, 23 Jul 2025 09:53:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1753289609; x=1753894409; darn=debbugs.gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=mhJdR/4wJ6ytXWx4WInhIa+eWOzmbWj3PyPolx9LwpY=; b=JK94k8bXTiGf2tDt6ihRxCD6w4I4iOMYOXGfkk6s5GudoA6hKzY9bTtMsfALioj+dP tGlGNbwCXt12WBy3pKBKjnXeRGKVh/fY68qmSWDjmWhLllfjOEr69b9qBiGR3sLMv7Jy O5VVsmAXNTxhskHp4xlkPQhB4/q0hWn6UywJGKlcG8RNFVqsLMk2kTNcxVDLqT0C4ej4 nVXaJ6wM9Xxadg6dJjXT7nVQC09R0xqq7sIavY9byZZdgVidkJ8CdupQTtsPkrAZLmGR FFF9ZLEG+8k+le9Bw0PIPH0OWXxojwJUMcAIXVEqw0koi0DWKtygA6HDbB58bxgSz4l4 RoGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1753289609; x=1753894409; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=mhJdR/4wJ6ytXWx4WInhIa+eWOzmbWj3PyPolx9LwpY=; b=GrktuEfRc6pheDMDHRREhyj68yP1J/HVDu0/6qk3U0BHb8BW9/PjrHUhveUp5SyoFO Z6HWl9arU559ghRO3dudO8GHHDDQWeSprjGOxehugclghDJIifghn1nbhNp4MyzqllTH MmdVWXEDUPR0MWdJXtIVSAm+V1EhRNaJAv/abT4oZURlFa/fSEcuMPI5s6k1vCj4bvks qe5MByM4UVrRVx+DylcwPyJmRMxin1H+uRPh+Ju5EXGdOFiO769rjCT+i2YNM4TRWIQA 0gFOOhlYgcAev0ofsby9tsE16G0b0N/ac60iIlessjUtkdsZ7PVHLUVDcGNih/6EfEI4 9BLg== X-Gm-Message-State: AOJu0Yxl/eO9i8VyibMAIZEa9UP/KgLYouq6du7HeL2fKMVN1GXE3Rk+ dNXl4kXnCj+onHNroczqyjkFHWHtAzPvp1T4PCGau+RvhMTcys7Zt3ap X-Gm-Gg: ASbGncv5aUpX43/5ZYC9wRbK9xU6EfppVHRLz5FR8pWiPM/dbfsbCekm98QxATN51dO x6KPhXED7XJ7lwEDBjIfnE0gSQPikwcgb0IMAunwGarr1iQopdWiGony1vKFElf7CGYkqDoRaqJ QSzAmSbbuxEyS5MZRA+BMfLyPVdhN4+9H+w9IxSNqQ7LW2Um0H3shRcg7fgyTipTyuRx+p6Fsks 0tizSGorgYULx6FxrT7zElp5rkbO9UMECPBZ7AUNZOfimypmlDkA6zI8H+2lQphU/oK+nTrr66V 0MPchXHutq07ghJF6PA3fwnon37WOLs+KfGS4Oyuoo+Bck1pX70s3BPGFtXopNe76IrsZM8d8Yx Jw+8+5v6kTISjxqLrs43jp5s= X-Google-Smtp-Source: AGHT+IEqXQGoXFzFLOBrW4xOyioK/2CvNyX2ccparsF3qW/+IfRph/crpJ8ld1PXyfn6c8SJVk4s5A== X-Received: by 2002:a05:622a:259b:b0:4aa:a5c8:8645 with SMTP id d75a77b69052e-4ae6de72ed1mr42694441cf.22.1753289608836; Wed, 23 Jul 2025 09:53:28 -0700 (PDT) Received: from localhost ([96.224.136.38]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-4abb49801c2sm70591911cf.8.2025.07.23.09.53.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Jul 2025 09:53:28 -0700 (PDT) From: matthewktromp@gmail.com To: Eason Huang , Eli Zaretskii , Spencer Baugh , =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= Subject: Re: bug#78862: 31.0.50; Eglot couldn't refresh Flymake diagnostics on Rust project In-Reply-To: (Eason Huang's message of "Sun, 22 Jun 2025 19:27:56 +0800") References: <86plewgqao.fsf@gnu.org> Date: Wed, 23 Jul 2025 12:53:27 -0400 Message-ID: <857bzy4znc.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 78862 Cc: 78862@debbugs.gnu.org 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 (-) --=-=-= Content-Type: text/plain I ran a git bisect and found that commit 0ff82eb48725e15bb87a75d4f937b75c2482c59b appears to be the first commit to exhibit this behavior, although I'm not entirely sure why. It was a fix for bug #69809. My understanding is this: every time flymake recomputes diagnostics (e.g. on file save), it queries all of the backends in `flymake-diagnostic-functions' to get new diagnostics. When it gets new diagnostics from a backend, it goes through the buffer, removes all the existing diagnostics produced by that backend, and inserts the new diagnostics that it just got. Before running eglot, `flymake-diagnostic-functions' is equal to (rust-ts-flymake t) (I'm not sure what the significance of the t is). When you start eglot, this line in `eglot--managed-mode' replaces the value of flymake-diagnostic-functions: (eglot--setq-saving flymake-diagnostic-functions '(eglot-flymake-backend)) Then it has flymake refresh its diagnostics. Since rust-ts-flymake is no longer in flymake-diagnostic-functions, flymake doesn't request any new diagnostics from it. But since flymake only deletes the existing overlays for a diagnostics backend when that backend provides new diagnostics, those diagnostics never get removed. The attached patch fixes this by adding code to flymake-start which goes through flymake--state and removes all diagnostics and their overlays from any backend which is no longer in flymake-diagnostic-functions. I also noticed a related (but less serious) bug here: after opening a rust buffer, running rust-ts-mode, then eglot, if you stop eglot with eglot-shutdown or something, all the eglot diagnostics in the buffer are removed, but the rust-ts-flymake diagnostics don't come back until you do something to trigger flymake-start (like save the buffer). Eason Huang writes: > I find out that it is related to `rust-ts-flymake-command`, when > customize it's value to `'("cargo" "clippy")`, it works as expected. > > It works with below rust config: > > ``` > (use-package rust-mode > :defer t > :custom > (rust-mode-treesitter-derive (and (fboundp 'treesit-available-p) > (treesit-available-p))) > (rust-ts-flymake-command '("cargo" "clippy"))) > > ``` > > May be this information help. This gets rid of the initial errors from rust-ts-flymake, which may be spurrious. I'm not sure. Maybe this should be the default for rust-ts-flymake-command? Either way, I think a patch like what I've written is necessary to solve this general problem. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Delete-overlays-from-backends-that-no-longer-exist.patch >From a2d10fc6d17e1ba3517868a3bb70c162b73bf9f8 Mon Sep 17 00:00:00 2001 From: Matthew Tromp Date: Wed, 23 Jul 2025 12:44:46 -0400 Subject: [PATCH] Delete overlays from backends that no longer exist Fix for bug#78862: previously, when starting eglot, existing flymake diagnostics in the buffer would persist until flymake was completely restarted (like by running flymake-mode twice). This change adds logic to flymake-start to delete all diagnostics and their overlays from any backend that is no longer in flymake-diagnostic-functions. * lisp/progmodes/flymake.el (flymake-start): remove overlays from backends that no longer exist --- lisp/progmodes/flymake.el | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el index e911faf603d..bdfcf51a5ff 100644 --- a/lisp/progmodes/flymake.el +++ b/lisp/progmodes/flymake.el @@ -1406,6 +1406,26 @@ flymake-start (cl-reduce #'max (mapcar #'cadr flymake--recent-changes)))))) (setq flymake--recent-changes nil) + ;; Delete all overlays that didn't come from one of the + ;; current diagnostic functions. + ;; Sometimes diagnostic functions are removed from + ;; `flymake-diagnostic-functions' (e.g. by eglot). This + ;; leaves overlays in the buffer which otherwise won't be + ;; cleaned up until `flymake-mode' is restarted. + ;; See bug#78862 + (maphash (lambda (backend state) + (unless (memq backend flymake-diagnostic-functions) + ;; Delete all overlays + (dolist (diag (flymake--state-diags state)) + (let ((ov (flymake--diag-overlay diag))) + (flymake--delete-overlay ov))) + ;; Set the list of diagnostics to nil to + ;; avoid trying to delete them again. + ;; We keep the state object itself around in + ;; case there's still diagnostics in flight, + ;; so we don't break things. + (setf (flymake--state-diags state) nil))) + flymake--state) (run-hook-wrapped 'flymake-diagnostic-functions (lambda (backend) -- 2.31.1 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Wed Jul 23 20:40:04 2025 Received: (at 78862) by debbugs.gnu.org; 24 Jul 2025 00:40:04 +0000 Received: from localhost ([127.0.0.1]:52945 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uek0B-0005B2-4h for submit@debbugs.gnu.org; Wed, 23 Jul 2025 20:40:04 -0400 Received: from mail-oa1-x2b.google.com ([2001:4860:4864:20::2b]:59421) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1uek09-0005AC-6y for 78862@debbugs.gnu.org; Wed, 23 Jul 2025 20:40:01 -0400 Received: by mail-oa1-x2b.google.com with SMTP id 586e51a60fabf-2eff5d1c7efso376037fac.2 for <78862@debbugs.gnu.org>; Wed, 23 Jul 2025 17:40:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1753317595; x=1753922395; 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=eOduSuS9UxKd91AVK76xWFuy16xXqgwyWZ2Y/4SJOL8=; b=XdiZ1V8toRjBBVT8KVt3u/llUonyIzBBwsT+MyKn+mYBa7mb369qUGfQKFlszoYjsx BPoaCWm16Vv2hc/f8byjG+w+5FUG3Jh+Xk7bMLWshbR9MatyGI6Uytq2ikgVOy25ldMx Bm6WYMyoIi8iFgzEx7rusBXvEutrLxxU+6peIam0DfPR2cwsGN7yq9eOxuDShW0bINfo p7WKWrGIAxS4nVirTWY8nS/iWYft5m9O9Sh6A7CcRuS+ikDmQN5Lmu/48ivHK+YWX/O8 7LywA0RsCMPUsSc1pXeZRmiJNTPAEhg8aKxhoQuMVqwvkUOFoR5WO8VuB4wpqGZj04op dVQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1753317595; x=1753922395; 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=eOduSuS9UxKd91AVK76xWFuy16xXqgwyWZ2Y/4SJOL8=; b=RvQRv78ja+/iq7M/WYkowkU7tqRpmN4yRykDa/9Uagv0iGf6vacpN+G+J/xmHZSf5D 09azJelkf5hZYMaGV6JGh8gXY/0HVwGCZcEV4VC34JzmmBaZVzgMSwAKGME0+3xL+blk dK4yPzZMlhqMgVHJeA5jlON8eDL4FfZ12cXi9M64Ez3ctK9/BP+fpDflNpXnjuZGkD4N hqR8yh1AwUVpmzBHI8k7M+48Wv1tgqpa9oKpJj1dCP9onBqDf+ir3+yZpbSB6OkkA8JU tZX4iUFuZUDbIdbsna1gzVAQLHdJt5yKofXbhVJaX3KgoLIz85NcHb4tnmiBi+9x8t6W vsLA== X-Forwarded-Encrypted: i=1; AJvYcCX7XvW45/8SNsQ78SRufYHxnI8pZAmiREvfcLGLVy/SxSyumsQ2zEu9aOa1HJF4DIKJu0BWoQ==@debbugs.gnu.org X-Gm-Message-State: AOJu0YxF1hUOhmRlmhreoW1VWJgy38tAsO+zuv8wucrdO8ZIUCxy58Pa 6lqhrbH/29BvxArq9ewXTah/bVZn/gSZJCgjsDQ7SxsyRohWgn6P5EM5BKsToRCqdaiZL//Ffun kjZPTvJ1WoZcUSA3qN6hEWv4UvJIdHiI= X-Gm-Gg: ASbGncuk0d/gPDUH1U7BHqoCC1vFE/Xm0D9hXUsVhRbm3AEgyjiLShWgniH85y1UYsF Dza7KQLZbzV4GFMrlEjeYIKlXBhBguNUVjB6AFIUPPVmgFD/u2gNLzLT8Pha7mOcbHW/TzC+37X pHTzpOi97qAz4BTDy7p8hi5TK7UhX7DvAmrMGmv5k2gcyBq7mRhIRbKQ0JpIqnLHMFVs7KAv1rV nBZBm/KJzSz2zGk X-Google-Smtp-Source: AGHT+IH5jVKPEnbBmVJqWyZsQqhLbKn/P+tLYsCAZGeyStd7C83oiWfpH6CZxh+pbuW6wnNEtj57kwkYAkPSayKm/cY= X-Received: by 2002:a05:6871:8ab:b0:2bc:7811:5bb8 with SMTP id 586e51a60fabf-306c72a0d1fmr3338035fac.18.1753317595051; Wed, 23 Jul 2025 17:39:55 -0700 (PDT) MIME-Version: 1.0 References: <86plewgqao.fsf@gnu.org> <857bzy4znc.fsf@gmail.com> In-Reply-To: <857bzy4znc.fsf@gmail.com> From: =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= Date: Thu, 24 Jul 2025 01:40:42 +0100 X-Gm-Features: Ac12FXwtbbEcc45xp-z8iGTBE1k3iR33aA1oUuHzxg6bi0PysI83W7q7zd9Df98 Message-ID: Subject: Re: bug#78862: 31.0.50; Eglot couldn't refresh Flymake diagnostics on Rust project To: matthewktromp@gmail.com Content-Type: multipart/alternative; boundary="0000000000006e7ae9063aa21013" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 78862 Cc: Spencer Baugh , Eason Huang , 78862@debbugs.gnu.org, Eli Zaretskii 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 (-) --0000000000006e7ae9063aa21013 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Jul 23, 2025 at 5:53=E2=80=AFPM wrote: > > I ran a git bisect and found that commit > 0ff82eb48725e15bb87a75d4f937b75c2482c59b appears to be the first commit > to exhibit this behavior, although I'm not entirely sure why. That would probably be the change that I called: (flymake-mode): Don't nuke overlays here. > My understanding is this: every time flymake recomputes diagnostics > (e.g. on file save), it queries all of the backends in > `flymake-diagnostic-functions' to get new diagnostics. When it gets new > diagnostics from a backend, it goes through the buffer, removes all the > existing diagnostics produced by that backend, and inserts the new > diagnostics that it just got. > > Before running eglot, `flymake-diagnostic-functions' is equal to > (rust-ts-flymake t) (I'm not sure what the significance of the t is). The t means "this is a local value of the hook, but run the functions in the global hook in this position". That's because flymake-diagnostic-functions is a hook variable (execute with run-hooks). > When you start eglot, this line in `eglot--managed-mode' replaces the > > value of flymake-diagnostic-functions: > (eglot--setq-saving flymake-diagnostic-functions '(eglot-flymake-backend)= ) > Then it has flymake refresh its diagnostics. Since rust-ts-flymake is > no longer in flymake-diagnostic-functions, flymake doesn't request any > new diagnostics from it. Well done! Thanks for the diagnosis. I understand it now. > The attached patch fixes this by adding code to flymake-start which goes > through flymake--state and removes all diagnostics and their overlays > from any backend which is no longer in flymake-diagnostic-functions. This patch isn't bad, though I think it's missing a `flymake--clear-foreign-diags` for completeness. However, the point -- at least the point in time -- where flymake-diagnostic-functions is hacked by Eglot seems like a better place to do the cleanup. I've never used them, but I think we have so-called variable watchers in recent Emacsen. They probably get the before and after values of a touched variable. I wonder if using one of these things for flymake-diagnostic-functions wouldn't be cleaner than adding this "paranoia" to all invocations of flymake-start. Another option is to tell clients of this particular Flymake entry point, like Eglot, that messing with flymake-diagnostic-functions while Flymake is on involves shutting it down and up again, or calling some "cleanup" entry point. As a workaround, users affected by this can probably add 'flymake' to 'eglot-stay-out-of' and _keep_ both Flymake backends Jo=C3=A3o --0000000000006e7ae9063aa21013 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Wed, Jul 23, 2025 at 5:53=E2=80=AFPM <matthewktromp@gmail.com> wrote:
>=
> I ran a git bisect and found that commit
> 0ff82eb48725e15bb= 87a75d4f937b75c2482c59b appears to be the first commit
> to exhibit t= his behavior, although I'm not entirely sure why.

That would pr= obably be the change that I called:

=C2=A0 =C2=A0 =C2=A0(flymake-mod= e): Don't nuke overlays here.

> My understanding is this: eve= ry time flymake recomputes diagnostics
> (e.g. on file save), it quer= ies all of the backends in
> `flymake-diagnostic-functions' to ge= t new diagnostics.=C2=A0 When it gets new
> diagnostics from a backen= d, it goes through the buffer, removes all the
> existing diagnostics= produced by that backend, and inserts the new
> diagnostics that it = just got.
>
> Before running eglot, `flymake-diagnostic-functio= ns' is equal to
> (rust-ts-flymake t) (I'm not sure what the = significance of the t is).

The t means "this is a local value o= f the hook, but run the functions
in the global hook in this position&q= uot;.=C2=A0 That's because
flymake-diagnostic-functions is a hook v= ariable (execute with run-hooks).
=C2=A0
> When you start eglot, t= his line in `eglot--managed-mode' replaces the
>
> value of= flymake-diagnostic-functions:
> (eglot--setq-saving flymake-diagnost= ic-functions '(eglot-flymake-backend))
> Then it has flymake refr= esh its diagnostics.=C2=A0 Since rust-ts-flymake is
> no longer in fl= ymake-diagnostic-functions, flymake doesn't request any
> ne= w diagnostics from it.=C2=A0

Well done! Thanks for= the diagnosis.=C2=A0 I understand it now.

> The att= ached patch fixes this by adding code to flymake-start which goes
> t= hrough flymake--state and removes all diagnostics and their overlays
>= ; from any backend which is no longer in flymake-diagnostic-functions.
<= div>
This patch isn't bad, though I think it's missin= g a `flymake--clear-foreign-diags`
for completeness.=C2=A0 Howeve= r, the point -- at least the point in time -- where=C2=A0=C2=A0
f= lymake-diagnostic-functions is hacked=C2=A0by Eglot seems like a better pla= ce
to do the cleanup.=C2=A0 I've never used them, but I think= we have so-called variable=C2=A0
watchers in recent Emacsen.=C2= =A0 They probably get the before and after values
of a touched va= riable.=C2=A0 I wonder if using one of these things for=C2=A0
fly= make-diagnostic-functions wouldn't be cleaner than adding
thi= s "paranoia" to all invocations of flymake-start.=C2=A0=C2=A0

Another option is to tell clients of this particular = Flymake entry point,=C2=A0
like=C2=A0 Eglot, that messing with fl= ymake-diagnostic-functions while=C2=A0
Flymake is=C2=A0on involve= s shutting it down and up again, or calling=C2=A0
some "clea= nup" entry=C2=A0point.

As a workaround, users= affected by this can probably add 'flymake' to=C2=A0
= 9;eglot-stay-out-of' and _keep_ both Flymake backends

Jo=C3=A3o
--0000000000006e7ae9063aa21013-- From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 02 10:01:18 2025 Received: (at 78862) by debbugs.gnu.org; 2 Aug 2025 14:01:18 +0000 Received: from localhost ([127.0.0.1]:36734 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uiCnV-00029Z-Qa for submit@debbugs.gnu.org; Sat, 02 Aug 2025 10:01:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47558) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uiCnT-0001vY-Fm for 78862@debbugs.gnu.org; Sat, 02 Aug 2025 10:01:16 -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 1uiCnN-00067x-Ja; Sat, 02 Aug 2025 10:01: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=Ax/ISUdLAZuT4j5FyG7McWvHl9005Mo58AnjY7+MMcE=; b=MpO0dfRyff1IJF/LXu5C KaXbrOR9DMJD/ezRU21OKUooVcSGcqdC1f6O0tvDcGSs7DGBRX+gzLDXQ/B67AB0SYpaMRvT/Dl9I In3JdudwT63NsGQZM+KroNr7ZalMFDy7HjIGpVsJDtiEfMdxqa0+KOjf+usQ+3/WQQQrf398yRHYa QYJrygJTyMGWTPwv3J6OKmTLq0kPzqJ3k/aPnwE6YzsYhBOrciLGGjPXP9PqrPgXwf6gb6XiKxC7I PRi7u7a9inok/f4K60fEbmK0aJUoSXV6lPxubBlb+g6zlnX1wfSceiWJVFa+4H/Lp5cE3vWZQcK4X MHuRLfwbQbGwxg==; Date: Sat, 02 Aug 2025 17:01:05 +0300 Message-Id: <86tt2prffi.fsf@gnu.org> From: Eli Zaretskii To: =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= In-Reply-To: (message from =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= on Thu, 24 Jul 2025 01:40:42 +0100) Subject: Re: bug#78862: 31.0.50; Eglot couldn't refresh Flymake diagnostics on Rust project References: <86plewgqao.fsf@gnu.org> <857bzy4znc.fsf@gmail.com> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 78862 Cc: sbaugh@janestreet.com, aqua0210@foxmail.com, 78862@debbugs.gnu.org, matthewktromp@gmail.com 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! Can we make some further progress with this issue? > From: João Távora > Date: Thu, 24 Jul 2025 01:40:42 +0100 > Cc: Eason Huang , Eli Zaretskii , > Spencer Baugh , 78862@debbugs.gnu.org > > On Wed, Jul 23, 2025 at 5:53 PM wrote: > > > > I ran a git bisect and found that commit > > 0ff82eb48725e15bb87a75d4f937b75c2482c59b appears to be the first commit > > to exhibit this behavior, although I'm not entirely sure why. > > That would probably be the change that I called: > > (flymake-mode): Don't nuke overlays here. > > > My understanding is this: every time flymake recomputes diagnostics > > (e.g. on file save), it queries all of the backends in > > `flymake-diagnostic-functions' to get new diagnostics. When it gets new > > diagnostics from a backend, it goes through the buffer, removes all the > > existing diagnostics produced by that backend, and inserts the new > > diagnostics that it just got. > > > > Before running eglot, `flymake-diagnostic-functions' is equal to > > (rust-ts-flymake t) (I'm not sure what the significance of the t is). > > The t means "this is a local value of the hook, but run the functions > in the global hook in this position". That's because > flymake-diagnostic-functions is a hook variable (execute with run-hooks). > > > When you start eglot, this line in `eglot--managed-mode' replaces the > > > > value of flymake-diagnostic-functions: > > (eglot--setq-saving flymake-diagnostic-functions '(eglot-flymake-backend)) > > Then it has flymake refresh its diagnostics. Since rust-ts-flymake is > > no longer in flymake-diagnostic-functions, flymake doesn't request any > > new diagnostics from it. > > Well done! Thanks for the diagnosis. I understand it now. > > > The attached patch fixes this by adding code to flymake-start which goes > > through flymake--state and removes all diagnostics and their overlays > > from any backend which is no longer in flymake-diagnostic-functions. > > This patch isn't bad, though I think it's missing a `flymake--clear-foreign-diags` > for completeness. However, the point -- at least the point in time -- where > flymake-diagnostic-functions is hacked by Eglot seems like a better place > to do the cleanup. I've never used them, but I think we have so-called variable > watchers in recent Emacsen. They probably get the before and after values > of a touched variable. I wonder if using one of these things for > flymake-diagnostic-functions wouldn't be cleaner than adding > this "paranoia" to all invocations of flymake-start. > > Another option is to tell clients of this particular Flymake entry point, > like Eglot, that messing with flymake-diagnostic-functions while > Flymake is on involves shutting it down and up again, or calling > some "cleanup" entry point. > > As a workaround, users affected by this can probably add 'flymake' to > 'eglot-stay-out-of' and _keep_ both Flymake backends > > João