github: move some functions to funcs.el
This commit is contained in:
parent
43bc88119b
commit
4bc796c9e6
33
layers/+source-control/github/funcs.el
Normal file
33
layers/+source-control/github/funcs.el
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
;;; funcs.el --- Github layer functions File
|
||||||
|
;;
|
||||||
|
;; Copyright (c) 2012-2016 Sylvain Benner & Contributors
|
||||||
|
;;
|
||||||
|
;; Author: Sylvain Benner <sylvain.benner@gmail.com>
|
||||||
|
;; URL: https://github.com/syl20bnr/spacemacs
|
||||||
|
;;
|
||||||
|
;; This file is not part of GNU Emacs.
|
||||||
|
;;
|
||||||
|
;;; License: GPLv3
|
||||||
|
|
||||||
|
(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 'git-link-commit)))
|
||||||
|
|
||||||
|
(defun spacemacs/git-link ()
|
||||||
|
"Allow the user to run git-link in a git-timemachine buffer."
|
||||||
|
(interactive)
|
||||||
|
(require 'git-link)
|
||||||
|
(if git-timemachine-revision
|
||||||
|
(cl-letf (((symbol-function 'git-link--branch)
|
||||||
|
(lambda ()
|
||||||
|
(car git-timemachine-revision))))
|
||||||
|
(call-interactively 'git-link))
|
||||||
|
(call-interactively 'git-link)))
|
|
@ -79,30 +79,6 @@
|
||||||
:defer t
|
:defer t
|
||||||
:init
|
:init
|
||||||
(progn
|
(progn
|
||||||
|
|
||||||
(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 'git-link-commit)))
|
|
||||||
|
|
||||||
(defun spacemacs/git-link ()
|
|
||||||
"Allow the user to run git-link in a git-timemachine buffer."
|
|
||||||
(interactive)
|
|
||||||
(require 'git-link)
|
|
||||||
(if git-timemachine-revision
|
|
||||||
(cl-letf (((symbol-function 'git-link--branch)
|
|
||||||
(lambda ()
|
|
||||||
(car git-timemachine-revision))))
|
|
||||||
(call-interactively 'git-link))
|
|
||||||
(call-interactively 'git-link)))
|
|
||||||
|
|
||||||
(spacemacs/set-leader-keys
|
(spacemacs/set-leader-keys
|
||||||
"ghl" 'spacemacs/git-link
|
"ghl" 'spacemacs/git-link
|
||||||
"ghL" 'spacemacs/git-link-copy-url-only
|
"ghL" 'spacemacs/git-link-copy-url-only
|
||||||
|
|
Loading…
Reference in a new issue