diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2018-12-17 13:26:42 -0800 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2018-12-17 13:32:52 -0800 |
commit | c5e02f2bce28f3b1f2006ce1f208f4a92ca05ed9 (patch) | |
tree | e4b2465343ceddd587684515029b7dad8f7f3ef2 /lisp/org/org-protocol.el | |
parent | 55838e4e6a176317367c6759e0520395e80c856f (diff) | |
download | emacs-c5e02f2bce28f3b1f2006ce1f208f4a92ca05ed9.tar.gz emacs-c5e02f2bce28f3b1f2006ce1f208f4a92ca05ed9.tar.bz2 emacs-c5e02f2bce28f3b1f2006ce1f208f4a92ca05ed9.zip |
Make org-protocol-flatten always an alias
* lisp/org/org-protocol.el (org-protocol-flatten):
Rewrite as top-level alias, as per Stefan’s suggestion,
to avoid compiler warnings.
Diffstat (limited to 'lisp/org/org-protocol.el')
-rw-r--r-- | lisp/org/org-protocol.el | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/lisp/org/org-protocol.el b/lisp/org/org-protocol.el index bb88c2fe1fd..2a4d51242cf 100644 --- a/lisp/org/org-protocol.el +++ b/lisp/org/org-protocol.el @@ -349,20 +349,20 @@ returned list." ret) l))) -(if (fboundp 'flatten-tree) - (defalias 'org-protocol-flatten 'flatten-tree) - (defun org-protocol-flatten (list) - "Transform LIST into a flat list. +(defalias 'org-protocol-flatten + (if (fboundp 'flatten-tree) 'flatten-tree + (lambda (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 list + (if (consp 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. |