GNU bug report logs - #62065
30.0.50; No prompt to confirm unsafe local variables when eglot-ensure used in major mode hook

Previous Next

Package: emacs;

Reported by: Matt Wittmann <mcwitt <at> gmail.com>

Date: Thu, 9 Mar 2023 04:46:05 UTC

Severity: normal

Found in version 30.0.50

Full log


View this message in rfc822 format

From: Matt Wittmann <mcwitt <at> gmail.com>
To: João Távora <joaotavora <at> gmail.com>
Cc: 62065 <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>
Subject: bug#62065: 30.0.50; No prompt to confirm unsafe local variables when eglot-ensure used in major mode hook
Date: Sat, 11 Mar 2023 08:23:30 -0800
[Message part 1 (text/plain, inline)]
> Matt can you confirm this as well (both the error and the non-setting)?

Confirmed both! (Sorry, I hadn't noticed the relevant message before.)

On Sat, Mar 11, 2023 at 7:00 AM João Távora <joaotavora <at> gmail.com> wrote:

> João Távora <joaotavora <at> gmail.com> writes:
>
> > Eli Zaretskii <eliz <at> gnu.org> writes:
> >
> > No, not yet.  I haven't tried to reproduce it yet, nor do I understand
> > what is going on.
>
> I've now reproduced the problem, but Emacs is not silent about it, I see
> an error in *Messages*
>
>    Directory-local variables error: (error Command attempted to use
> minibuffer while in minibuffer)
>
> > But the main question to ask is: is the '(setq foo 42)' getting
> > evaluated without the user's consent?
>
> I've confirmed it does _not_.
>
> Matt can you confirm this as well (both the error and the non-setting)?
>
> Anyway, this is the implementation of 'eglot-ensure'.  It's pretty
> simple.  The idea is to wait until the very last moment to do the
> connection, hence the user of post-command-hook.  Maybe some assumption
> here is wrong.  I will debug later.
>
> (defun eglot-ensure ()
>   "Start Eglot session for current buffer if there isn't one."
>   (let ((buffer (current-buffer)))
>     (cl-labels
>         ((maybe-connect
>            ()
>            (remove-hook 'post-command-hook #'maybe-connect nil)
>            (eglot--when-live-buffer buffer
>              (unless eglot--managed-mode
>                (apply #'eglot--connect (eglot--guess-contact))))))
>       (when buffer-file-name
>         (add-hook 'post-command-hook #'maybe-connect 'append nil)))))
>
> João
>
[Message part 2 (text/html, inline)]

This bug report was last modified 2 years and 92 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.