Skip to content

Commit

Permalink
Move spacemacs/git-link-* functions to git layer
Browse files Browse the repository at this point in the history
  • Loading branch information
nixmaniack committed Oct 17, 2016
1 parent ddbee36 commit 5771484
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 46 deletions.
36 changes: 36 additions & 0 deletions layers/+source-control/git/funcs.el
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,39 @@
(if (derived-mode-p 'magit-diff-mode)
magit-refresh-args
magit-diff-section-arguments))) (magit-refresh))

(defun spacemacs/git-link-copy-url-only ()
"Only copy the generated link to the kill ring."
(interactive)
(let (git-link-open-in-browser)
(call-interactively 'spacemacs/git-link)))

(defun spacemacs/git-link-commit-copy-url-only ()
"Only copy the generated link to the kill ring."
(interactive)
(let (git-link-open-in-browser)
(call-interactively 'spacemacs/git-link-commit)))

(defun spacemacs/git-link ()
"Allow the user to run git-link in a git-timemachine buffer."
(interactive)
(require 'git-link)
(if (and (boundp 'git-timemachine-revision)
git-timemachine-revision)
(cl-letf (((symbol-function 'git-link--branch)
(lambda ()
(car git-timemachine-revision))))
(call-interactively 'git-link))
(call-interactively 'git-link)))

(defun spacemacs/git-link-commit ()
"Allow the user to run git-link-commit in a git-timemachine buffer."
(interactive)
(require 'git-link)
(if (and (boundp 'git-timemachine-revision)
git-timemachine-revision)
(cl-letf (((symbol-function 'word-at-point)
(lambda ()
(car git-timemachine-revision))))
(call-interactively 'git-link-commit))
(call-interactively 'git-link-commit)))
46 changes: 0 additions & 46 deletions layers/+source-control/github/funcs.el

This file was deleted.

0 comments on commit 5771484

Please sign in to comment.