unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: emacs-devel@gnu.org
Subject: Re: "Staying in the same place"
Date: Mon, 04 Apr 2016 08:51:47 -0400	[thread overview]
Message-ID: <jwv7fgd1r7w.fsf-monnier+gmane.emacs.devel@gnu.org> (raw)
In-Reply-To: m3oa9q53uq.fsf@gnus.org

> 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
*vc-diff*).


        Stefan




  parent reply	other threads:[~2016-04-04 12:51 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

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=jwv7fgd1r7w.fsf-monnier+gmane.emacs.devel@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@gnu.org \
    /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.
Code repositories for project(s) associated with this public inbox

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

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