summaryrefslogtreecommitdiff
path: root/helm-imenu.el
diff options
context:
space:
mode:
authorThierry Volpiatto <thierry.volpiatto@gmail.com>2016-12-23 08:07:42 +0100
committerThierry Volpiatto <thierry.volpiatto@gmail.com>2016-12-23 08:07:42 +0100
commit78d7f2e53f03c079dbf9fdd163112b4ea2133bb9 (patch)
tree9d3ce0057eb336204247ec3e6026abfd7e1c621c /helm-imenu.el
parent767530ea5c3a0e6d8ae3033569804790fb5a8e2f (diff)
Avoid repeat in last commit.
* helm-imenu.el (helm-imenu--maybe-switch-to-buffer): DRY.
Diffstat (limited to 'helm-imenu.el')
-rw-r--r--helm-imenu.el5
1 files changed, 3 insertions, 2 deletions
diff --git a/helm-imenu.el b/helm-imenu.el
index c8db63db..ef6a81d8 100644
--- a/helm-imenu.el
+++ b/helm-imenu.el
@@ -124,8 +124,9 @@ only '((foo . bar)) is needed."
:fuzzy-match helm-imenu-fuzzy-match))))
(defun helm-imenu--maybe-switch-to-buffer (candidate)
- (helm-aif (and (markerp (cdr candidate)) (marker-buffer (cdr candidate)))
- (switch-to-buffer it)))
+ (let ((cand (cdr candidate)))
+ (helm-aif (and (markerp cand) (marker-buffer cand))
+ (switch-to-buffer it))))
(defun helm-imenu--execute-action-at-once-p ()
(let ((cur (helm-get-selection))