all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* multiple displays and ttys
@ 2007-09-21  8:08 Stefan Monnier
  2007-09-21 22:34 ` Richard Stallman
  0 siblings, 1 reply; 4+ messages in thread
From: Stefan Monnier @ 2007-09-21  8:08 UTC (permalink / raw)
  To: emacs-devel


Now that I'm using emacsclient even more, I more often bump into situations
where Emacs displays a buffer in some display that I cannot see.

I suggest the patch below which makes that only the frames on
the `current terminal' are considered as visible.

This way, when you're working on /dev/pts/2, all the frames on ":0.0" are
considered as invisible, and similarly between different X displays.

I find this invaluable.  Any objection?


        Stefan


diff -u -b /home/monnier/src/emacs/trunk/src/window.c /home/monnier/src/emacs/work/src/window.c
--- /home/monnier/src/emacs/trunk/src/window.c	2007-09-21 03:55:52.000000000 -0400
+++ /home/monnier/src/emacs/work/src/window.c	2007-09-21 04:03:11.000000000 -0400
@@ -1794,7 +1798,8 @@
   else if (EQ (all_frames, Qvisible))
     {
       FRAME_SAMPLE_VISIBILITY (f);
-      candidate_p = FRAME_VISIBLE_P (f);
+      candidate_p = FRAME_VISIBLE_P (f)
+	&& (FRAME_TERMINAL (f) == FRAME_TERMINAL (XFRAME (selected_frame)));
     }
   else if (INTEGERP (all_frames) && XINT (all_frames) == 0)
     {
@@ -1810,7 +1815,8 @@
 		     || (FRAME_X_P (f) && f->output_data.x->asked_for_visible
 			 && !f->output_data.x->has_been_visible)
 #endif
-		     );
+		     )
+	&& (FRAME_TERMINAL (f) == FRAME_TERMINAL (XFRAME (selected_frame)));
     }
   else if (WINDOWP (all_frames))
     candidate_p = (EQ (FRAME_MINIBUF_WINDOW (f), all_frames)

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

* Re: multiple displays and ttys
  2007-09-21  8:08 multiple displays and ttys Stefan Monnier
@ 2007-09-21 22:34 ` Richard Stallman
  2007-09-22 19:38   ` Stefan Monnier
  0 siblings, 1 reply; 4+ messages in thread
From: Richard Stallman @ 2007-09-21 22:34 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

    I suggest the patch below which makes that only the frames on
    the `current terminal' are considered as visible.

It seems logical, for most purposes.  But I think it would be a good
idea to check the calls to the principal primitives that loop over
windows, to see which calls specify visible windows only, and check if
this is right for all of them.  It is probably right for most of them;
what I am not sure of is whether it is right for all of them.

We might want to make the arguments which traditionally mean "visible
frames" now mean "visible on this terminal", and create some other way
to say "visible on any terminal" -- if the latter is really needed.
But if it isn't needed, we are better off keeping things simple
and not creating it.

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

* Re: multiple displays and ttys
  2007-09-21 22:34 ` Richard Stallman
@ 2007-09-22 19:38   ` Stefan Monnier
  2007-09-23 15:05     ` Richard Stallman
  0 siblings, 1 reply; 4+ messages in thread
From: Stefan Monnier @ 2007-09-22 19:38 UTC (permalink / raw)
  To: rms; +Cc: emacs-devel

>     I suggest the patch below which makes that only the frames on
>     the `current terminal' are considered as visible.

> It seems logical, for most purposes.  But I think it would be a good
> idea to check the calls to the principal primitives that loop over
> windows, to see which calls specify visible windows only, and check if
> this is right for all of them.  It is probably right for most of them;
> what I am not sure of is whether it is right for all of them.

> We might want to make the arguments which traditionally mean "visible
> frames" now mean "visible on this terminal", and create some other way
> to say "visible on any terminal" -- if the latter is really needed.
> But if it isn't needed, we are better off keeping things simple
> and not creating it.

It's very difficult to check each and every use of this since it's called
from several different functions, so I cannot claim that I've done an
exhaustive search.  But I've been using this change for a several years and
grepped several times during this interval to try and find relevant pieces
of code, mostly because they all tend to either forget about multiple-frames
situations (and pass an implicit nil argument to only consider the selected
frame) or use the t argument thinking "if nil is not good enough, then
t ought to do it".

I have never encountered any use that needed to know about "visible, even on
other screens", so I think we can install the change as is, and in case we
ever come across the need for the old meaning of `visible' (and 0), we can
add it at that point.


        Stefan

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

* Re: multiple displays and ttys
  2007-09-22 19:38   ` Stefan Monnier
@ 2007-09-23 15:05     ` Richard Stallman
  0 siblings, 0 replies; 4+ messages in thread
From: Richard Stallman @ 2007-09-23 15:05 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

      But I've been using this change for a several years and
    grepped several times during this interval to try and find relevant pieces
    of code,

Given that evidence, I am convinced.

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

end of thread, other threads:[~2007-09-23 15:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-21  8:08 multiple displays and ttys Stefan Monnier
2007-09-21 22:34 ` Richard Stallman
2007-09-22 19:38   ` Stefan Monnier
2007-09-23 15:05     ` Richard Stallman

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.