summaryrefslogtreecommitdiff
path: root/helm.el
diff options
context:
space:
mode:
authorThierry Volpiatto <thierry.volpiatto@gmail.com>2016-09-23 08:27:48 +0200
committerThierry Volpiatto <thierry.volpiatto@gmail.com>2016-09-23 08:27:48 +0200
commit695ac8c1e54fcefe8b8524fb9aae8d90abd4ead1 (patch)
tree26e2ec605ee5be8937e8bcf166f3ee1811f20e5c /helm.el
parent243761ac8f951c924a7486fc0b2a51e84886c672 (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.el17
1 files changed, 10 insertions, 7 deletions
diff --git a/helm.el b/helm.el
index aa64094e..f5968cb9 100644
--- a/helm.el
+++ b/helm.el
@@ -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)