3

I have just explore how to use mark rings in emacs.

There are two kind of mark type mark-ring and global-mark-ring.

What are the differences between them and is there any option to push all marks to global to reaching from everywhere?

4

You should pose only one question per question here.

  1. For your first question: *What are the differences between the mark-ring and the global-mark-ring:

    This is answered very well in the Emacs manual, nodes Mark Ring and Global Mark Ring.

    You really owe it to yourself to learn to ask Emacs: C-h r is your starting point.

    From node Global Mark Ring:

    In addition to the ordinary mark ring that belongs to each buffer, Emacs has a single "global mark ring".

    Each time you set a mark, this is recorded in the global mark ring in addition to the current buffer’s own mark ring, if you have switched buffers since the previous mark setting.

    Hence, the global mark ring records a sequence of buffers that you have been in, and, for each buffer, a place where you set the mark. The length of the global mark ring is controlled by global-mark-ring-max, and is 16 by default.

    If there is something unclear about that then please refine your question or pose another one.

  2. Your second question is unclear to me: Is there any option to push all marks to global to reaching from everywhere?

    Are you asking whether the global-mark-ring could just include all marks from all buffers? If so, the answer is no, there is no such option.

    However, if you use Icicles then you have command icicle-goto-any-marker, which does let you go to any marker from any buffer. It is bound to C-0 C-SPC. (Perhaps Helm has something similar?) You also have commands icicle-goto-marker, bound to C-- C-SPC, and icicle-goto-global-marker, bound to C-- C-x C-SPC, which let you navigate among only markers in a given buffer or only global markers, respectively.

    icicle-goto-any-marker is an interactive compiled Lisp function in icicles-cmd2.el.

    It is bound to menu-bar search goto icicles icicle-goto-any-marker.

    (icicle-goto-any-marker)

    Like icicle-goto-marker, but lets you visit markers in all buffers. If user option icicle-show-multi-completion-flag is non-nil, then each completion candidate is has two parts, the first of which is the name of the marker's buffer, and the second of which is the text from the marker's line.

    By default, candidates are sorted in buffer order and then marker order, that is, buffer positions. Use C-M-, or C-, to change the sort order. Remember too that you can use C-A to toggle case-sensitivity (e.g., for buffer names).

    See also command icicle-goto-global-marker.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.