all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* "Staying in the same place"
@ 2016-04-04  5:40 Lars Magne Ingebrigtsen
  2016-04-04  6:09 ` Lars Magne Ingebrigtsen
  2016-04-04 12:51 ` Stefan Monnier
  0 siblings, 2 replies; 13+ messages in thread
From: Lars Magne Ingebrigtsen @ 2016-04-04  5:40 UTC (permalink / raw)
  To: emacs-devel

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?
Something.

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
warnings.)

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





^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2016-04-05  0:36 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-04  5:40 "Staying in the same place" Lars Magne Ingebrigtsen
2016-04-04  6:09 ` Lars Magne Ingebrigtsen
2016-04-04  7:28   ` Daniel McClanahan
2016-04-04 12:51 ` Stefan Monnier
2016-04-04 18:19   ` Lars Magne Ingebrigtsen
2016-04-04 18:36     ` Stefan Monnier
2016-04-04 18:42       ` Lars Magne Ingebrigtsen
2016-04-04 19:25         ` Karl Fogel
2016-04-04 19:43           ` Lars Magne Ingebrigtsen
2016-04-04 19:49             ` Karl Fogel
2016-04-04 19:52               ` Lars Magne Ingebrigtsen
2016-04-04 23:21                 ` John Wiegley
2016-04-05  0:36                   ` Drew Adams

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.