[Top][All Lists]

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

"Staying in the same place"

From: Lars Magne Ingebrigtsen
Subject: "Staying in the same place"
Date: Mon, 04 Apr 2016 07:40:13 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)

There's a lot of modes in Emacs that don't reflect a physical file, but
has only generated content (for some values of "generated").  Many of
these implement a version of "revert", usually bound to the `g' key,
which basically do an `erase-buffer' and then generate the buffer anew.

And then you have to implement some way of "staying in the same place".

Which is a pretty fuzzy, do-what-I-mean kind of thing, because the data
may have changed.  The size of the buffer usually has, and the line you
were on may have disappeared.

I think it would be nice if Emacs had a general function for "try to
stay in the same place", but I don't know whether that's realistic.  For
instance, dired notes both the point and the file name you're at, and
first tries to go to the file in question, or if the file is gone, it...
uhm...  Goes to the point and then goes to the file on that line?

I wonder if anybody has thought about the issue in a more general way --
by providing a mechanism to save (perhaps a lot) of context, and then
trying to go back to the same context again after regenerating the
buffer, in a ... fuzzy way.

(The reason I'm thinking about this is that I was thinking about what
would be necessary to make `g' in compilation buffers remain in "the
same place".  Which is useful when you're trying to weed out compilation

(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no

reply via email to

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