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

ivy-occur: set next-error-function. #2257

Closed
wants to merge 2 commits into from
Closed

Conversation

mookid
Copy link
Contributor

@mookid mookid commented Oct 4, 2019

This set of changes allows to use next-error and previous-error
as a replacement for ivy-occur-toggle-calling, ivy-occur-next-line
and ivy-occur-previous-line.

For example with next-error and bound to M-n and M-p:

  • "C-h f" (`describe-funtion')
  • "run" (`self-insert-command')
  • "C-c C-o" (`ivy-occur'); "C-o u" also works.
  • "M-n M-n M-n M-k M-k M-k"

this problem seems to be like #1353.

also see commit 1c45b29.

NOTE: the existing pop-to-buffer at the end of ivy-occur makes the UI of ivy-occur different from occur; this PR aims at getting ivy-occur closer to occur in that regards.

@abo-abo please let me know if that is of interest, this can probably be extended.

The second commit happens to fix #1354.

* ivy.el (ivy-occur): set next-error-last-buffer.

This change allows to use next-error and previous-error as
a replacement for ivy-occur-toggle-calling, ivy-occur-next-line and
ivy-occur-previous-line.

For example with next-error and bound to M-n and M-p:

- "C-h f" (`describe-funtion')
- "run" (`self-insert-command')
- "C-c C-o" (`ivy-occur'); "C-o u" also works.
- "M-n M-n M-n M-k M-k M-k"
@mookid
Copy link
Contributor Author

mookid commented Oct 5, 2019

To see an example where this change is particularly significant, call ivy-occur once (1), set next-error to target the buffer corresponding to the results of (1) (for instance, press n in this buffer) and call ivy-occur a second time (2).

With occur or with ivy-occur with the changes in that PR, next-error focus results of (2) (which is expected) while with ivy-occur on master, we keep hitting results of (1).

* swiper.el (swiper-occur): use ivy-occur-next-error.

This change ensures that next-error and previous-error work
for swiper even for buffer that do not visit a file.
@abo-abo
Copy link
Owner

abo-abo commented Oct 5, 2019

Thanks. Your example wasn't working for me until the follow-up commit.

@mookid
Copy link
Contributor Author

mookid commented Oct 5, 2019

Thanks! I think it also closes #1353.

astoff pushed a commit to astoff/swiper that referenced this pull request Jan 1, 2021
* ivy.el (ivy-occur-next-error): Add.

This change ensures that next-error and previous-error work
for swiper even for buffer that do not visit a file.

Fixes abo-abo#2257
Fixes abo-abo#1354
astoff pushed a commit to astoff/swiper that referenced this pull request Jan 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ivy-occur and search in *Help* buffer
2 participants