Skip to content

Commit

Permalink
git-link: Optional opening in browser
Browse files Browse the repository at this point in the history
  • Loading branch information
psibi committed Jun 24, 2024
1 parent 34d4989 commit 2bbcc30
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions git-link.el
Original file line number Diff line number Diff line change
Expand Up @@ -893,15 +893,20 @@ Defaults to \"origin\"."
;;;###autoload
(defun git-link-homepage (remote)
"Create a URL representing the homepage of the current
buffer's GitHub/Bitbucket/GitLab/... repository. The
URL will be added to the kill ring. If
`git-link-open-in-browser' is non-nil also call `browse-url'.
buffer's GitHub/Bitbucket/GitLab/... repository. The URL will be
added to the kill ring. If `git-link-open-in-browser' is non-nil
or if you pass the double prefix (Ctrl-u Ctrl-u), then also call
`browse-url'.
With a prefix argument prompt for the remote's name.
Defaults to \"origin\"."

(interactive (list (git-link--select-remote)))
(let* (handler remote-info (remote-url (git-link--remote-url remote)))

(let* (handler remote-info
(remote-url (git-link--remote-url remote))
(git-link-open-in-browser (or git-link-open-in-browser (equal (list 16) current-prefix-arg))))

(if (null remote-url)
(message "Remote `%s' not found" remote)

Expand Down

0 comments on commit 2bbcc30

Please sign in to comment.