Created
March 8, 2012 14:16
-
-
Save weaver/2001165 to your computer and use it in GitHub Desktop.
Capture an org-mode stored link. Add it to the kill-ring in a format suitable for use as a version control commit message.
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 custom-org-kill-link-as-commit-message () | |
"Capture a stored link. Add it to the kill ring in a format | |
suitable for use as a version control commit message." | |
(interactive) | |
(call-interactively 'org-store-link) | |
(let ((link (car org-stored-links))) | |
;; A link is a (list URL DESCRIPTION) | |
(kill-new (concat (cadr link) "\n" (car link) "\n")) | |
(setq org-stored-links (cdr org-stored-links)))) | |
(defun customize-org-mode () | |
(local-set-key "\C-c\M-l" 'custom-org-kill-link-as-commit-message)) | |
(add-hook 'org-mode-hook 'customize-org-mode) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment