Make bug-reference auto-setup work in vc-dir or Magit like modes
* lisp/progmodes/bug-reference.el (bug-reference-try-setup-from-vc): Use default-directory if not in a file-visiting buffer to determine VC URL.
This commit is contained in:
parent
a4f1d681c1
commit
dcdf6d7124
1 changed files with 5 additions and 2 deletions
|
@ -212,8 +212,11 @@ URL-REGEXP against the VCS URL and returns the value to be set as
|
||||||
"Try setting up `bug-reference-mode' based on VC information.
|
"Try setting up `bug-reference-mode' based on VC information.
|
||||||
Test each configuration in `bug-reference-setup-from-vc-alist'
|
Test each configuration in `bug-reference-setup-from-vc-alist'
|
||||||
and apply it if applicable."
|
and apply it if applicable."
|
||||||
(when buffer-file-name
|
(let ((file-or-dir (or buffer-file-name
|
||||||
(let* ((backend (vc-responsible-backend buffer-file-name t))
|
;; Catches modes such as vc-dir and Magit.
|
||||||
|
default-directory))))
|
||||||
|
(when file-or-dir
|
||||||
|
(let* ((backend (vc-responsible-backend file-or-dir t))
|
||||||
(url
|
(url
|
||||||
(or (ignore-errors
|
(or (ignore-errors
|
||||||
(vc-call-backend backend 'repository-url "upstream"))
|
(vc-call-backend backend 'repository-url "upstream"))
|
||||||
|
|
Loading…
Add table
Reference in a new issue