I would like to invoke M-x helm-swoop
such that it does NOT return the symbol at point. I find that it always picks up undesired symbols, e.g. when I invoke M-x helm-swoop
in org-mode, I get Swoop: \*
, and I then have to delete the \*
before I can enter my desired search term. How can I do this?
Asked
Active
Viewed 364 times
3

Community
- 1
- 1

incandescentman
- 6,168
- 3
- 46
- 86
1 Answers
5
This has been bugging me as well, for exactly the same reason (swoop in an Org-mode buffer picking up heading characters), so this question motivated me to go and look.
Looking at the source, Helm-swoop calls helm-swoop-pre-input-function
to populate the prompt, and by default this is set to a function that returns (thing-at-point 'symbol)
, which is what causes the problem in headings.
A quick test with the following in my init file seems to work:
(setq helm-swoop-pre-input-function
(lambda () nil))
This could certainly be improved by, for example, keeping the default behaviour in non-Org buffers but as I'm only really using swoop in Org buffers this is good enough for me.

Stuart Hickinbottom
- 1,320
- 9
- 9
-
Warning, untested: `(add-hook 'org-mode (lambda () (setq-local help-swoop-pre-input-function (lambda () nil))))` – Resigned June 2023 Dec 22 '16 at 20:38