From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#69809: 30.0.50; flymake: error in process sentinel Date: Fri, 12 Jul 2024 09:27:26 +0300 Message-ID: <86v81bktv5.fsf@gnu.org> References: <867chv3mtf.fsf@gnu.org> <87le696o86.fsf@catern.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25498"; mail-complaints-to="usenet@ciao.gmane.io" Cc: gerd.moellmann@gmail.com, sbaugh@catern.com, 69809@debbugs.gnu.org, sbaugh@janestreet.com To: Eshel Yaron Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jul 12 08:28:16 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 1sS9lP-0006J1-Nn for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 12 Jul 2024 08:28:15 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sS9lD-0004DU-Tn; Fri, 12 Jul 2024 02:28:03 -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 1sS9lC-0004Bo-AQ for bug-gnu-emacs@gnu.org; Fri, 12 Jul 2024 02:28:02 -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 1sS9lC-0004xK-1W for bug-gnu-emacs@gnu.org; Fri, 12 Jul 2024 02:28:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sS9lC-0001JA-3M for bug-gnu-emacs@gnu.org; Fri, 12 Jul 2024 02:28:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 12 Jul 2024 06:28: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.17207656735012 (code B ref 69809); Fri, 12 Jul 2024 06:28:02 +0000 Original-Received: (at 69809) by debbugs.gnu.org; 12 Jul 2024 06:27:53 +0000 Original-Received: from localhost ([127.0.0.1]:53031 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sS9l2-0001Il-Lz for submit@debbugs.gnu.org; Fri, 12 Jul 2024 02:27:53 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:47196) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sS9l0-0001IX-G6 for 69809@debbugs.gnu.org; Fri, 12 Jul 2024 02:27:51 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sS9kt-0004ru-Tz; Fri, 12 Jul 2024 02:27:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=19m/KKG1XA+TCnpdElkpRkBM/RQ0TBrfdCrTE06RzAA=; b=e/bADRHYEnvh 3LPWn3L0ntrtLEhwZRHkz4tutQobCGDf2ENOF2mheZkoig0bdx+WczKxwWgL0yECG+DKAHGMMTcfv XHajPpawuR1G4JHKoPFd4nYISJn938F7TdsfxDFBTjVBIiG3PTs+V5s4FM7t4SDXfJ7YzbkCIg5Bg EZPq0WzY20EUwBdQATYd6WNhDyVyTEQI5w9Vg51h65fwjhyLaehOrOGF2oz9r6ec0DgTpIvc1ZeZ4 hS3tP76OHyRA+6cR+8LT7mzMnT7OWVBWK2Rk46WA9k5qsGaBDMSOiv8lKK+iELoVC8/26AX6rv6XN ++kpZiRk47TFOXyv+2Fbzw==; In-Reply-To: (message from Eshel Yaron on Thu, 11 Jul 2024 13:15:41 +0200) 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:288758 Archived-At: > 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.