unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: martin rudalics <rudalics@gmx.at>
To: Eli Zaretskii <eliz@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: Documenting buffer display
Date: Wed, 24 Oct 2018 19:40:02 +0200	[thread overview]
Message-ID: <5BD0AE72.9060503@gmx.at> (raw)
In-Reply-To: <83h8hbs8ms.fsf@gnu.org>

 > Just to clarify what I meant: I did NOT mean display-buffer-alist.  I
 > meant something like this:
 >
 >    find-dired is an interactive compiled function...
 >    [...]
 >    By default, display the buffer in the selected window;
 >    NO-SELECT non-nil (interactively, prefix argument) means display the
 >    buffer in a window other than the selected one instead.

NO-SELECT non-nil implies that the window to show the buffer will
not be selected which is probably not what the user wants here.

 > or
 >
 >    By default, display the buffer in the selected window, but if
 >    the value of `find-dired-no-select' is non-nil,  display the
 >    buffer in a window other than the selected one instead.
 >
 > This is our usual method of letting users tweak some minor aspects of
 > how a command works, and I see no reason why users would instead have
 > to construct action lists to do the same for commands that happen to
 > use display-buffer internally.

Applications have the choice: Prescribe where and how buffers should
be displayed or delegate that task to 'display-buffer'.  'ediff' uses
the former approach through a number of options like, for example,
'ediff-split-window-function'.  'edebug' uses 'edebug-pop-to-buffer'.
Users of the latter call 'pop-to-buffer' or 'display-buffer' directly.
Both approaches are valid.

'switch-to-buffer' belongs to the first group unless the selected
window is dedicated to some other buffer in which case
'switch-to-buffer' leaves the decision to 'pop-to-buffer' and we
already have a hybrid approach.  This is problematic and I always
advocate against the use of 'switch-to-buffer' in code: The
application should decide whether it wants one or the other.

Still, if we want users to tweak only "some minor aspects of how a
command works", the approach you sketch above is completely valid and
I think that Juri's recent proposal to allow the directional choice of
windows goes in the same direction and is even more universal.  We can
use 'display-buffer-overriding-action' for the prefix argument case
and I am all for it.  In either case, such a solution is not too
distinct from Stephen Leake's 'other-frame-window' approach so we
maybe should study that as well.

But once an application directly or indirectly calls 'display-buffer'
the latter's customizations may kick in and invalidate all assumptions
about the window used.  So if your NO-SELECT or Juri's directional
effort fail, 'display-buffer' will inevitably rule the game.

martin



  reply	other threads:[~2018-10-24 17:40 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-20 12:20 Documenting buffer display martin rudalics
2018-10-20 13:21 ` Eli Zaretskii
2018-10-20 18:02   ` martin rudalics
2018-10-21 12:56     ` Eli Zaretskii
2018-10-22  9:06       ` martin rudalics
2018-10-22 13:55         ` Eli Zaretskii
2018-10-22 19:14           ` martin rudalics
2018-10-22 19:27             ` Eli Zaretskii
2018-10-23  8:58               ` martin rudalics
2018-10-23 11:26                 ` Pierre-Yves Luyten
2018-10-23 13:45                   ` martin rudalics
2018-10-23 17:40                   ` Stefan Monnier
2018-10-23 14:04                 ` Drew Adams
2018-10-23 18:18                   ` martin rudalics
2018-10-23 15:18                 ` Eli Zaretskii
2018-10-23 18:23                   ` martin rudalics
2018-10-23 19:07                     ` Eli Zaretskii
2018-10-24  9:44                       ` martin rudalics
2018-10-24 14:48                         ` Eli Zaretskii
2018-10-24 17:40                           ` martin rudalics [this message]
2018-10-24 18:25                             ` Eli Zaretskii
2018-10-25 20:42                             ` Juri Linkov
2018-10-23 15:52                 ` Alan Mackenzie
2018-10-23 18:25                   ` martin rudalics
2018-11-08 19:25                   ` martin rudalics
2018-10-22  1:39   ` Michael Welsh Duggan
2018-10-22  5:54     ` Eli Zaretskii
2018-10-20 15:22 ` Drew Adams
2018-10-20 18:02   ` martin rudalics
2018-10-20 18:24     ` Drew Adams
2018-10-21  8:22       ` martin rudalics
2018-11-04  9:06 ` martin rudalics

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=5BD0AE72.9060503@gmx.at \
    --to=rudalics@gmx.at \
    --cc=eliz@gnu.org \
    --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).