Function: forge-browse-blob
forge-browse-blob is an autoloaded, interactive and byte-compiled
function defined in forge-commands.el.
Signature
(forge-browse-blob COMMIT FILE &optional LINE END FORCE-HASH)
Documentation
Visit a blob using a browser.
When invoked from a blob- or file-visiting buffer, visit that blob without prompting. If the region is active, try to jump to the marked line or lines, and highlight them in the browser. To what extend that is possible depends on the forge. When the region is not active just visit the blob, without trying to jump to the current line. When jumping to a line, always use a commit hash as part of the URL. From a file in the worktree with no active region, instead use the branch name as part of the URL, unless a prefix argument is used.
When invoked from a Dired buffer, visit the blob at point without prompting. If a prefix argument is used, the commit hash is included in the URL.
When invoked from any other buffer, prompt the user for a branch or commit, and for a file.
Key Bindings
Source Code
;; Defined in ~/.emacs.d/elpa/forge-20260408.1922/forge-commands.el
;;;###autoload
(defun forge-browse-blob (commit file &optional line end force-hash)
"Visit a blob using a browser.
When invoked from a blob- or file-visiting buffer, visit that blob
without prompting. If the region is active, try to jump to the marked
line or lines, and highlight them in the browser. To what extend that
is possible depends on the forge. When the region is not active just
visit the blob, without trying to jump to the current line. When
jumping to a line, always use a commit hash as part of the URL. From
a file in the worktree with no active region, instead use the branch
name as part of the URL, unless a prefix argument is used.
When invoked from a Dired buffer, visit the blob at point without
prompting. If a prefix argument is used, the commit hash is included
in the URL.
When invoked from any other buffer, prompt the user for a branch or
commit, and for a file."
(interactive (forge--browse-blob-args))
(browse-url (forge-get-url :blob commit file line end force-hash)))