From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eshel Yaron via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#69809: 30.0.50; flymake: error in process sentinel Date: Thu, 11 Jul 2024 13:15:41 +0200 Message-ID: References: <867chv3mtf.fsf@gnu.org> <87le696o86.fsf@catern.com> Reply-To: Eshel Yaron Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14434"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: sbaugh@catern.com, Eli Zaretskii , 69809@debbugs.gnu.org, Spencer Baugh To: Gerd =?UTF-8?Q?M=C3=B6llmann?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jul 11 13:16:23 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sRrmg-0003Vp-7f for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 11 Jul 2024 13:16:22 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sRrmN-0006h3-HQ; Thu, 11 Jul 2024 07:16: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 1sRrmM-0006d3-HN for bug-gnu-emacs@gnu.org; Thu, 11 Jul 2024 07:16: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 1sRrmM-0007p1-8Q for bug-gnu-emacs@gnu.org; Thu, 11 Jul 2024 07:16:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sRrmL-0003IJ-MD for bug-gnu-emacs@gnu.org; Thu, 11 Jul 2024 07:16:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eshel Yaron Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 11 Jul 2024 11:16:01 +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.172069654712641 (code B ref 69809); Thu, 11 Jul 2024 11:16:01 +0000 Original-Received: (at 69809) by debbugs.gnu.org; 11 Jul 2024 11:15:47 +0000 Original-Received: from localhost ([127.0.0.1]:51148 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sRrm7-0003Hp-BQ for submit@debbugs.gnu.org; Thu, 11 Jul 2024 07:15:47 -0400 Original-Received: from mail.eshelyaron.com ([107.175.124.16]:45042 helo=eshelyaron.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sRrm4-0003Hc-L6 for 69809@debbugs.gnu.org; Thu, 11 Jul 2024 07:15:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eshelyaron.com; s=mail; t=1720696544; bh=wjwqeVwbcYYowvIRtOt12N9kXVlSrDs2pmg8qHN7fjA=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=THlmo9fHYY/4CEx6yFE8veksQrH6X3QqZub6u+2eMb24Ext3296MZnbSnFwe9yEtI OC/dGTqJsdYQFmCxwkiWQ0B3SdKD5tqoh9JXEehf9r3yQGayCqibLq7LNQUBqdt2Wa UoS2Dp8AiEUDo3AsharoOHjwIwmPksEVJRodIWfgWVaBksmzkamyma+P2q4+lGtq9s dNhP1+VGeLkp0RSNf4z2umg5FuK7JbtLDwCz6LODJc0zzBl2RxOQBtQEfNsW/uKk8B NNma/h1UMUb6km89KJswTBupD6xeEFI4a26g50DUlhX2BvbH1DlQFvCx0nJODkeDG5 ohXuQ7lq1KTZg== In-Reply-To: (Eshel Yaron's message of "Thu, 11 Jul 2024 11:45:46 +0200") X-Hashcash: 1:20:240711:gerd.moellmann@gmail.com::FtedQaE7mkpEjW0T:0naS X-Hashcash: 1:20:240711:sbaugh@janestreet.com::c5AgqCmSoC2UydZO:0Wfo X-Hashcash: 1:20:240711:sbaugh@catern.com::mlWAeDx3XiI5BzIx:5kah X-Hashcash: 1:20:240711:eliz@gnu.org::DlH97CgDBViJ5bAb:2KUb X-Hashcash: 1:20:240711:69809@debbugs.gnu.org::7K2DZVne6mh8iti6:19th 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:288724 Archived-At: 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)