From 8cef9b08d50c01508b0daa16094aeca531640ed5 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Fri, 25 Dec 2015 21:05:55 -0500 Subject: [PATCH] Replace browse-at-remote with call to 'hub browse -u --' --- core/core-vcs.el | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/core/core-vcs.el b/core/core-vcs.el index c827d750a..6297cece4 100644 --- a/core/core-vcs.el +++ b/core/core-vcs.el @@ -9,17 +9,6 @@ "/\\.git/info/exclude$" "/git/ignore$")) -(use-package browse-at-remote - :defer t - :init - (evil-define-command narf:git-remote-browse (&optional bang file) - "Open the website for the current (or specified) version controlled FILE. If BANG, -then use hub to do it." - (interactive "") - (if bang - (message "Url copied to clipboard: %s" (browse-at-remote/to-clipboard)) - (browse-at-remote/browse)))) - (use-package git-gutter :commands (git-gutter-mode narf/vcs-next-hunk narf/vcs-prev-hunk narf/vcs-show-hunk narf/vcs-stage-hunk narf/vcs-revert-hunk) @@ -60,5 +49,16 @@ then use hub to do it." :n [tab] 'vc-annotate-toggle-annotation-visibility :n "RET" 'vc-annotate-find-revision-at-line)) +(evil-define-command narf:git-remote-browse (&optional bang file) + "Open the website for the current (or specified) version controlled FILE. If BANG, +then use hub to do it." + (interactive "") + (let ((url (shell-command-to-string "hub browse -u -- "))) + (when url + (setq url (concat (s-trim url) "/" (f-relative (buffer-file-name) (narf/project-root))))) + (if bang + (message "Url copied to clipboard: %s" (kill-new url)) + (browse-url url)))) + (provide 'core-vcs) ;;; core-vcs.el ends here