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
Full log
Message #17 received at 62065 <at> debbugs.gnu.org (full text, mbox):
[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.