Last active
December 24, 2015 13:56
-
-
Save saidie/3f6445709c95ed9c268d to your computer and use it in GitHub Desktop.
Command to create GitHub pull-request by hub command
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun create-github-pull-request () | |
(interactive) | |
(let ((buffer (get-buffer-create "*hub pull-request*")) | |
(cwd default-directory) | |
(my-local-map (make-keymap))) | |
(define-key my-local-map (kbd "C-c C-k") | |
'(lambda () | |
(interactive) | |
(kill-buffer (current-buffer)))) | |
(define-key my-local-map (kbd "C-c C-c") | |
'(lambda () | |
(interactive) | |
(mark-whole-buffer) | |
(shell-command-on-region (point) (mark) "hub pull-request -F-") | |
(kill-buffer (current-buffer)))) | |
(switch-to-buffer buffer) | |
(setq default-directory cwd) | |
(markdown-mode) | |
(insert-file-contents "~/.prrc") | |
(use-local-map my-local-map) | |
)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment