diff options
author | Thierry Volpiatto <thierry.volpiatto@gmail.com> | 2016-12-23 08:07:42 +0100 |
---|---|---|
committer | Thierry Volpiatto <thierry.volpiatto@gmail.com> | 2016-12-23 08:07:42 +0100 |
commit | 78d7f2e53f03c079dbf9fdd163112b4ea2133bb9 (patch) | |
tree | 9d3ce0057eb336204247ec3e6026abfd7e1c621c /helm-imenu.el | |
parent | 767530ea5c3a0e6d8ae3033569804790fb5a8e2f (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.el | 5 |
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)) |