2

When I use helm-mark-ring or helm-imenu, I would like to jump to the current candidate automatically in the other buffer while keeping the helm session (i.e., similar to helm-swoop). I tried the following codes mentioned on this thread, but didn't work for me.

(add-hook 'helm-before-initialize-hook #'(lambda () (helm-attrset 'follow 1 helm-source-mark-ring)))

Result: It shows [Display not ready] in echo area when I change the helm candidate (by C-n).

Any help appreciated!

Konstantin Morenko
  • 1,407
  • 9
  • 19
AhLeung
  • 1,083
  • 5
  • 14

1 Answers1

1

Put this in your .emacs (setq helm-follow-mode-persistent t) and whenever you enter helm-imenu or helm-mark-ring, press C-<up> or C-<down> to follow to that line in helm.

Chakravarthy Raghunandan
  • 3,132
  • 2
  • 18
  • 42
  • Thanks for the reply. I added the setq, but the helm session closed when I do C-. – AhLeung Aug 15 '16 at 17:44
  • That is strange, it works perfectly fine for me. Can you elaborate on what exactly happens when you press `C-` or `C-` ? Have you bound `C-` or `C-` to some other command ? And if you still have the add-hook command you mentioned in the post, i.e. `(add-hook 'helm-before-initialize-hook #'(lambda () (helm-attrset 'follow 1 helm-source-mark-ring)))' , please uncomment or remove this line and reload .emacs. – Chakravarthy Raghunandan Aug 15 '16 at 17:51
  • More details: For `helm-mark-ring`, it jumps to the location correctly, but the session closed when I pressed `C-` or `C-`. For `helm-imenu`, I got the following error when I pressed `C-` or `C-`: `(wrong-type-argument stringp # – AhLeung Aug 15 '16 at 17:51
  • Maybe you have something in your .emacs that is messing things up. Can you think of anything in your .emacs that is messing things up ? If not, edit the post adding the lines in your .emacs used for helm config – Chakravarthy Raghunandan Aug 15 '16 at 17:56
  • You are right! The following code messed up the persistent action: `(advice-add 'helm-execute-persistent-action :around #'dwim-helm-find-files-navigate-forward)`. After removing that, your answer works for me now. Thank you very much! – AhLeung Aug 15 '16 at 18:26