unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "João Távora" <joaotavora@gmail.com>
Cc: help-gnu-emacs@gnu.org, Stefan Monnier <monnier@iro.umontreal.ca>,
	emacs-devel@gnu.org
Subject: frames dedicated to buffers, or, always see specific buffers in a specific frame
Date: Sun, 14 Apr 2013 19:42:23 +0100	[thread overview]
Message-ID: <CALDnm53SfPkTDaHyj+PGznC15Meth4=cf6NngYhP8K+sX-e5+Q@mail.gmail.com> (raw)
In-Reply-To: <CALDnm50Q=eNA6rgUS-DQD2RLuE=kyizGpYWyENVU=2Py+-MTig@mail.gmail.com>

>> yes, you understand correctly.
>
> So for making this general purpose you should use `pop-to-buffer'
> instead of `display-buffer'.

Yes, that works too. Why exactly is this more general purpose?

>> control how `display-buffer' but not
>
> ... only, I presume ...

Sorry I mean "a lot of control over how it gets called, but not when
it gets called"

>> when it is called. The advice is because I
>> want ibuffer and ido to work with this as well.
>
> These should refrain from using `switch-to-buffer(-...)' and use
> `pop-to-buffer' with the `display-buffer-same-window' directive instead.
> Wherever this bothers you, file a bug report so it gets fixed.

it didn't bother me until now, let's see if I use this frequently...

 Also, ido has these `ido-default-buffer-method' and
`ido-default-file-method' that can be set to various options to
control how buffer appears.

But the way these options implemented does not bring them all to
`display-buffer', which sometimes precludes user's control. Should't
they be implemented via `display-buffer-alist', keeping any of the
user's entries on top?

> [...]  Couldn't you use some more human predicate for this purpose?

Yes, I could of course, but was too lazy. I could use any
buffer-checking predicate. There could be some kind of var
`joaot/browse-buffer-predicates' tried in order by
`joaot/browse-buffer-p'.

>
> This was the intention of `display-buffer-alist' and IIRC at some time I
> had already removed all calls of `switch-to-buffer' from the Emacs code
> base.  Somehow this got reverted later.

Pity. But what about making `switch-to-buffer' delegate to
`display-buffer' too? It could dinamically bind `display-buffer-alist'
to display and select the buffer, but keeping any existing entries
(probably set by the user, or other programs) on top.

If that resulted in `switch-to-buffer' not switching to the buffer's
window, it could not be considered unexpected behaviour, since
ultimately the user set `display-buffer-alist' himself.

> `switch-to-buffer' is the traditional means to interactively show a
> buffer in the selected window.  It shouldn't be used in Lisp code.

Yes I see. But see above for a (possibly naive) fix.

> This doesn't sound right.  When `display-buffer' has found a window it
> should stop right there.  Anything else would constitute a bug.  If you
> can reproduce it, step through it with the debugger to find out what
> goes wrong.

My fault, sorry. The function displaying the buffer must return a
window object, anything else results in funny behaviour.

Anyway, it's working nicely now, thanks for the help.

--
João Távora



  parent reply	other threads:[~2013-04-14 18:42 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <5167D3B7.2080408@gmx.at>
2013-04-12 12:12 ` frames dedicated to buffers, or, always see specific buffers in a specific frame João Távora
2013-04-12 13:13   ` João Távora
2013-04-12 14:15   ` martin rudalics
     [not found]     ` <CALDnm50Q=eNA6rgUS-DQD2RLuE=kyizGpYWyENVU=2Py+-MTig@mail.gmail.com>
2013-04-14 18:42       ` João Távora [this message]
2013-04-15  7:11         ` martin rudalics
2013-04-12 16:45   ` Stefan Monnier
2013-04-13  8:01     ` martin rudalics
2013-04-14 18:18     ` João Távora

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='CALDnm53SfPkTDaHyj+PGznC15Meth4=cf6NngYhP8K+sX-e5+Q@mail.gmail.com' \
    --to=joaotavora@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=help-gnu-emacs@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /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).