diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2018-12-17 10:19:23 -0800 |
---|---|---|
committer | Kyle Meyer <kyle@kyleam.com> | 2019-01-13 12:43:04 -0500 |
commit | 7937b268671ba6ab99d47da9878c46c6b0dfd1de (patch) | |
tree | 8c54505910215c16483172d83e9da11dfd386616 | |
parent | d782b01d35a474597a31d4c03e92acb850e43c72 (diff) | |
download | org-mode-7937b268671ba6ab99d47da9878c46c6b0dfd1de.tar.gz |
Backport commit ef144113f from Emacs
* lisp/org-protocol.el (org-protocol-flatten): Make it an alias for
flatten-tree if available.
Some more flatten-tree aliases
ef144113f3473f39d3df3e96e780c832e0d5420e
Paul Eggert
Mon Dec 17 10:26:15 2018 -0800
-rw-r--r-- | lisp/org-protocol.el | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/lisp/org-protocol.el b/lisp/org-protocol.el index d20c66f..b902c0b 100644 --- a/lisp/org-protocol.el +++ b/lisp/org-protocol.el @@ -350,17 +350,20 @@ returned list." ret) l))) -(defun org-protocol-flatten (list) - "Transform LIST into a flat list. +(if (fboundp 'flatten-tree) + (defalias 'org-protocol-flatten 'flatten-tree) + (defun org-protocol-flatten (list) + "Transform LIST into a flat list. Greedy handlers might receive a list like this from emacsclient: \((\"/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." - (if (null list) () - (if (listp list) - (append (org-protocol-flatten (car list)) (org-protocol-flatten (cdr list))) - (list list)))) + (if (null list) () + (if (listp list) + (append (org-protocol-flatten (car list)) + (org-protocol-flatten (cdr list))) + (list list))))) (defun org-protocol-parse-parameters (info &optional new-style default-order) "Return a property list of parameters from INFO. |