Skip to content

Instantly share code, notes, and snippets.

@PhilHudson
Created October 15, 2021 19:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PhilHudson/356c318b5a06b7715c385aa985ed9296 to your computer and use it in GitHub Desktop.
Save PhilHudson/356c318b5a06b7715c385aa985ed9296 to your computer and use it in GitHub Desktop.
(define-command-global ph/org-capture ()
(let* ((url (ph/url-encode (ph/buffer-url)))
(title (ph/url-encode (ph/buffer-title)))
(body (ph/url-encode (%copy)))
(org-protocol-uri
(ph/format
"'org-protocol://capture?template=w&url=~a&title=~a&body=~a'"
url title body)))
(format *error-output* "Sending to Emacs:~%~a~%" org-protocol-uri)
(uiop:run-program
(list "/usr/bin/env" "SSH_ASKPASS=/usr/bin/ssh-askpass"
"timeout" "--signal=9" "5m" "emacsclient"
org-protocol-uri))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment