Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Symbol's value as variable is void: helm-swoop-pattern #123

Closed
kevinkwl opened this issue Jan 22, 2018 · 54 comments

Comments

@kevinkwl
Copy link

commented Jan 22, 2018

macOS 10.13.1, emacs 25.3

helm-swoop does not work.
Here's my config:

(use-package helm-swoop
  :ensure t
  :bind (("M-m" . helm-swoop)
	 ("M-M" . helm-swoop-back-to-last-point))
  :init
  (bind-key "M-m" 'helm-swoop-from-isearch isearch-mode-map))

helm version:

helm-swoop         20170923.2127 installed   
@jack99999

This comment has been minimized.

Copy link

commented Jan 22, 2018

same problem here. it started yesterday.

i have the same help-swoop version as kevinkwl on linux with emacs 27.0.50.

@caisah

This comment has been minimized.

Copy link

commented Jan 22, 2018

Same here:

Emacs 26.0.90
helm 20180119.1053
helm-core 20180121.1022
helm-swoop 20170923.2127

@stsquad

This comment has been minimized.

Copy link

commented Jan 22, 2018

Given the lack of change in swoop over the weekend I guess this is something that has changed in helm that has broken helm-swoop.

jguenther added a commit to jguenther/helm-swoop that referenced this issue Jan 22, 2018
* Now has an additional optional arg, `RESUME'.

* Make `helm-swoop-split-window-function' customizable, and move
  the default implementation to a function (instead of a lambda).

* Fixes emacsorphanage#123
jguenther added a commit to jguenther/helm-swoop that referenced this issue Jan 22, 2018
* This function now has an additional optional arg, `RESUME'.

* Make `helm-swoop-split-window-function' customizable, and move
  the previous default lambda value to a named function,
  `helm-swoop--split-window-default'.

* Fixes emacsorphanage#123
@taurhine

This comment has been minimized.

Copy link

commented Jan 22, 2018

I can confirm that it is Helm. Helm from melpa stable with the latest snapshot of helm-swoop runs just fine!

@gtmshrm

This comment has been minimized.

Copy link

commented Jan 22, 2018

Same here. It began yesterday.

Emacs 25.3.1
helm-20180119.1053
helm-core-20180122.706
helm-swoop-20170923.2127

@mike-hewitson

This comment has been minimized.

Copy link

commented Jan 23, 2018

Ditto.

Emacs 25.2.1
helm-20180119.1053
helm-core-20180122.706
helm-swoop-20170923.2127

@jack99999

This comment has been minimized.

Copy link

commented Jan 23, 2018

fwiw, this is what the debugger comes up with... looks like a change to a function definition but my knowledge is then exhausted:

Debugger entered--Lisp error: (wrong-number-of-arguments (1 . 1) 2) #f(compiled-function ($buf) #<bytecode 0x12101dd>)("*Helm Swoop*" nil) helm-display-buffer("*Helm Swoop*" nil) helm-internal(((name . "*scratch*") (candidates [i have deleted lots of output. jack]:candidate-number-limit 19999) helm-swoop() funcall-interactively(helm-swoop) call-interactively(helm-swoop nil nil) command-execute(helm-swoop)

@twlz0ne

This comment has been minimized.

Copy link

commented Jan 23, 2018

Same here:

  • macOS 10.11.6
  • Emacs 25.3 / 26.0.91 / 27.0.50
  • helm-20180119.1053
  • helm-core-20180121.30
  • helm-swoop-20170923.2127
@wusticality

This comment has been minimized.

Copy link

commented Jan 23, 2018

Same here, broken since the new helm update.

@stsquad

This comment has been minimized.

Copy link

commented Jan 23, 2018

@it3ration @twlz0ne @jack99999 can you try @jguenther's patch in PR #124

@jack99999

This comment has been minimized.

Copy link

commented Jan 24, 2018

the patch is working for me. (1 min testing). thanks

@madper

This comment has been minimized.

Copy link

commented Jan 24, 2018

@stsquad The patch works for me as well. Thanks.

@velkyel

This comment has been minimized.

Copy link

commented Jan 25, 2018

@ShingoFukuyama apply the patch please.

@dchrzanowski

This comment has been minimized.

Copy link

commented Jan 27, 2018

Patch works fine for me as well

@wusticality

This comment has been minimized.

Copy link

commented Jan 30, 2018

Does @ShingoFukuyama still maintain this package? Curious how we can get this patch into melpa, I rely on use-package mostly.

@dchrzanowski

This comment has been minimized.

Copy link

commented Jan 30, 2018

His last commit on GitHub was in early October. Tough to tell. Someone might have to fork it 🤔

@torgeir

This comment has been minimized.

Copy link

commented Jan 30, 2018

Patch confirmed working here as well.

@HuStmpHrrr

This comment has been minimized.

Copy link

commented Feb 1, 2018

The patch does work. However, it's highly doubted that if the author is still maintaining this, after a long while. it would be nice if someone can fork it and publish it to melpa.

@wusticality

This comment has been minimized.

Copy link

commented Feb 1, 2018

I agree with @HuStmpHrrr, it doesn't seem to be actively maintained, I hate to manually require helm-swoop from a git repo ..

@velkyel

This comment has been minimized.

Copy link

commented Feb 1, 2018

@it3ration it's quite easy using quelpa (package on melpa), for example:

(quelpa '(pkg-name :fetcher github :repo "user/repo"))
(require 'pkg-name)
@HuStmpHrrr

This comment has been minimized.

Copy link

commented Feb 1, 2018

I do not think it's the problem of obtaining this particular fix or not. It's a matter of whether the tool is maintained.

This particular incident is in fact caused by a helm update, not a problem from helm-swoop side. Since helm is for sure actively maintained, it's almost certain that in the future, interface changes like this will happen, or even deprecations. at that time, there needs to be someone who knows the code well enough to do corresponding changes and makes it published to melpa. This is very unfortunate, but unmaintained tool is very hard to live with, and even more unfortunately, this is a good tool.

@dchrzanowski

This comment has been minimized.

Copy link

commented Feb 1, 2018

@HuStmpHrrr I just couldn't agree more. I don't know if I can live without helm-swoop. Swiper seems so much slower, contrary to what people say.

@thesaitama

This comment has been minimized.

Copy link

commented Feb 3, 2018

@ShingoFukuyama the patch works well. helm-swoop is important tool for me. please apply melpa.

@wusticality

This comment has been minimized.

Copy link

commented Feb 3, 2018

Seems like someone's going to have to fork this project and maintain it which is unfortunate. I'd volunteer but I'm starting a new gig and don't have the time.

@taurhine

This comment has been minimized.

Copy link

commented Feb 4, 2018

Pity, helm-swoop is an essential package for me too.
Maybe a contributor from helm/helm-core can adopt it?

@dchrzanowski

This comment has been minimized.

Copy link

commented Feb 4, 2018

It is actually a good idea to merge swoop into helm core

@HuStmpHrrr

This comment has been minimized.

Copy link

commented Feb 7, 2018

@it3ration you can reuse the one from melpa. you can do the following:

  1. locate helm-swoop in ~/.emacs.d/elpa
  2. apply the patch to source
  3. inside of emacs, run M-x byte-recompile-file and recompile that particular file.
  4. restart emacs.
@wusticality

This comment has been minimized.

Copy link

commented Feb 7, 2018

@HuStmpHrrr thanks for this, hopefully it gets pulled into main at some point. or someone creates a version of it that's >= in terms of functionality ..

@dylan-conlin

This comment has been minimized.

Copy link

commented Feb 9, 2018

What is the recommended way to apply patch #124?

@HuStmpHrrr

This comment has been minimized.

Copy link

commented Feb 9, 2018

@dylan-conlin you can do it in many ways.

you can either

  1. edit the file manually, or
  2. clone @jguenther repository, or
  3. download the patch file and apply the patch if you don't believe yourself, by adding .patch at the end of the url, like following
    https://github.com/ShingoFukuyama/helm-swoop/pull/124.patch

just remember to run recompile to make sure emacs loads the right code.

@mashu

This comment has been minimized.

Copy link

commented Feb 12, 2018

Any follow up ? Issue was reported 21 days ago...
Patch is not yet in Melpa right, otherwise it would work for me?

@prosoitos

This comment has been minimized.

Copy link

commented Feb 12, 2018

After reading the comment of thierryvolpiatto, I realized that helm-occur, with minimal tweaking, does indeed do the same thing. So exploring this might be an alternative. I thought that I would do this as a temporary fix, but am now so happy that I have settled on it. Searching of special characters is much more consistant than helm-swoop and with the following options, it looks just as good.

@dbitouze

This comment has been minimized.

Copy link

commented Feb 12, 2018

I realized that helm-occur, with minimal tweaking, does indeed do the same thing

AFAICS, helm-occur doesn't provide the nice helm-swoop's feature that the original buffer's cursor is jumping line to line according to moving up and down the line list. Did I miss something?

@HuStmpHrrr

This comment has been minimized.

Copy link

commented Feb 12, 2018

@prosoitos do you mind sharing some tweaks you were referring to?

@dbitouze AFAIK, you can press C-c C-f in a helm-occur window to achieve that behavior. more operations can be seen by doing C-h m.

@dbitouze

This comment has been minimized.

Copy link

commented Feb 12, 2018

@HuStmpHrrr Indeed, C-c C-f does the trick but AFAICS, it is much slower than helm-swoop to jump from line to line in the original buffer.

@taurhine

This comment has been minimized.

Copy link

commented Feb 12, 2018

With (setq helm-follow-mode-persistent t) helm-occur almost does the same thing, thanks for mentioning it!

Btw. without setting the helm-follow-mode-persistent to non-nil one can still jump around the results by holding ctrl while going through results just like in helm-mini etc.

However, helm-occur seems to ignore mark and fetch only the word which is below the cursor.
I find it kind of annoying but still much better than ivy-swiper IMHO.

Maybe helm maintainers can cherry pick good design decisions from helm-swoop and "improve" helm-occur? I also like the helm-swoop formatting more.

@prosoitos

This comment has been minimized.

Copy link

commented Feb 12, 2018

You can set it in more subtle ways, so that helm only follows in occur. See for instance the 2nd answer of https://emacs.stackexchange.com/questions/2563/helm-search-within-buffer-feature:

(require 'helm-config)

(defvar my-helm-follow-sources ()
  "List of sources for which helm-follow-mode should be enabled")

;; Use helm-follow-mode for the following sources:
(add-to-list 'my-helm-follow-sources 'helm-source-occur)

(defun my-helm-set-follow ()
  "Enable helm-follow-mode for the sources specified in the list
variable `my-helm-follow-sources'. This function is meant to
be run during `helm-initialize' and should be added to the hook
`helm-before-initialize-hook'."
  (mapc (lambda (source)
          (when (memq source my-helm-follow-sources)
            (helm-attrset 'follow 1 (symbol-value source))))
        helm-sources))

;; Add hook to enable helm-follow mode for specified helm 
(add-hook 'helm-before-initialize-hook 'my-helm-set-follow)

Making the formatting looks like helm-swoop is also easy by playing with a few of the helm faces.

And, honestly, as much as I loved helm-swoop until this happened, I have now realized that thierryvolpiatto is right and helm-occur is MUCH faster. On large files, it is really obvious. So in the end, I am actually really happy with the swap and let go of helm-swoop.

@prosoitos

This comment has been minimized.

Copy link

commented Feb 12, 2018

I spent a few days following this thread, eager to see the patch applied. But after I set helm-occur to behave as I wanted (and working even better than helm-swoop), I felt really happy. So I thought that I would mention it here, so that others who are still hoping for helm-swoop to be rescued can try this and see if it works for them.

@mike-hewitson

This comment has been minimized.

Copy link

commented Feb 13, 2018

@prosoitos Thank you for rescuing me! This works perfectly for me.

@dbitouze

This comment has been minimized.

Copy link

commented Feb 13, 2018

@prosoitos I applied this patch for helm-swoop and what you suggest for helm-occur. The former is still much smoother and faster than the latter, e.g. on a 300K .tex file (with 11270 lines).

@wusticality

This comment has been minimized.

Copy link

commented Feb 13, 2018

Is there some way to control how helm-occur splits the window? I always had helm-swoop pop up to the right of my current window, not on the bottom. Also curious if anyone has found a way to wrap around once you reach the top / bottom.

With respect, I can't help but think that the solution(s) posted by @prosoitos are not exactly straightforward .. am I crazy?

@prosoitos

This comment has been minimized.

Copy link

commented Feb 13, 2018

(setq helm-split-window-default-side (quote right))

(Explore all the helm customisations (lots of them...) to make it look however you want. Mine looks exactly the way helm-swoop did).

Helm-occur is faster in my setup and for my usage. And it searches for special characters predictably. So it works great for me. Now, if that doesn't work for you, sorry about that. I was just trying to help.

@wusticality

This comment has been minimized.

Copy link

commented Feb 13, 2018

Hey @prosoitos, thanks for the response, I wasn't trying to criticize, it's my fault for not understanding helm's internals. :)

Any idea how to control the helm buffer location for just helm-occur? helm-swoop opens the filtered results buffer to the left or right of the current buffer for me, whichever is the opposite of the current buffer.

On an unrelated note, do you know much about helm-attrset? I'm curious what else you can customize.

@prosoitos

This comment has been minimized.

Copy link

commented Feb 13, 2018

(setq helm-move-to-line-cycle-in-source t) for the "wrap around".

No offence. I was just trying to suggest exploring helm's capacities and options further since I was inspired by this post emacs-helm/helm#1966 to do so myself, which allowed me to realize that helm-occur can do everything I wanted and more.

@prosoitos

This comment has been minimized.

Copy link

commented Feb 13, 2018

I don't think that there is a pre-written option to change the window configuration just for helm-occur. But you could easily do that with popwin.. Or write a function for helm-split-window-preferred-function.

Anyway, I am stepping out of this thread as we are really moving off topic.

@prosoitos

This comment has been minimized.

Copy link

commented Feb 13, 2018

@it3ration If you do M-x customize-group Ret helm Ret you will be able to explore and play with the regular options. And of course, you can always write functions to tweak things beyond that. Good luck!

@dbitouze

This comment has been minimized.

Copy link

commented Feb 13, 2018

Here is a screencast which shows helm-swoop is still much smoother and faster than the helm-occur, e.g. on a 300K .tex file (with 11270 lines).
helm-occur-vs-helm-swoop

One can also see that helm-swoop displays the comments as in the original buffer.

@prosoitos

This comment has been minimized.

Copy link

commented Feb 13, 2018

One issue I had with helm-swoop is that it was unclear to me whether it was using regexp matching or not. For some patterns, it behaved as in a regexp search, while for others, it didn't. It was very hard for instance to look through my emacs init file or other files with key bindings and many special characters. helm-occur is very predictable and also allows fun things like every !thing to look for every* (everyone, everywhere, everybody, etc.) but not everything for instance. I truly was a fan of helm-swoop until the recent events. But I am now a totally converted helm fan :D

And for the speed, I don't know what to say. helm-swoop, in my settings, was struggling to search in the list-packages buffer for instance. While helm-occur is much smoother for me there. But that might depend on settings, etc.

At the end of the day, if nobody takes over the project, it doesn't matter whether the patch gets applied or not as some other helm update will break it again. With helm doing something so very similar and being actively developed and maintained, that is is not looking good for helm-swoop. So regardless of personal preferences over details, it might just be more practical in the long run to switch over. And that's why I was trying to help others with my posts.

@xuchengpeng

This comment has been minimized.

Copy link

commented Feb 14, 2018

@it3ration
patch test ok

(use-package helm-swoop
  :ensure t
  :load-path "site-lisp/helm-swoop"
@wusticality

This comment has been minimized.

Copy link

commented Feb 15, 2018

marchdf added a commit to marchdf/dotfiles that referenced this issue May 29, 2018
Discussion
[here](emacsorphanage/helm-swoop#123) seems
to indicate that helm-swoop is no longer under active development and
it was broken by changes in helm. It also suggests how to replace it
with native helm functionality like helm-occur.
@cireu

This comment has been minimized.

Copy link
Contributor

commented Aug 13, 2019

This is fixed in master, please test.

@cireu cireu closed this Aug 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.