Skip to content

Commit

Permalink
forge-bug-reference-remote-files: New variable
Browse files Browse the repository at this point in the history
This is done for performance reasons, see #703.

Because the maintainer is not entirely convinced this is necessary,
this is a regular variable instead of a user option for now.
  • Loading branch information
bramadams authored and tarsius committed Dec 23, 2024
1 parent 9b2b904 commit 8bace81
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@

- Fixed visiting commit in a browser. 8f9e94949

- Added new variable ~forge-bug-reference-remote-files~. #703

* v0.4.4 2024-10-01

Thoughts and whitespace.
Expand Down
7 changes: 7 additions & 0 deletions lisp/forge-topic.el
Original file line number Diff line number Diff line change
Expand Up @@ -1712,13 +1712,20 @@ alist, containing just `text' and `position'.")

;;; Bug-Reference

(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

0 comments on commit 8bace81

Please sign in to comment.