diff options
author | Bastien Guerry <bzg@altern.org> | 2011-03-23 10:25:38 +0100 |
---|---|---|
committer | Bastien Guerry <bzg@altern.org> | 2011-03-23 10:25:38 +0100 |
commit | ac6e4c28b8081fd16e3de7b459d1a8e21f2c4ea7 (patch) | |
tree | 5b59135cd1016482575b818e72894617212405a1 | |
parent | fab27888640a2d6af71fc3e42ffc0b195eb7c4d8 (diff) | |
download | org-mode-ac6e4c28b8081fd16e3de7b459d1a8e21f2c4ea7.tar.gz |
Allow org-protocol templates to be set to two characters.
* org-protocol.el (org-protocol-do-capture): allow template
keys of two characters.
(org-protocol-default-template-key): Update the docstring to
reflect the change in `org-protocol-do-capture'.
-rw-r--r-- | lisp/org-protocol.el | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lisp/org-protocol.el b/lisp/org-protocol.el index 61fe837..0bbef03 100644 --- a/lisp/org-protocol.el +++ b/lisp/org-protocol.el @@ -269,7 +269,9 @@ Here is an example: :type '(alist)) (defcustom org-protocol-default-template-key nil - "The default org-remember-templates key to use." + "The default template key to use. +This is usually a single character string but can also be a +string with two characters." :group 'org-protocol :type 'string) @@ -301,9 +303,9 @@ part." (defun org-protocol-flatten-greedy (param-list &optional strip-path replacement) "Greedy handlers might receive a list like this from emacsclient: - '( (\"/dir/org-protocol:/greedy:/~/path1\" (23 . 12)) (\"/dir/param\") + '((\"/dir/org-protocol:/greedy:/~/path1\" (23 . 12)) (\"/dir/param\") where \"/dir/\" is the absolute path to emacsclients working directory. This -function transforms it into a flat list utilizing `org-protocol-flatten' and +function transforms it into a flat list using `org-protocol-flatten' and transforms the elements of that list as follows: If strip-path is non-nil, remove the \"/dir/\" prefix from all members of @@ -434,7 +436,7 @@ Now template ?b will be used." "Support `org-capture' and `org-remember' alike. CAPTURE-FUNC is either the symbol `org-remember' or `org-capture'." (let* ((parts (org-protocol-split-data info t)) - (template (or (and (= 1 (length (car parts))) (pop parts)) + (template (or (and (>= 2 (length (car parts))) (pop parts)) org-protocol-default-template-key)) (url (org-protocol-sanitize-uri (car parts))) (type (if (string-match "^\\([a-z]+\\):" url) |