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 19, 2024
1 parent 34d4989 commit 97df320
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions git-link.el
Original file line number Diff line number Diff line change
Expand Up @@ -893,15 +893,19 @@ 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 prefix argument of 1 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 1 current-prefix-arg))))

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

Expand Down

0 comments on commit 97df320

Please sign in to comment.