[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Unsafe local variable in eglot.el
From: |
Eli Zaretskii |
Subject: |
Re: Unsafe local variable in eglot.el |
Date: |
Thu, 09 Mar 2023 13:56:23 +0200 |
> From: João Távora <joaotavora@gmail.com>
> Date: Thu, 9 Mar 2023 09:31:36 +0000
> Cc: emacs-devel@gnu.org
>
> On Thu, Mar 9, 2023 at 8:00 AM Eli Zaretskii <eliz@gnu.org> wrote:
> >
> > João,
> >
> > This recent change:
> >
> > commit 0a4b1c0102d4062d24e19340f863b9df25e07ab3
> > Author: Joao Távora <joaotavora@gmail.com>
> > AuthorDate: Wed Mar 1 13:24:07 2023 +0000
> > Commit: Joao Távora <joaotavora@gmail.com>
> > CommitDate: Wed Mar 1 13:27:06 2023 +0000
> >
> > ; Eglot: improve bug-reference-url-format/bug-reference-url-regexp
> >
> > * lisp/progmodes/eglot.el (eglot--debbugs-or-github-bug-uri): New
> > helper.
> >
> > causes trouble when visiting eglot.el.
>
> I've reproduced it with
>
> cd path/to/Emacs
> src/emacs -Q lisp/progmodes/eglot.el
>
> But curiously, this doesn't reproduce it
>
> src/emacs -Q
> C-h f eglot RET
> C-x o TAB RET ;; to visit the "eglot.el" link
>
> Why is that?
I don't know. Maybe the latter already has bug-reference.el loaded?
> Anyway, I just followed the docstring:
>
> bug-reference-url-format is a variable defined in `bug-reference.el'.
>
> Its value is `eglot--debbugs-or-github-bug-uri'
> Local in buffer eglot.el; global value is nil
>
> Format used to turn a bug number into a URL.
> The bug number is supplied as a string, so this should have a single %s.
> This can also be a function designator; it is called without arguments
> and should return a string.
> It can use `match-string' to get parts matched against
> `bug-reference-bug-regexp', specifically:
> 1. issue kind (bug, patch, rfe &c)
> 2. issue number.
>
> There is no default setting for this, it must be set per file.
> If you set it to a symbol in the file Local Variables section,
> you need to add a `bug-reference-url-format' property to it:
> (put 'my-bug-reference-url-format 'bug-reference-url-format t)
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> so that it is considered safe, see `enable-local-variables'.
Maybe for the above to work it requires bug-reference.el to be loaded?
Tassilo, any ideas?
> But is a significant number of people using older emacsen to edit
> Emacs's lisp/progmodes/eglot.el?
I do that all the time, since my production sessions always run a
released Emacs.
Moreover, since Eglot is an ELPA package, I'm quite sure people who
use Emacs 28 would do that.