Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Respecting auto-revert-remote-files in forge-bug-reference-setup #703

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions lisp/forge-topic.el
Original file line number Diff line number Diff line change
Expand Up @@ -1728,13 +1728,20 @@ 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 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))
(magit--with-safe-default-directory nil
Expand Down