GNU bug report logs - #52417
Mark ring navigation could be two-way

Previous Next

Package: emacs;

Reported by: ndame <laszlomail <at> protonmail.com>

Date: Fri, 10 Dec 2021 21:21:01 UTC

Severity: wishlist

To reply to this bug, email your comments to 52417 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#52417; Package emacs. (Fri, 10 Dec 2021 21:21:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to ndame <laszlomail <at> protonmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 10 Dec 2021 21:21:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: ndame <laszlomail <at> protonmail.com>
To: "Bug reports for GNU Emacs,
 the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
Subject: Mark ring navigation could be two-way
Date: Fri, 10 Dec 2021 21:20:06 +0000
Other tools has similar features like the mark ring and they
provide two-way navigation, so you can go back to some previous
position to check something, and then you can go forward in the
ring to get back to a more recent position or the latest position
if you want.

Emacs could have this too by providing a command which allows
moving forward in the mark ring.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#52417; Package emacs. (Sat, 11 Dec 2021 15:45:02 GMT) Full text and rfc822 format available.

Message #8 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Daniel Martín <mardani29 <at> yahoo.es>
To: ndame via "Bug reports for GNU Emacs, the Swiss army knife of text
 editors" <bug-gnu-emacs <at> gnu.org>
Cc: 52417 <at> debbugs.gnu.org, ndame <laszlomail <at> protonmail.com>
Subject: Re: bug#52417: Mark ring navigation could be two-way
Date: Sat, 11 Dec 2021 16:44:13 +0100
ndame via "Bug reports for GNU Emacs, the Swiss army knife of text
editors" <bug-gnu-emacs <at> gnu.org> writes:

> Other tools has similar features like the mark ring and they
> provide two-way navigation, so you can go back to some previous
> position to check something, and then you can go forward in the
> ring to get back to a more recent position or the latest position
> if you want.
>
> Emacs could have this too by providing a command which allows
> moving forward in the mark ring.

+1.  I agree that this is a useful feature that would improve the text
editing capabilities of Emacs.  In Vim, you can use C-i and C-o to
navigate forwards and backwards, respectively.

A similar thing happens with the kill-ring.  M-y moves the last-yank
pointer in one direction, but there could be a command to move it in the
opposite direction.  Even if the mark and kill ring cycle, it is
inconvenient to browse them in one direction only, because as modern
computers have more memory available, the rings can store more things.

This is probably one of the reasons why there are a lot of external
packages that let you browse the contents of the mark-ring and kill-ring
in the minibuffer or a separate buffer.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#52417; Package emacs. (Sat, 11 Dec 2021 15:45:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#52417; Package emacs. (Sat, 11 Dec 2021 18:53:02 GMT) Full text and rfc822 format available.

Message #14 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Daniel Martín via "Bug reports for GNU Emacs, the
 Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
Cc: 52417 <at> debbugs.gnu.org, laszlomail <at> protonmail.com,
 Daniel Martín <mardani29 <at> yahoo.es>
Subject: Re: bug#52417: Mark ring navigation could be two-way
Date: Sat, 11 Dec 2021 20:34:31 +0200
>> Other tools has similar features like the mark ring and they
>> provide two-way navigation, so you can go back to some previous
>> position to check something, and then you can go forward in the
>> ring to get back to a more recent position or the latest position
>> if you want.
>>
>> Emacs could have this too by providing a command which allows
>> moving forward in the mark ring.
>
> +1.  I agree that this is a useful feature that would improve the text
> editing capabilities of Emacs.  In Vim, you can use C-i and C-o to
> navigate forwards and backwards, respectively.
>
> A similar thing happens with the kill-ring.  M-y moves the last-yank
> pointer in one direction, but there could be a command to move it in the
> opposite direction.  Even if the mark and kill ring cycle, it is
> inconvenient to browse them in one direction only, because as modern
> computers have more memory available, the rings can store more things.
>
> This is probably one of the reasons why there are a lot of external
> packages that let you browse the contents of the mark-ring and kill-ring
> in the minibuffer or a separate buffer.

After enabling repeat-mode, this browses the kill-ring with
'M-y up down up down ...'

  (defvar yank-pop-repeat-map
    (let ((map (make-sparse-keymap)))
      (define-key map "\M-y" 'yank-pop)
      (define-key map [up] 'yank-pop)
      (define-key map [down] (lambda ()
                               (interactive)
                               (setq repeat-map 'yank-pop-repeat-map)
                               (yank-pop -1)))
      map)
    "Keymap to repeat `yank-pop' key sequences.  Used in `repeat-mode'.")

  (put 'yank-pop 'repeat-map 'yank-pop-repeat-map)

The same can be created for the mark-ring.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#52417; Package emacs. (Sat, 11 Dec 2021 18:53:03 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#52417; Package emacs. (Sat, 11 Dec 2021 20:12:02 GMT) Full text and rfc822 format available.

Message #20 received at submit <at> debbugs.gnu.org (full text, mbox):

From: André A. Gomes <andremegafone <at> gmail.com>
To: Daniel Martín via "Bug reports for GNU Emacs, the Swiss
 army knife of text editors" <bug-gnu-emacs <at> gnu.org>
Cc: 52417 <at> debbugs.gnu.org, laszlomail <at> protonmail.com,
 Daniel Martín <mardani29 <at> yahoo.es>
Subject: Re: bug#52417: Mark ring navigation could be two-way
Date: Sat, 11 Dec 2021 20:11:50 +0000
Daniel Martín via "Bug reports for GNU Emacs, the Swiss army knife of
text editors" <bug-gnu-emacs <at> gnu.org> writes:

> ndame via "Bug reports for GNU Emacs, the Swiss army knife of text
> editors" <bug-gnu-emacs <at> gnu.org> writes:
>
>> Other tools has similar features like the mark ring and they
>> provide two-way navigation, so you can go back to some previous
>> position to check something, and then you can go forward in the
>> ring to get back to a more recent position or the latest position
>> if you want.
>>
>> Emacs could have this too by providing a command which allows
>> moving forward in the mark ring.
>
> +1.  I agree that this is a useful feature that would improve the text
> editing capabilities of Emacs.  In Vim, you can use C-i and C-o to
> navigate forwards and backwards, respectively.
>
> A similar thing happens with the kill-ring.  M-y moves the last-yank
> pointer in one direction, but there could be a command to move it in the
> opposite direction.  Even if the mark and kill ring cycle, it is
> inconvenient to browse them in one direction only, because as modern
> computers have more memory available, the rings can store more things.
>
> This is probably one of the reasons why there are a lot of external
> packages that let you browse the contents of the mark-ring and kill-ring
> in the minibuffer or a separate buffer.

Regarding M-y, you can use negative prefixes to move in the opposite
direction.

Regarding the mark ring, I don't think it's possible.  If indeed it's
not, I think it's a good idea to add such functionality.


-- 
André A. Gomes
"Free Thought, Free World"




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#52417; Package emacs. (Sat, 11 Dec 2021 20:12:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#52417; Package emacs. (Mon, 13 Dec 2021 01:19:02 GMT) Full text and rfc822 format available.

Message #26 received at 52417 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: ndame <laszlomail <at> protonmail.com>, 52417 <at> debbugs.gnu.org
Subject: Re: bug#52417: Mark ring navigation could be two-way
Date: Mon, 13 Dec 2021 04:17:38 +0300
On 11.12.2021 00:20, ndame via Bug reports for GNU Emacs, the Swiss army 
knife of text editors wrote:
> Other tools has similar features like the mark ring and they
> provide two-way navigation, so you can go back to some previous
> position to check something, and then you can go forward in the
> ring to get back to a more recent position or the latest position
> if you want.
> 
> Emacs could have this too by providing a command which allows
> moving forward in the mark ring.

FWIW, we've recently added xref-go-forward, bound to 'C-M-,', which 
pairs with xref-go-back (which was renamed at the same time), bound to 
'M-,'.

A fair number of commands both push to mark ring and call 
xref-push-marker-stack, so you might find this useful.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#52417; Package emacs. (Mon, 13 Dec 2021 09:49:03 GMT) Full text and rfc822 format available.

Message #29 received at 52417 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Dmitry Gutov <dgutov <at> yandex.ru>
Cc: 52417 <at> debbugs.gnu.org, ndame <laszlomail <at> protonmail.com>
Subject: Re: bug#52417: Mark ring navigation could be two-way
Date: Mon, 13 Dec 2021 10:44:52 +0200
>> Emacs could have this too by providing a command which allows
>> moving forward in the mark ring.
>
> FWIW, we've recently added xref-go-forward, bound to 'C-M-,', which pairs
> with xref-go-back (which was renamed at the same time), bound to 'M-,'.
>
> A fair number of commands both push to mark ring and call
> xref-push-marker-stack, so you might find this useful.

Another idea: add a command that will display a *xref* buffer
with lines of locations extracted from the global-mark-ring.
This will allow visiting mark locations from the mark list.
Maybe this can be implemented by just adding a new xref backend?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#52417; Package emacs. (Mon, 13 Dec 2021 15:11:02 GMT) Full text and rfc822 format available.

Message #32 received at 52417 <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: Juri Linkov <juri <at> linkov.net>, Dmitry Gutov <dgutov <at> yandex.ru>
Cc: "52417 <at> debbugs.gnu.org" <52417 <at> debbugs.gnu.org>,
 ndame <laszlomail <at> protonmail.com>
Subject: RE: [External] : bug#52417: Mark ring navigation could be two-way
Date: Mon, 13 Dec 2021 15:09:55 +0000
> Another idea: add a command that will display a *xref* buffer
> with lines of locations extracted from the global-mark-ring.
> This will allow visiting mark locations from the mark list.

FWIW, I added this to Icicles on Dec 16, 2006.

By default, in Icicle mode there are these
multi-commands:

1. `C-SPC is bound' to
`icicle-goto-marker-or-set-mark-command'.

Goes to a marker or sets the mark.
No prefix arg or prefix arg > 0: `set-mark-command'.
Prefix arg < 0: goes to a local marker you choose.
Prefix arg = 0: goes to global or local marker.

Completion candidates are text of the marker's
line.

2. `C-x C-SPC' is bound to
`icicle-goto-global-marker-or-pop-global-mark'.

Goes to a global marker or pops the global mark.
Prefix arg < 0: goes to global marker you choose.
Otherwise, this is `pop-global-mark'.

Completion candidates can be multi-completions,
with two parts: (1) marker's buffer name, (2) text
from marker's line.  You can match either or both
parts, to narrow the choices.

By default, candidates are sorted in buffer order
and then marker order (buffer position).  As usual,
you can change the sort order on the fly.
___

A "multi-command" means that you can, with a single
command invocation, act multiple times, e.g. on
different completion candidates.  So you can move
around among marker positions, including cycling
in buffer order (or other orders).




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#52417; Package emacs. (Mon, 13 Dec 2021 15:17:02 GMT) Full text and rfc822 format available.

Message #35 received at 52417 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Juri Linkov <juri <at> linkov.net>
Cc: 52417 <at> debbugs.gnu.org, ndame <laszlomail <at> protonmail.com>
Subject: Re: bug#52417: Mark ring navigation could be two-way
Date: Mon, 13 Dec 2021 18:15:47 +0300
On 13.12.2021 11:44, Juri Linkov wrote:
> Another idea: add a command that will display a*xref*  buffer
> with lines of locations extracted from the global-mark-ring.
> This will allow visiting mark locations from the mark list.
> Maybe this can be implemented by just adding a new xref backend?
> 

An Xref backend is something used automatically. This one would shadow 
some "real" backends that provide code navigation, for example.

But we could have a command which lists the entries from 
global-mark-ring in an Xref results buffer, allowing navigation across 
them, or jumping to a specific one.

But I guess one problem is xref--show-xrefs also pushes mark to mark 
ring (including the global one). So using the aforementioned command 
would automatically alter its results list.

But maybe it's not too much of a problem.




Severity set to 'wishlist' from 'normal' Request was from Stefan Kangas <stefan <at> marxist.se> to control <at> debbugs.gnu.org. (Tue, 14 Dec 2021 02:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 183 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.