r/emacs•
pzone

Bypass org-capture editing step with org-protocol?

I have just set up org-capture from Chrome using with a tweaked version of Ultimate Org Capture chrome extension using Sacha Chua's instructions and the org-protocol documentation.

It works nicely, but to get that yak baby-smooth I'd like to make one more modification. Org-protocol supports two commands: org-capture and org-store-link. The former will open a buffer that asks me to do some editing before filing the item. The latter seems to copy items to the clipboard, though I'm not yet familiar with org-protocol. What I'd like to do would be quietly save links and snippets from Chrome in an org file without any further user input. Would that be easy to set up?

Posted Nov 28, 2015, 6:55 PM UTC

75
cestdiego•

This can be customized in the org-capture-template variable... if your capturing template is l then

        ("l" "Temp Links from the interwebs" entry
         (file+headline "~/Dropbox/links.org" "Links")
         "* TO-READ %c \n Entered on: %U\n %?\n%i\n"
         :empy-lines 1
         :immediate-finish t)

The important part is the :immediate-finish symbol, according to documentation:

:immediate-finish   When set, do not offer to edit the information, just
                     file it away immediately.  This makes sense if the
                     template only needs information that can be added
                     automatically.

Also avoid any of the % stuff that asks for input.

4
pzoneOP•

Sweet, I'm going to try this out!

1
cestdiego•

Did it work?

1
pzoneOP•

It did, thank you.

I'll make a pull request for the chrome extension tweaks soon.

1
cestdiego•

Thanks you I look forward to it.

1
gottabeme•
2
pzoneOP•

Looks like a cool package. u/cestdiego may be interested in integrating it into the org capture chrome extension.

2
cestdiego•

This is awesome! I'll definitely work on this on the Emacs NYC HackNight (tonight) stay tuned! :P I might not go the full route to only using that package as it looks like overkill but the option to do so certainly seems useful. I'll Most likely add another function to have everything just be saved in the way you want it to be saved, and that the tags and everything meta get specified in the chrome extension itself

1