; Eglot: improve bug-reference-url-format/bug-reference-url-regexp

* lisp/progmodes/eglot.el (eglot--debbugs-or-github-bug-uri): New helper.
This commit is contained in:
João Távora 2023-03-01 13:24:07 +00:00
parent 40c9fc8e3b
commit 0a4b1c0102

View file

@ -3661,6 +3661,15 @@ If NOERROR, return predicate, else erroring function."
(with-eval-after-load 'desktop
(add-to-list 'desktop-minor-mode-handlers '(eglot--managed-mode . ignore)))
;;; 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)
;;; Obsolete
;;;
@ -3671,8 +3680,8 @@ If NOERROR, return predicate, else erroring function."
;; Local Variables:
;; bug-reference-bug-regexp: "\\(github#\\([0-9]+\\)\\)"
;; bug-reference-url-format: "https://github.com/joaotavora/eglot/issues/%s"
;; bug-reference-bug-regexp: "\\(\\(github\\|bug\\)#\\([0-9]+\\)\\)"
;; bug-reference-url-format: eglot--debbugs-or-github-bug-uri
;; checkdoc-force-docstrings-flag: nil
;; End: