Backport commit c5e02f2bc from Emacs

* lisp/org-protocol.el (org-protocol-flatten):
Rewrite as top-level alias, as per Stefan’s suggestion,
to avoid compiler warnings.

Make org-protocol-flatten always an alias
c5e02f2bce28f3b1f2006ce1f208f4a92ca05ed9
Paul Eggert
Mon Dec 17 13:32:52 2018 -0800
This commit is contained in:
Paul Eggert 2018-12-17 13:26:42 -08:00 committed by Kyle Meyer
parent 7937b26867
commit 5a958f3fae
1 changed files with 9 additions and 9 deletions

View File

@ -350,20 +350,20 @@ returned list."
ret) ret)
l))) l)))
(if (fboundp 'flatten-tree) (defalias 'org-protocol-flatten
(defalias 'org-protocol-flatten 'flatten-tree) (if (fboundp 'flatten-tree) 'flatten-tree
(defun org-protocol-flatten (list) (lambda (list)
"Transform LIST into a flat list. "Transform LIST into a flat list.
Greedy handlers might receive a list like this from emacsclient: 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. where \"/dir/\" is the absolute path to emacsclients working directory.
This function transforms it into a flat list." This function transforms it into a flat list."
(if (null list) () (if list
(if (listp list) (if (consp list)
(append (org-protocol-flatten (car list)) (append (org-protocol-flatten (car list))
(org-protocol-flatten (cdr list))) (org-protocol-flatten (cdr list)))
(list list))))) (list list))))))
(defun org-protocol-parse-parameters (info &optional new-style default-order) (defun org-protocol-parse-parameters (info &optional new-style default-order)
"Return a property list of parameters from INFO. "Return a property list of parameters from INFO.