2

I've been trying to find a navigation package that allows backwards/forwards navigation across and within buffers. I have found a lot of solutions out there but none of them seem to solve the whole problem. Here are the requirements:

  1. Should work across buffers. This means locations within a buffer AND the in other buffers. Kind of like if the global mark ring merged all local buffer mark rings. I'd like the navigation between the two to be seamless and not require using separate commands for each one.

  2. Records marks on any meaningful cursor movement, but minimizes noise ala this question description.

  3. Has some sane bounds on the number of positions recorded and ideally is configurable.

  4. Should be able to go backwards AND forwards.

This answer gets close, but doesn't seem to work consistently with navigating within the local buffer.

Is there something out there that meets all these requirements or do I need to roll my own?

If I've missed a solution somewhere else that meets these requirements, please let me know.

UPDATE:

I think what i'm looking for is something like evil-jumper but without the evil part :) There is jumpc, but it seems to only insert jumps on edits, not other navigation points.

leeor
  • 141
  • 4
  • 1
    I did a quick and dirty hack where I ripped out all evil from evil-jumper here https://gist.github.com/71acc6c33fa35e075f85fcab1cd5c318 This might provide a good starting. Note, you'll need to bind nice-jumper/forward and nice-jumper/backward. – Martin R. Albrecht May 30 '16 at 17:05
  • @MartinR.Albrecht thanks! I'll check this out. I was contemplating doing the same thing myself :) The other option i'm considering is just auto-mark.el https://www.emacswiki.org/emacs/AutoMark and then going back and forth in the global mark ring. Ever try that? – leeor May 30 '16 at 17:14
  • Hmm, it seems this does still depend on evil-mode :( – leeor May 30 '16 at 18:55
  • Ah, looks like I missed a few evils in there, sorry. – Martin R. Albrecht May 30 '16 at 19:51
  • FYI: I just started using AutoMark with unpop-to-mark-command mentioned in https://stackoverflow.com/questions/3393834/how-to-move-forward-and-backward-in-emacs-mark-ring Okay for me at this moment. – AhLeung Oct 13 '17 at 06:15

1 Answers1

1

[First, I'll say up front that this answer does not satisfy your second requirement, which is to use more than just markers as points to visit. I mention it anyway, because I think it could help, if you combine it with code that automatically creates markers at the stopping points you want (however you might happen to define those). It is up to you how and when to create the markers. If you want that to be done automatically or semi-automatically, that is possible, but this answer does not address that.]

Icicles has command icicle-goto-any-marker, bound by default (in Icicle mode) to C-SPC with a zero prefix arg (e.g. C-0 C-SPC). It lets you visit any marker location, local or global. You can cycle among locations in various orders (including buffer-position order) and in either direction for a given order. You can visit locations directly, choosing them by the surrounding text (used as completion candidates).

By default (non-nil option icicle-show-multi-completion-flag), completion candidates are two-part multi-completions: (1) the buffer name and (2) the text at the marker. You can complete against either or both parts. If icicle-show-multi-completion-flag is nil then the buffer name is not included.

icicle-goto-any-marker was not specifically mentioned in the Icicles answer to the question you cite. The commands described there were for local and global markers separately. But all of the details provided in that answer apply equally to icicle-goto-any-marker.

Drew
  • 75,699
  • 9
  • 109
  • 225