diff options
author | Thierry Volpiatto <thierry.volpiatto@gmail.com> | 2016-09-23 08:27:48 +0200 |
---|---|---|
committer | Thierry Volpiatto <thierry.volpiatto@gmail.com> | 2016-09-23 08:27:48 +0200 |
commit | 695ac8c1e54fcefe8b8524fb9aae8d90abd4ead1 (patch) | |
tree | 26e2ec605ee5be8937e8bcf166f3ee1811f20e5c /helm.el | |
parent | 243761ac8f951c924a7486fc0b2a51e84886c672 (diff) |
Handle cons in helm--maybe-process-filter-one-by-one-candidate.
* helm.el (helm--maybe-process-filter-one-by-one-candidate):
Do it.
Diffstat (limited to 'helm.el')
-rw-r--r-- | helm.el | 17 |
1 files changed, 10 insertions, 7 deletions
@@ -2740,14 +2740,17 @@ Cache the candidates if there is no cached value yet." candidates)) (defmacro helm--maybe-process-filter-one-by-one-candidate (candidate source) - "Execute `filter-one-by-one' function(s) on CANDIDATE in SOURCE." + "Execute `filter-one-by-one' function(s) on real value of CANDIDATE in SOURCE." `(helm-aif (assoc-default 'filter-one-by-one ,source) - (if (and (listp it) - (not (functionp it))) ;; Don't treat lambda's as list. - (cl-loop for f in it - do (setq ,candidate (funcall f ,candidate)) - finally return ,candidate) - (setq ,candidate (funcall it ,candidate))) + (let ((real (if (consp ,candidate) + (cdr ,candidate) + ,candidate))) + (if (and (listp it) + (not (functionp it))) ;; Don't treat lambda's as list. + (cl-loop for f in it + do (setq ,candidate (funcall f real)) + finally return ,candidate) + (setq ,candidate (funcall it real)))) ,candidate)) (defun helm--initialize-one-by-one-candidates (candidates source) |