help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: can I move back to the last edit position?


From: Mathias Dahl
Subject: Re: can I move back to the last edit position?
Date: 13 Sep 2004 10:55:44 +0200
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3

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 via email to

[Prev in Thread] Current Thread [Next in Thread]