unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Mathias Dahl <brakjoller@hotmail.com>
Subject: Re: can I move back to the last edit position?
Date: 13 Sep 2004 10:55:44 +0200	[thread overview]
Message-ID: <u3c1mim3z.fsf@hotmail.com> (raw)
In-Reply-To: u3c1pejtk.fsf@ID-87814.user.uni-berlin.de

Oliver Scholz <alkibiades@gmx.de> writes:

> > Micha Feigin <michf@post.tau.ac.il> wrote on Fri, 10 Sep 2004 15:53:43 +0300:
> >> On Fri, Sep 10, 2004 at 04:49:03PM +0800, Rokia wrote:
> >
> >>> I think this [moving back to the position of the last edit] is a necessary
> >>> and basic function. why cant I find it?
> >
> > I tend to agree, but I've managed to get along without it for some years.
> > You can't find it because it doesn't exist in Emacs.
> [...]
> 
> I think Eli was right to ask for more details here.  For instance,
> Emacs does store the current position of point to the global mark ring
> in some circumstances.  So you can jump back to the position of point
> before you issued the command that moved it by hitting `C-u C-SPC' --
> depending on the command.  That doesn't work for C-n, C-p etc. (I
> hardly see how that would be useful), but it does work for M-<,
> M-C-a, C-s ...

For a newcomer in Emacs, it is very easy to press the
"wrong" keystrokes and end up in some place in a buffer you
did not intend to go to, I have been there myself but do not
have this problem much nowadays.

Anyway, in the book "Writing GNU Emacs Extensions" is a interesting
idea to solve the
I-navigated-ten-lightyears-by-mistake-and-don't-know-how-to-get-back
problem by using advices on all, or most, functions that move point.

If two or more functions adviced as a "move-point-function" was hit in
a row, we would store the position all the time, so that, when you
panic because you jumped somewhere you did not intend to, you could
call the "take-me-back-please" function.

The concept is fairly easy, the "only" way we need to do is to define
which these functions are. I think I have some code some place
regarding this. If I found it I will post it here.

/Mathias

  reply	other threads:[~2004-09-13  8:55 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-10  7:16 can I move back to the last edit position? Rokia
2004-09-10  7:38 ` Miguel Frasson
2004-09-10  8:46   ` Rokia
2004-09-10  9:07     ` Eli Zaretskii
2004-09-10  7:46 ` Mathias Dahl
2004-09-10  8:29 ` Pascal Bourguignon
2004-09-10  8:49   ` Rokia
2004-09-10 12:53     ` Micha Feigin
     [not found]     ` <mailman.2285.1094821218.1998.help-gnu-emacs@gnu.org>
2004-09-10 17:43       ` Alan Mackenzie
2004-09-11  0:19         ` Miles Bader
2004-09-11  0:21         ` Oliver Scholz
2004-09-13  8:55           ` Mathias Dahl [this message]
2004-10-05  5:12       ` David Combs
2004-09-10 11:49 ` zrr
2004-09-10 13:16 ` Peter Boettcher
2004-09-11  0:20   ` Bob Babcock
2004-09-11 20:05     ` Harry Putnam
2004-09-11 20:09       ` Harry Putnam
     [not found]       ` <mailman.2411.1094934412.1998.help-gnu-emacs@gnu.org>
2005-03-16  2:03         ` david.andersson
     [not found]     ` <mailman.2409.1094933538.1998.help-gnu-emacs@gnu.org>
2004-09-12  5:06       ` rokia
2004-09-12 15:28         ` Peter J. Acklam
2004-09-12 16:45           ` Rokia
2004-09-13 16:13           ` Stefan Monnier
2004-09-12 21:46         ` Bob Babcock
2004-09-11  3:58   ` rokia

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=u3c1mim3z.fsf@hotmail.com \
    --to=brakjoller@hotmail.com \
    /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).