Skip to content

Commit

Permalink
fixup! Respecting auto-revert-remote-files in `forge-bug-reference-se…
Browse files Browse the repository at this point in the history
…tup'
  • Loading branch information
tarsius committed Sep 17, 2024
1 parent acd2353 commit fa1c725
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lisp/forge-topic.el
Original file line number Diff line number Diff line change
Expand Up @@ -1728,15 +1728,19 @@ alist, containing just `text' and `position'.")
(match-string-no-properties 2))
(funcall bug-reference-url-format)))))))))))

(defvar forge-bug-reference-remote-files t
"Whether forge may enable `bug-reference-mode' in remote files.
See also `forge-bug-reference-setup'.")

(defun forge-bug-reference-setup ()
"Setup `bug-reference' in the current buffer.
If forge data has been fetched for the current repository, then
enable `bug-reference-mode' or `bug-reference-prog-mode' and
modify `bug-reference-bug-regexp' if appropriate."
(unless (or bug-reference-url-format
(not (forge-db t))
(and (not auto-revert-remote-files) ; see magit's #5422
buffer-file-name
(and buffer-file-name
(not forge-bug-reference-remote-files)
(file-remote-p buffer-file-name))
;; TODO Allow use in these modes again.
(derived-mode-p 'forge-topics-mode 'forge-notifications-mode))
Expand Down

0 comments on commit fa1c725

Please sign in to comment.