Skip to main content

16.15 Protocols for External Access

Org protocol is a tool to trigger custom actions in Emacs from external applications. Any application that supports calling external programs with an URL as argument may be used with this functionality. For example, you can configure bookmarks in your web browser to send a link to the current page to Org and create a note from it using capture (see Capture). You can also create a bookmark that tells Emacs to open the local source file of a remote website you are browsing.

In order to use Org protocol from an application, you need to register ‘org-protocol://’ as a valid scheme-handler. External calls are passed to Emacs through the ‘emacsclient’ command, so you also need to ensure an Emacs server is running. More precisely, when the application calls

emacsclient org-protocol://PROTOCOL?key1=val1&key2=val2

Emacs calls the handler associated to PROTOCOL with argument ‘(:key1 val1 :key2 val2)’.

Org protocol comes with three predefined protocols, detailed in the following sections. Configure org-protocol-protocol-alist to define your own.

The store-link protocol  Store a link, push URL to kill-ring.
The capture protocol  Fill a buffer with external information.
The open-source protocol  Edit published contents.