(feat): Allow ORP to capture the webpage's selection (#1239)

* (feat): Temporarily store link when capturing with ORP

* org-roam-protocol.el (org-roam-protocol-open-ref): Replicate default
`org-protocol' behaviour temporarily for storing links
* org-roam-capture.el (org-roam-capture--capture): Prevent stored link from
being reset

When capturing a web-page with org-roam-protocol, a link is now temporarily
stored in `org-store-link-plist' via `org-link-store-props'.  This is to allow
the forwarding of properties to `org-capture', one of them being `:initial'
which contains the content of the selected text in the browser.

* (feat): Add toggle for storing link when capturing with ORP

* org-roam-protocol.el (org-roam-protocol-store-links): Add new toggle
(org-roam-protocol-open-ref): Conditionally store link for later used

Building up on b2ee5f2c68, the user can now
decide whether to store links when capturing with org-roam-protocol (default
nil).

* Update changelog
This commit is contained in:
Leo Vivier
2020-11-08 13:30:16 +01:00
committed by GitHub
parent c6797cbd75
commit 7602b8c48d
3 changed files with 23 additions and 2 deletions

View File

@ -512,7 +512,8 @@ GOTO and KEYS argument have the same functionality as
`org-capture'."
(let* ((org-capture-templates (mapcar #'org-roam-capture--convert-template org-roam-capture-templates))
(one-template-p (= (length org-capture-templates) 1))
org-capture-templates-contexts)
org-capture-templates-contexts
(org-capture-link-is-already-stored t))
(when one-template-p
(setq keys (caar org-capture-templates)))
(if (or one-template-p