multi-occur is awesome. Can it be a buffer switcher #103

Closed
lewang opened this Issue Aug 23, 2012 · 10 comments

2 participants

@lewang
emacs-helm member

Hi Thierry,

I love the new multi-occur. I'll soon integrate it into helm-cmd-t.

It would be great if it could also serve as a buffer-switcher. That is - offer a mode where matches are collapsed into buffers ike

Buffer A <12 matches>
Buffer B <3 matches>
...

And when a line is selected, we switch to the buffer, but don't move the point. It would be great if this mode can be toggled straight from helm-multi-occur results (and of course, if there was a way to go straight into it).

@thierryvolpiatto
emacs-helm member
@lewang
emacs-helm member

In commit eddcd47 I added the ability for helm-multi-occur to take a list of buffers. My intention is to give it a list of buffers in current repository (or all buffers for that matter), and then narrow it down with occur search to find the buffer I want to switch to.

@thierryvolpiatto
emacs-helm member

Yes, you can also use helm-multi-occur-1 for this purpose.

I lost you when you want to give a list of buffer to *multi-occur and narrow it down with occur.
Why not narrowing this list of buffers with a simple helm source that list buffers like helm-buffers-list would do?

@lewang
emacs-helm member

I'm not sure if we are on the same page yet. I want to use buffer contents to filter down to a subset of given buffers and switch to one of them. It's debatable whether this should be added to to helm-buffers-list or helm-multi-occur.

@thierryvolpiatto
emacs-helm member
@lewang
emacs-helm member

Yes. I don't need to see each match, I just want to switch to a buffer without moving the point.

@thierryvolpiatto
emacs-helm member

So it is not helm-multi-occur you want, though it would work, but would be unnecessary slow for this, you need something that search your buffers for a pattern like multi-occur does, but that return immediately at first match, (i.e no need to scan all buffer) and search the next buffer and so on.
I have this (may be not exactly what you want but similar) in ioccur.el, see ioccur-find-buffer-matching.

@thierryvolpiatto thierryvolpiatto added a commit that referenced this issue Aug 26, 2012
@thierryvolpiatto thierryvolpiatto * helm-buffers.el (helm-c-buffer-match-major-mode): Issue #103 Match …
…inside buffers with @.

(helm-c-buffer-match-inside): new.
ce88e38
@thierryvolpiatto thierryvolpiatto added a commit that referenced this issue Aug 26, 2012
@thierryvolpiatto thierryvolpiatto * helm-buffers.el (helm-multi-occur-as-action): Issue #103 Use @ inpu…
…t as default input when present.

* helm-regexp.el (helm-multi-occur-1): Take one more arg INPUT.
* helm-help.el: Document new behavior of helm-buffers-list.
39c674b
@thierryvolpiatto
emacs-helm member

Try M-x helm-buffers-list
Assume you have many helm buffers files open (helm-buffers.el, helm-regexp.el etc...)
enter in pattern:
lisp ^helm @moc
the buffers containing an occurence of "moc" will be selected.
Now you can mark all these buffers, and launch helm-multi-occur with C-s, the default pattern used will be "moc".

@thierryvolpiatto
emacs-helm member

Note that if you have buffers prefixed by "@" and you want to match these buffers, you can escape the "@" e.g:
\@foo.
If you want to enter a space in pattern when using "@", use "\s-"
e.g if you want to search inside buffers "le wang", use "@le\s-wang"

@lewang
emacs-helm member

This is great.

@lewang lewang closed this Aug 26, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment