and apply it if applicable."
(let ((file-or-dir (or buffer-file-name
;; Catches modes such as vc-dir and Magit.
- default-directory))))
- (when file-or-dir
- (let* ((backend (vc-responsible-backend file-or-dir t))
- (url
- (or (ignore-errors
- (vc-call-backend backend 'repository-url "upstream"))
- (ignore-errors
- (vc-call-backend backend 'repository-url)))))
- (when url
- (catch 'found
- (dolist (config bug-reference-setup-from-vc-alist)
- (when (apply #'bug-reference--maybe-setup-from-vc
- url config)
- (throw 'found t))))))))
+ default-directory)))
+ (when file-or-dir
+ (let* ((backend (vc-responsible-backend file-or-dir t))
+ (url
+ (or (ignore-errors
+ (vc-call-backend backend 'repository-url "upstream"))
+ (ignore-errors
+ (vc-call-backend backend 'repository-url)))))
+ (when url
+ (catch 'found
+ (dolist (config bug-reference-setup-from-vc-alist)
+ (when (apply #'bug-reference--maybe-setup-from-vc
+ url config)
+ (throw 'found t)))))))))
(defvar bug-reference-setup-from-mail-alist
`((,(regexp-opt '("emacs" "auctex" "gnus") 'words)