From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Spencer Baugh Newsgroups: gmane.emacs.bugs Subject: bug#69809: 30.0.50; flymake: error in process sentinel Date: Tue, 16 Jul 2024 16:48:25 -0400 Message-ID: References: <867chv3mtf.fsf@gnu.org> <87le696o86.fsf@catern.com> <86v81bktv5.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4452"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: gerd.moellmann@gmail.com, sbaugh@catern.com, Eshel Yaron , 69809@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jul 16 22:49:20 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sTp6u-0000wd-GI for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 16 Jul 2024 22:49:20 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sTp6c-0006Xc-8T; Tue, 16 Jul 2024 16:49:02 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sTp6Z-0006Wa-SH for bug-gnu-emacs@gnu.org; Tue, 16 Jul 2024 16:48:59 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sTp6Z-0007Re-FM for bug-gnu-emacs@gnu.org; Tue, 16 Jul 2024 16:48:59 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sTp6c-0003US-5W for bug-gnu-emacs@gnu.org; Tue, 16 Jul 2024 16:49:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Spencer Baugh Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 16 Jul 2024 20:49:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69809 X-GNU-PR-Package: emacs Original-Received: via spool by 69809-submit@debbugs.gnu.org id=B69809.172116291713381 (code B ref 69809); Tue, 16 Jul 2024 20:49:02 +0000 Original-Received: (at 69809) by debbugs.gnu.org; 16 Jul 2024 20:48:37 +0000 Original-Received: from localhost ([127.0.0.1]:34490 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sTp6C-0003Tl-Hv for submit@debbugs.gnu.org; Tue, 16 Jul 2024 16:48:36 -0400 Original-Received: from mxout6.mail.janestreet.com ([64.215.233.21]:45981) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sTp6A-0003TU-ER for 69809@debbugs.gnu.org; Tue, 16 Jul 2024 16:48:35 -0400 In-Reply-To: <86v81bktv5.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 12 Jul 2024 09:27:26 +0300") DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=waixah; t=1721162905; bh=QM7MVJWEDDDRHwEaLWSciO7oJMvhhrq8jhqd1n4z0dc=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=fz6z/7ewd0+xJ7hOS/UULY327WSlvbSk2/jY9UfTcv7nIL058lUcsyzp7BJOVUMkE 2YI/wBbWcF3/O4qJR146jvmzOOPAhJ/aMj9R7sPNoogWeHohX0zKkrmCqZlvWvbsZH tnk7SAPqAMTzvyIeTZpgpM5K9MF7Yl3WEzdRXOJtmZMG9VaSfEx5pitDY4US+XWFEY PGncMU8aDtk3qu437w3C72VLmW/TRrgMFbaz1BYd2FAJFcd7r6Fj0Xy7Xc1JFnyz7o LPlw0DkGuSpCsXY/JMPWMnUtPHfcgBh+r0mtC4EG1clQFShK9YgJHPvUn6CUrDsoCl tvWw6VnC6Sa8Q== X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:288893 Archived-At: Eli Zaretskii writes: >> From: Eshel Yaron >> Cc: sbaugh@catern.com, Spencer Baugh , Eli >> Zaretskii , 69809@debbugs.gnu.org >> Date: Thu, 11 Jul 2024 13:15:41 +0200 >> >> Eshel Yaron writes: >> >> [...] >> >> > This issue bothered me as well. Here's a recipe for reproducing on >> > master, with emacs -Q: >> > >> > 1. (add-hook 'c-mode-hook 'flymake-mode) >> > 2. (add-hook 'c-mode-hook 'eglot-ensure) >> > 3. Find some C file >> > >> > This happens because Eglot _restarts_ flymake-mode while flymake-cc's >> > process is already running. Here's a simple fix: >> > >> > diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el >> > index a893a8d749a..c9e1bb7b52d 100644 >> > --- a/lisp/progmodes/eglot.el >> > +++ b/lisp/progmodes/eglot.el >> > @@ -2040,7 +2040,7 @@ eglot--managed-mode >> > (unless (eglot--stay-out-of-p 'imenu) >> > (add-function :before-until (local 'imenu-create-index-function) >> > #'eglot-imenu)) >> > - (unless (eglot--stay-out-of-p 'flymake) (flymake-mode 1)) >> > + (unless (or (eglot--stay-out-of-p 'flymake) flymake-mode) (flymake-mode 1)) >> > (unless (eglot--stay-out-of-p 'eldoc) >> > (add-hook 'eldoc-documentation-functions #'eglot-hover-eldoc-function >> > nil t) >> >> I realized that the change above has the downside of no longer >> immediately initiating a Flymake analysis with Eglot in place. To >> preserve that behavior, maybe something like the following is better: >> >> diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el >> index a893a8d749a..6cd48917d47 100644 >> --- a/lisp/progmodes/eglot.el >> +++ b/lisp/progmodes/eglot.el >> @@ -2040,7 +2040,8 @@ eglot--managed-mode >> (unless (eglot--stay-out-of-p 'imenu) >> (add-function :before-until (local 'imenu-create-index-function) >> #'eglot-imenu)) >> - (unless (eglot--stay-out-of-p 'flymake) (flymake-mode 1)) >> + (unless (eglot--stay-out-of-p 'flymake) >> + (if flymake-mode (flymake-start) (flymake-mode 1))) >> (unless (eglot--stay-out-of-p 'eldoc) >> (add-hook 'eldoc-documentation-functions #'eglot-hover-eldoc-function >> nil t) > > Spencer, any comments? > > From where I stand, this is okay for the emacs-30 release branch, > unless you think it could break some legitimate workflow. Yes, this seems good for emacs-30. Thanks Eshel!