This is the official manual for the latest Org-mode release.

Table of Contents

Previous: <code>capture</code> protocol, Up: Protocols

9.4.3 open-source protocol

The open-source handler is designed to help with editing local sources when reading a document. To that effect, you can use a bookmark with the following location:


The variable org-protocol-project-alist maps URLs to local file names, by stripping URL parameters from the end and replacing the :base-url with :working-directory and :online-suffix with :working-suffix. For example, assuming you own a local copy of contents at /home/user/worg, you can set org-protocol-project-alist to the following

     (setq org-protocol-project-alist
     	 :base-url ""
     	 :working-directory "/home/user/worg/"
     	 :online-suffix ".html"
     	 :working-suffix ".org")))

If you are now browsing and find a typo or have an idea about how to enhance the documentation, simply click the bookmark and start editing.

However, such mapping may not yield the desired results. Suppose you maintain an online store located at The local sources reside in /home/user/example/. It is common practice to serve all products in such a store through one file and rewrite URLs that do not match an existing file on the server. That way, a request to might be rewritten on the server to something like The open-source handler probably cannot find a file named /home/user/example/print/posters.html.php and fails.

Such an entry in org-protocol-project-alist may hold an additional property :rewrites. This property is a list of cons cells, each of which maps a regular expression to a path relative to the :working-directory.

Now map the URL to the path /home/user/example/products.php by adding :rewrites rules like this:

     (setq org-protocol-project-alist
              :base-url ""
              :working-directory "/home/user/example/"
              :online-suffix ".php"
              :working-suffix ".php"
              :rewrites (("" . "products.php")
                         ("$" . "index.php")))))

Since ‘$’ is used as a regular expression, it maps,, and similar to /home/user/example/index.php.

The :rewrites rules are searched as a last resort if and only if no existing file name is matched.

Two functions can help you filling org-protocol-project-alist with valid contents: org-protocol-create and org-protocol-create-for-org. The latter is of use if you're editing an Org file that is part of a publishing project.