unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Eshel Yaron <me@eshelyaron.com>
Cc: gerd.moellmann@gmail.com, sbaugh@catern.com,
	69809@debbugs.gnu.org, sbaugh@janestreet.com
Subject: bug#69809: 30.0.50; flymake: error in process sentinel
Date: Fri, 12 Jul 2024 09:27:26 +0300	[thread overview]
Message-ID: <86v81bktv5.fsf@gnu.org> (raw)
In-Reply-To: <m1a5ioch7m.fsf@dazzs-mbp.home> (message from Eshel Yaron on Thu,  11 Jul 2024 13:15:41 +0200)

> From: Eshel Yaron <me@eshelyaron.com>
> Cc: sbaugh@catern.com,  Spencer Baugh <sbaugh@janestreet.com>,  Eli
>  Zaretskii <eliz@gnu.org>,  69809@debbugs.gnu.org
> Date: Thu, 11 Jul 2024 13:15:41 +0200
> 
> Eshel Yaron <me@eshelyaron.com> 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.





  parent reply	other threads:[~2024-07-12  6:27 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-15  7:09 bug#69809: 30.0.50; flymake: error in process sentinel Gerd Möllmann
2024-03-21 10:23 ` Eli Zaretskii
2024-03-23 14:02   ` sbaugh
2024-03-23 14:20     ` Gerd Möllmann
2024-07-11  9:45       ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-07-11 11:15         ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-07-11 11:46           ` Gerd Möllmann
2024-07-12  6:27           ` Eli Zaretskii [this message]
2024-07-16 20:48             ` Spencer Baugh
2024-07-17  6:12               ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-07-17  8:20                 ` João Távora
2024-07-17  9:07                   ` João Távora
2024-07-17 13:08                     ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-07-17 13:44                       ` João Távora
2024-07-17 17:25                         ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-07-17 17:38                           ` João Távora
2024-07-17 23:54                             ` João Távora
2024-07-18  0:10                               ` João Távora
2024-07-24 16:25                               ` Spencer Baugh
2024-07-25  7:28                                 ` Eli Zaretskii
2024-07-25  7:45                                   ` João Távora
2024-07-25 10:50                                     ` Eli Zaretskii
2024-07-25 11:49                                       ` João Távora
2024-07-27  7:26                                         ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86v81bktv5.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=69809@debbugs.gnu.org \
    --cc=gerd.moellmann@gmail.com \
    --cc=me@eshelyaron.com \
    --cc=sbaugh@catern.com \
    --cc=sbaugh@janestreet.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).