[Top][All Lists]

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

Re: "Staying in the same place"

From: Stefan Monnier
Subject: Re: "Staying in the same place"
Date: Mon, 04 Apr 2016 08:51:47 -0400
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.

I think it'd good to think of such solutions in the context of bookmarks
as well.

IOW, I think ideally, there should be a special-mode-revert-buffer
function (which special-mode sets as the default value of
revert-buffer-function), which basically just does a "get bookmark data,
then go back to that bookmark".

I don't think it can be done with the current bookmark data, tho.
IIRC there were 2 main reasons:
- You need to be able to distinguish the case "go back to bookmark in
  a new buffer" and "go back to bookmark in the current buffer".
- You probably want to distinguish between the case where you want to
  revert/refresh, and the case where it's OK to just jump to some
  spot in some existing buffer.

Last time I looked at it, I also figured that it'd be nice if the
help-xref-* could use the same infrastructure.

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

Bookmarks do that part acceptably, I think.

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

Oohh.. that's yet another step up in complexity since in that case you
can't "go back" right away, you first have to wait for the process to
send enough data.
But yes, that would be great (I'd particularly appreciate it in


reply via email to

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