unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: martin rudalics <rudalics@gmx.at>
To: Eric Abrahamsen <eric@ericabrahamsen.net>, emacs-devel@gnu.org
Subject: Re: Manual suggestions for quit-restore documentation
Date: Sun, 05 Mar 2017 11:09:38 +0100	[thread overview]
Message-ID: <58BBE3E2.7020302@gmx.at> (raw)
In-Reply-To: <87r32cgwz1.fsf@ericabrahamsen.net>

 > If Marcin ends up patching `display-buffer-record-window' to un-set
 > buffer history when appropriate, I think it would also be worth
 > mentioning that function in the docs, as the go-to function for setting
 > the quit-restore parameter.

I'm afraid it won't work as I already noticed earlier: If we just use

    (set-window-prev-buffers window nil)

    (set-window-buffer window buffer)

then with ‘display-buffer-pop-up-window’ the ‘set-window-buffer’ will
record the buffer shown in that window due to ‘split-window’ as the
previous buffer and quitting that window will not delete it but try to
show the buffer put there by ‘split-window’ instead.

So the canonical order to do things is

    (display-buffer-record-window type window buffer)

    (set-window-buffer window buffer)

    (set-window-prev-buffers window nil)

So when you document this, then please mention that if someone wants to
use ‘display-buffer-record-window’ in her code, then in the `window'
case she manually has to clear the list of previous buffers as well
(it's not strictly necessary in the `frame' case but it won't harm
either).

martin




  parent reply	other threads:[~2017-03-05 10:09 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-05  1:32 Manual suggestions for quit-restore documentation Eric Abrahamsen
2017-03-05  2:14 ` Drew Adams
2017-03-05  4:37   ` Eric Abrahamsen
2017-03-05  4:39     ` Eric Abrahamsen
2017-03-05 10:09     ` martin rudalics [this message]
2017-03-05 10:09 ` martin rudalics
2017-03-05 17:24   ` Eric Abrahamsen
2017-03-23 19:49   ` Eric Abrahamsen
2017-03-24  9:03     ` martin rudalics
2017-03-24 15:44       ` Eric Abrahamsen
2017-03-24 18:52         ` martin rudalics
2017-03-24 19:17           ` Eric Abrahamsen
2017-03-25  9:24             ` martin rudalics
2017-03-25 16:57               ` Eric Abrahamsen
2017-03-26  8:39                 ` martin rudalics
2017-03-26 14:49                   ` Eli Zaretskii
2017-03-26 15:33                     ` Eric Abrahamsen
2017-03-26 16:27                       ` Eli Zaretskii
2017-03-26 23:40                         ` Eric Abrahamsen

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=58BBE3E2.7020302@gmx.at \
    --to=rudalics@gmx.at \
    --cc=emacs-devel@gnu.org \
    --cc=eric@ericabrahamsen.net \
    /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).