summaryrefslogtreecommitdiff
path: root/helm-mode.el
diff options
context:
space:
mode:
authorThierry Volpiatto <thierry.volpiatto@gmail.com>2013-08-05 13:52:07 +0200
committerThierry Volpiatto <thierry.volpiatto@gmail.com>2013-08-05 13:52:07 +0200
commit1791fe0e6bef9e62aeace90276fc021543272497 (patch)
treedb3465dd35ff5cedde95f03824ea2f455ea9b05b /helm-mode.el
parentaede17d57fc4316a49611575081063c88793dd65 (diff)
* helm-mode.el (helm-comp-read): Avoid using eval, reorder.
Diffstat (limited to 'helm-mode.el')
-rw-r--r--helm-mode.el11
1 files changed, 5 insertions, 6 deletions
diff --git a/helm-mode.el b/helm-mode.el
index 64838889..e6864797 100644
--- a/helm-mode.el
+++ b/helm-mode.el
@@ -388,12 +388,11 @@ that use `helm-comp-read' See `helm-M-x' for example."
:buffer buffer))
;; Avoid adding an incomplete input to history.
(when (and result history del-input)
- (cond (;; Be sure history is not a symbol with a nil value.
- (and (symbolp history)
- (symbol-value history))
- (setcar (eval history) result))
- (;; A list with a non--nil value.
- (consp history) (setcar history result))
+ (cond ((symbolp history) ; History is a symbol.
+ ;; Be sure history is not a symbol with a nil value.
+ (helm-aif (symbol-value history) (setcar it result)))
+ ((consp history) ; A list with a non--nil value.
+ (setcar history result))
(t ; Possibly a symbol with a nil value.
(set history (list result)))))
(or