[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Unsafe local variable in eglot.el
From: |
João Távora |
Subject: |
Re: Unsafe local variable in eglot.el |
Date: |
Thu, 9 Mar 2023 11:24:37 +0000 |
On Thu, Mar 9, 2023 at 9:31 AM João Távora <joaotavora@gmail.com> wrote:
> 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?
It's probably because C-h v loads the file to show the
docstring (did it always do that?)
>
> Maybe the function can be autoloaded?
I played a bit and this patch seems to fix it. Can you test?
diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el
index 2491c86ea5b..94cc86d1e97 100644
--- a/lisp/progmodes/eglot.el
+++ b/lisp/progmodes/eglot.el
@@ -3666,12 +3666,14 @@ eglot-inlay-hints-mode
;;; Misc
;;;
-(defun eglot--debbugs-or-github-bug-uri ()
- (format (if (string= (match-string 2) "github")
- "https://github.com/joaotavora/eglot/issues/%s"
- "https://debbugs.gnu.org/%s")
- (match-string 3)))
-(put 'eglot--debbugs-or-github-bug-uri 'bug-reference-url-format t)
+;;;###autoload
+(progn
+ (put 'eglot--debbugs-or-github-bug-uri 'bug-reference-url-format t)
+ (defun eglot--debbugs-or-github-bug-uri ()
+ (format (if (string= (match-string 2) "github")
+ "https://github.com/joaotavora/eglot/issues/%s"
+ "https://debbugs.gnu.org/%s")
+ (match-string 3))))
;;; Obsolete
;;;