emacs/vc: better feedback from 'SPC g {y,Y}'

This commit is contained in:
Henrik Lissner 2019-12-25 15:21:16 -05:00
parent 550c9bda74
commit ac21c09419
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -19,10 +19,13 @@ the URL."
If a selection is active, highlight them. Otherwise omits the #L<N> suffix in
the URL."
(interactive)
(if (or (use-region-p)
(ignore-errors (evil-visual-state-p)))
(browse-at-remote-kill)
(kill-new (browse-at-remote--file-url (buffer-file-name)))))
(let ((url
(if (or (use-region-p)
(evil-visual-state-p))
(browse-at-remote-get-url)
(browse-at-remote--file-url (buffer-file-name)))))
(kill-new url)
(message "Copied to clipboard: %S" url)))
(defun +vc--remote-homepage ()
@ -40,4 +43,6 @@ the URL."
(defun +vc/browse-at-remote-kill-homepage ()
"Copy homepage URL of current project to clipboard."
(interactive)
(kill-new (+vc--remote-homepage)))
(let ((url (+vc--remote-homepage)))
(kill-new url)
(message "Copied to clipboard: %S" url)))