emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Unsafe local variable in eglot.el


From: Tassilo Horn
Subject: Re: Unsafe local variable in eglot.el
Date: Thu, 09 Mar 2023 13:10:15 +0100
User-agent: mu4e 1.9.21; emacs 30.0.50

Eli Zaretskii <eliz@gnu.org> writes:

Hi Eli, João & Sam,

Sam, for the context: when you find eglot.el in the current emacs
master, it'll trigger a query because of the eglot.el local variable
setting

--8<---------------cut here---------------start------------->8---
;; Local Variables:
;; bug-reference-bug-regexp: "\\(\\(github\\|bug\\)#\\([0-9]+\\)\\)"
;; bug-reference-url-format: eglot--debbugs-or-github-bug-uri
;; checkdoc-force-docstrings-flag: nil
;; End:
--8<---------------cut here---------------end--------------->8---

(Now probably this mail will do the same. :-))

>> 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 can reproduce it, too.

> I don't know.  Maybe the latter already has bug-reference.el loaded?

I think the reason is that bug-reference-url-format is a safe local
variable if it is

  (a) a string, or
  (b) a symbol which itself has the bug-reference-url-format property
      set to a non-nil value

When you find eglot.el the function eglot--debbugs-or-github-bug-uri
defined in eglot.el doesn't have the property because eglot.el itself is
not loaded yet.

When you visit eglot.el following a help link, it seems eglot gets
loaded, and therefore the bug-reference-url-format function
eglot--debbugs-or-github-bug-uri is defined and has the right property.

Not sure what to do here.  Maybe adding an autoload-cookie to
eglot--debbugs-or-github-bug-uri does the trick?  Of course, then you
cannot find eglot.el without loading it at the same time...

I've added Sam to the Cc because he added the (b) clause.  Before the
bug url format has been considered safe if it was string or function but
I think even that would trigger the issue.

Bye,
Tassilo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]