unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* same-window-buffer-names and -regexps
@ 2002-08-20  2:43 Luc Teirlinck
  2002-08-20  2:52 ` Miles Bader
  2002-08-20 16:24 ` Stefan Monnier
  0 siblings, 2 replies; 7+ messages in thread
From: Luc Teirlinck @ 2002-08-20  2:43 UTC (permalink / raw)


There seems to be an obvious anomaly in the behavior of the
display-buffer - same-window-buffer-names (-regexps) mechanism.  It
works fine for commands such as M-x shell and the like, but what sense
does it make for C-x 4 C-o to behave specially for the buffers in
question?  For these buffers, C-x 4 C-o behaves like C-x b.  If that
were the behavior the user wanted, (s)he would clearly use the easier
and more logical command C-x b.  Same thing for the command C-o in the
buffer menu, which for these buffers is identical to f.  The effect on
C-c C-f in ielm is even worse.  I guess there must be several other
additional situations like this.  This behavior is both inconvenient
and extremely confusing.  Somebody who does not know about these two
variables does not stand the slightest chance of figuring out the
cause of all this strange behavior.

Setting the two variables to nil is no solution, because then M-x
shell and friends malfunction.

One solution would be to have M-x shell and friends check these
variables (instead of having display-buffer do that directly) and
then have these functions pass an appropriate flag to display-buffer.

Sincerely,

Luc.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: same-window-buffer-names and -regexps
  2002-08-20  2:43 same-window-buffer-names and -regexps Luc Teirlinck
@ 2002-08-20  2:52 ` Miles Bader
  2002-08-20  3:16   ` Luc Teirlinck
  2002-08-20 16:24 ` Stefan Monnier
  1 sibling, 1 reply; 7+ messages in thread
From: Miles Bader @ 2002-08-20  2:52 UTC (permalink / raw)
  Cc: emacs-devel

Luc Teirlinck <teirllm@dms.auburn.edu> writes:
> Setting the two variables to nil is no solution, because then M-x
> shell and friends malfunction.
> 
> One solution would be to have M-x shell and friends check these
> variables (instead of having display-buffer do that directly) and
> then have these functions pass an appropriate flag to display-buffer.

That would be a silly solution.

I think the right thing to do is to have `C-x 4 C-o' invoke a command
that binds those variables to nil and calls display-buffer (instead of
invoking display-buffer directly, as it does now).

-Miles
-- 
Come now, if we were really planning to harm you, would we be waiting here, 
 beside the path, in the very darkest part of the forest?

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: same-window-buffer-names and -regexps
  2002-08-20  2:52 ` Miles Bader
@ 2002-08-20  3:16   ` Luc Teirlinck
  2002-08-20  3:25     ` Miles Bader
  0 siblings, 1 reply; 7+ messages in thread
From: Luc Teirlinck @ 2002-08-20  3:16 UTC (permalink / raw)
  Cc: emacs-devel

Miles Bader wrote:

   That would be a silly solution.

   I think the right thing to do is to have `C-x 4 C-o' invoke a command
   that binds those variables to nil and calls display-buffer (instead of
   invoking display-buffer directly, as it does now).

OK, I probably did not think things over carefully enough.  C-o in the
buffer menu should also be bound to that new command however.  Also,
ielm-display-working-buffer should bind these two variables to nil
around its call to display-buffer.  The same might be true for
dired-display-file, even though most of these buffers are usually not
visiting files.  I bet there are probably other situations like this,
but these are the ones I can think of right now.

Sincerely,

Luc.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: same-window-buffer-names and -regexps
  2002-08-20  3:16   ` Luc Teirlinck
@ 2002-08-20  3:25     ` Miles Bader
  2002-08-20  4:09       ` Luc Teirlinck
  2002-08-21  0:12       ` Richard Stallman
  0 siblings, 2 replies; 7+ messages in thread
From: Miles Bader @ 2002-08-20  3:25 UTC (permalink / raw)
  Cc: emacs-devel

Luc Teirlinck <teirllm@dms.auburn.edu> writes:
> OK, I probably did not think things over carefully enough.  C-o in the
> buffer menu should also be bound to that new command however.  Also,
> ielm-display-working-buffer should bind these two variables to nil
> around its call to display-buffer.  The same might be true for
> dired-display-file, even though most of these buffers are usually not
> visiting files.  I bet there are probably other situations like this,
> but these are the ones I can think of right now.

Perhaps the 2nd argument to display-buffer (`NOT-THIS-WINDOW'), should
cause it to ignore those variables; it seems like a natural extension to
me, and it would mean that callers don't have to know about all the
various special variables in order to get this behavior.

-Miles
-- 
80% of success is just showing up.  --Woody Allen

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: same-window-buffer-names and -regexps
  2002-08-20  3:25     ` Miles Bader
@ 2002-08-20  4:09       ` Luc Teirlinck
  2002-08-21  0:12       ` Richard Stallman
  1 sibling, 0 replies; 7+ messages in thread
From: Luc Teirlinck @ 2002-08-20  4:09 UTC (permalink / raw)
  Cc: emacs-devel

Miles Bader wrote:

   Perhaps the 2nd argument to display-buffer (`NOT-THIS-WINDOW'), should
   cause it to ignore those variables; it seems like a natural extension to
   me, and it would mean that callers don't have to know about all the
   various special variables in order to get this behavior.

Maybe.  I do not know whether we have a complete list of all affected
callers yet and whether all these callers actually want to set
`NOT-THIS-WINDOW' non-nil.  If we bind C-x 4 C-o and C-o in
buffer-menu to a new command, then callers like
ielm-display-working-buffer can call that new command instead of
display-buffer, so that they also do not have to worry about binding
all these variables directly themselves.  I believe that the overhead
of the one extra function call should be be immaterial.

Sincerely,

Luc.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: same-window-buffer-names and -regexps
  2002-08-20  2:43 same-window-buffer-names and -regexps Luc Teirlinck
  2002-08-20  2:52 ` Miles Bader
@ 2002-08-20 16:24 ` Stefan Monnier
  1 sibling, 0 replies; 7+ messages in thread
From: Stefan Monnier @ 2002-08-20 16:24 UTC (permalink / raw)
  Cc: emacs-devel

> One solution would be to have M-x shell and friends check these
> variables (instead of having display-buffer do that directly) and
> then have these functions pass an appropriate flag to display-buffer.

I like this solution.
When I display-buffer *shell* I generally don't want it to be in the
same window.  The only exception is when I do M-x shell.
The problem with temporarily binding same-window-buffer-names to nil
is that it needs to be done for many different cases (basically
all the cases that do something similar to "select the specified
buffer" and there are many, including in many separate packages
providing some buffe-switching or buffer-listing replacement).


	Stefan

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: same-window-buffer-names and -regexps
  2002-08-20  3:25     ` Miles Bader
  2002-08-20  4:09       ` Luc Teirlinck
@ 2002-08-21  0:12       ` Richard Stallman
  1 sibling, 0 replies; 7+ messages in thread
From: Richard Stallman @ 2002-08-21  0:12 UTC (permalink / raw)
  Cc: teirllm, emacs-devel

    Perhaps the 2nd argument to display-buffer (`NOT-THIS-WINDOW'), should
    cause it to ignore those variables; it seems like a natural extension to
    me, and it would mean that callers don't have to know about all the
    various special variables in order to get this behavior.

That seems clean to me, since it will make most of these commands
work right with no further ado.

If after that a few commands still have problems, we can fix those
few next.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2002-08-21  0:12 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-08-20  2:43 same-window-buffer-names and -regexps Luc Teirlinck
2002-08-20  2:52 ` Miles Bader
2002-08-20  3:16   ` Luc Teirlinck
2002-08-20  3:25     ` Miles Bader
2002-08-20  4:09       ` Luc Teirlinck
2002-08-21  0:12       ` Richard Stallman
2002-08-20 16:24 ` Stefan Monnier

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