Created
August 28, 2017 14:27
-
-
Save hjst/57ba1f821e8fd67d922419d61ff1081e to your computer and use it in GitHub Desktop.
ELisp function to send the URL under the cursor to Pocket for reading later (uses msmtp)
This file contains 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
(require 'url-util) | |
(defun hjst/send-to-pocket () | |
"Send the URL at point to Pocket for reading later" | |
(interactive) | |
(let | |
((url (url-get-url-at-point))) | |
(start-process-shell-command "msmtp" "*send-to-pocket*" | |
(concat "printf 'Add:\n%s\n'" | |
url | |
"| msmtp [email protected]")) | |
(with-current-buffer "*send-to-pocket*" | |
(save-excursion | |
(goto-char (point-max)) | |
(insert (concat "Adding: " url)))) | |
(message "Sent to Pocket"))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment