Created
March 27, 2015 05:48
-
-
Save 5t111111/4b94e2b218aa4ea6605e to your computer and use it in GitHub Desktop.
(Emacs) Create a note from selected region via Geeknote
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 geeknote-create-from-region (beg end) | |
| "Create a note from selected region via Geeknote" | |
| (interactive (if (use-region-p) | |
| (list (region-beginning) (region-end)) | |
| (list nil nil))) | |
| (setq title | |
| (format-time-string "%Y-%m-%d %H:%M:%S" (current-time))) | |
| (setq content | |
| (format "%s" (if (and beg end) | |
| (buffer-substring-no-properties beg end) | |
| ""))) | |
| (shell-command | |
| (format "geeknote create --title '%s' --content '%s'" title content)) | |
| ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment