diff options
author | Thierry Volpiatto <thierry.volpiatto@gmail.com> | 2019-07-30 06:29:28 +0200 |
---|---|---|
committer | Thierry Volpiatto <thierry.volpiatto@gmail.com> | 2019-07-30 06:49:48 +0200 |
commit | c400a9f38257964d0c5ae4fc1f740a968f517d25 (patch) | |
tree | 3ed4bacc0a6f77bcbcc9d3895bea681d00ffb734 /helm-lib.el | |
parent | fba8b267b7d967a1379863828b71cdb974b1b8c6 (diff) |
Prevent follow-mode when moving between sections
in imenu.
NOTE: `helm-imenu-next-or-previous-section` uses now a new macro,
expect some user errors at Melpa install.
* helm-lib.el (helm-without-follow): New macro.
* helm-imenu.el (helm-imenu-next-or-previous-section): Do it by
wrapping calls to helm-next/previous-line in new macro.
Diffstat (limited to 'helm-lib.el')
-rw-r--r-- | helm-lib.el | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/helm-lib.el b/helm-lib.el index d14c1434..2aa0a95b 100644 --- a/helm-lib.el +++ b/helm-lib.el @@ -1303,6 +1303,14 @@ That is what completion commands operate on." `(with-selected-window (helm-window) ,@body)) +(defmacro helm-without-follow (&rest body) + "Ensure BODY runs without following. +I.e. when using `helm-next-line' and friends in BODY." + (declare (indent 0) (debug t)) + `(cl-letf (((symbol-function 'helm-follow-mode-p) + (lambda (&optional _) nil))) + (let (helm-follow-mode-persistent) + (progn ,@body)))) ;; Yank text at point. ;; |