unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Jean Louis <bugs@gnu.support>
To: Drew Adams <drew.adams@oracle.com>
Cc: Help GNU Emacs <help-gnu-emacs@gnu.org>
Subject: Re: Jumping from one position to other position
Date: Sun, 6 Dec 2020 08:24:20 +0300	[thread overview]
Message-ID: <X8xrBKPtRIouosOk@protected.rcdrun.com> (raw)
In-Reply-To: <2f54a399-a632-4000-97f4-d0775165de9b@default>

* Drew Adams <drew.adams@oracle.com> [2020-12-06 00:30]:
> > All the time I have to jump from one function to other function. What
> > I used so far is C-SPC C-SPC to leave mark at the point and deactivate
> > it. Then I can jump to other places and come back with C-u SPC.
> > 
> > What I would like is to keep somehow automatically source position as
> > new mark, when I do C-u SPC at position X that I jump to position Y,
> > and then from Y with C-u SPC again back to X.
> > 
> > But Emacs does not work this way.
> > 
> > If anybody have better way of jumping from one place A to place B and
> > returning again to place A, and again to place B, let me know.
> 
> (`C-SPC') `C-x C-x'  Repeat to move back.
> `C-g' do deactivate region.

Thank you for references.

In some programming cases M-, and M-. can bring me to referenced or
referencing functions. It helps but is not same.

I think maybe to maybe function for a key to remember the current
marker and jump to last marker, then again same key to remember that
other marker and jump to last remembered.

It should be one key like s-m or similar, definitely not two or
combinations of too many keys. F5 would serve me better than current:
C-SPC C-SPC followed by C-u SPC that is not really doing what I mean
but is helpfull.

> There are also libraries that give you ways to
> browse among the marks, including by choosing
> the text surrounding them using completion.

Small stuff is better kept in one's own configuration then relying on
libraries. Then on each Emacs installation I would need to either
remember which is external library or make sure it is installed PLUS
using my own configuration. It is double action which I always try to
prevent.

(info "(emacs) Mark Ring") says:

,----
|    To return to a marked position, use ‘set-mark-command’ with a prefix
| argument: ‘C-u C-<SPC>’.  This moves point to where the mark was, and
| deactivates the mark if it was active.  Each subsequent ‘C-u C-<SPC>’
| jumps to a prior position stored in the mark ring.  The positions you
| move through in this way are not lost; they go to the end of the ring.
`----

Just that I am not satisfied with it. It does not bring me back how I
mean. I am using this for years.

But maybe this can help:

,----
|    The variable ‘mark-ring-max’ specifies the maximum number of entries
| to keep in the mark ring.  This defaults to 16 entries.  If that many
| entries exist and another one is pushed, the earliest one in the list is
| discarded.  Repeating ‘C-u C-<SPC>’ cycles through the positions
| currently in the ring.
`----

Because if I specify `mark-ring-max' to be 2 then maybe this is what I
need. So I will test this feature while programming. Majority of times
I jump back I do not want to jump to previous 3rd or 4th position but
just to previous position and back.

Useful logical jumping would be for me:

1 2 3 4 5 6 7 8 7 8 7 8 7 8
                ~~~~~~~~~~~
		this is where mode of jumping changes

then one could maybe decide to go back to mode to reach again 1-6
positions.




  reply	other threads:[~2020-12-06  5:24 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <<courier.000000005FCBD00B.00007ECE@static.rcdrun.com>
2020-12-05 21:29 ` Jumping from one position to other position Drew Adams
2020-12-06  5:24   ` Jean Louis [this message]
2020-12-06 23:25     ` Michael Heerdegen
2020-12-05 18:23 Jean Louis
2020-12-05 22:11 ` Michael Heerdegen
2020-12-05 22:21   ` arthur miller
2020-12-05 22:54     ` Drew Adams
2020-12-06  0:55       ` arthur miller
2020-12-06  2:06         ` Drew Adams
2020-12-07  6:50     ` Jean Louis
2020-12-07 19:41       ` Arthur Miller
2020-12-07 20:26         ` Jean Louis
2020-12-05 23:38   ` Eric Abrahamsen
2020-12-06  0:12     ` Michael Heerdegen
2020-12-06  3:42       ` Eric Abrahamsen
2020-12-06 11:51         ` Stefan Möding
2020-12-06 18:15           ` Eric Abrahamsen
2020-12-06 23:07             ` Michael Heerdegen
2020-12-06 23:06         ` Michael Heerdegen
2020-12-06  5:41   ` Jean Louis
2020-12-06 23:11     ` Michael Heerdegen
2020-12-06  9:13   ` Marcin Borkowski
2020-12-06  2:12 ` Dmitry Gutov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=X8xrBKPtRIouosOk@protected.rcdrun.com \
    --to=bugs@gnu.support \
    --cc=drew.adams@oracle.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).