changeset 338:4840aae6a876

*** empty log message ***
author Jim Blandy <jimb@redhat.com>
date Fri, 19 Jul 1991 16:05:34 +0000
parents 165d128bc864
children 1c12a86018cd
files src/termhooks.h src/window.c
diffstat 2 files changed, 36 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/src/termhooks.h	Fri Jul 19 14:42:53 1991 +0000
+++ b/src/termhooks.h	Fri Jul 19 16:05:34 1991 +0000
@@ -63,6 +63,13 @@
    button releases.  */
 extern int (*mouse_tracking_enable_hook) ( /* int ENABLE */ );
 
+/* When reading from a minibuffer in a different screen, Emacs wants
+   to shift the highlight from the selected screen to the minibuffer's
+   screen; under X, this means it lies about where the focus is.
+   This hook tells the window system code to re-decide where to put
+   the highlight.  */
+extern void (*screen_rehighlight_hook) ( /* SCREEN_PTR s */ );
+
 /* If nonzero, send all terminal output characters to this stream also.  */
 
 extern FILE *termscript;
@@ -83,9 +90,13 @@
   enum {
     no_event,			/* nothing happened.  This should never
 				   actually appear in the event queue.  */
-    ascii_keystroke,		/* The ASCII code is in .code.  Note that
-				   this includes meta-keys, and the modifiers
-				   field of the event is unused.  */
+    ascii_keystroke,		/* The ASCII code is in .code.
+				   .screen is the screen in which the key
+				   was typed.
+				   Note that this includes meta-keys, and
+				   the modifiers field of the event
+				   is unused.  */
+
     non_ascii_keystroke,	/* .code is a number identifying the
 				   function key.  A code N represents
 				   a key whose name is
@@ -93,7 +104,9 @@
 				   is a table in keyboard.c to which you
 				   should feel free to add missing keys.
 				   .modifiers holds the state of the
-				   modifier keys.  */
+				   modifier keys.
+				   .screen is the screen in which the key
+				   was typed.  */
     mouse_click,		/* The button number is in .code.
 				   .modifiers holds the state of the
 				   modifier keys.
@@ -118,10 +131,12 @@
 				   should apply to.
 				   .timestamp gives a timestamp (in
 				   milliseconds) for the click.  */
+#if 0
     screen_selected,		/* The user has moved the focus to another
 				   screen.
 				   .screen is the screen that should become
 				   selected at the next convenient time.  */
+#endif
   } kind;
   
   Lisp_Object code;
--- a/src/window.c	Fri Jul 19 14:42:53 1991 +0000
+++ b/src/window.c	Fri Jul 19 16:05:34 1991 +0000
@@ -18,6 +18,7 @@
 along with GNU Emacs; see the file COPYING.  If not, write to
 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
 
+#include <stdio.h>
 
 #include "config.h"
 #include "lisp.h"
@@ -27,6 +28,7 @@
 #include "commands.h"
 #include "indent.h"
 #include "termchar.h"
+#include "termhooks.h"
 #include "disptab.h"
 
 Lisp_Object Qwindowp;
@@ -350,7 +352,6 @@
 
       if (found)
 	{
-	  
 	  *modeline_p = (found == -1);
 	  return tem;
 	}
@@ -458,6 +459,8 @@
     w->force_start = Qt;
   w->update_mode_line = Qt;
   XFASTINT (w->last_modified) = 0;
+  if (!EQ (window, selected_window))
+    windows_or_buffers_changed++;
   return pos;
 }
 
@@ -897,7 +900,7 @@
   return window;
 }
 
-DEFUN ("other-window", Fother_window, Sother_window, 1, 1, "p",
+DEFUN ("other-window", Fother_window, Sother_window, 1, 2, "p",
   "Select the ARG'th different window on this screen.\n\
 All windows on current screen are arranged in a cyclic order.\n\
 This command selects the window ARG steps away in that order.\n\
@@ -1392,13 +1395,24 @@
 
   selected_window = window;
 #ifdef MULTI_SCREEN
-  if (XSCREEN (WINDOW_SCREEN (w)) != selected_screen)
+  /* If we're selecting the minibuffer window of the selected screen,
+     don't change the selected screen, even if the minibuffer is on
+     a different screen.  */
+  if (XSCREEN (WINDOW_SCREEN (w)) != selected_screen
+      && ! EQ (SCREEN_MINIBUF_WINDOW (selected_screen), window))
     {
       XSCREEN (WINDOW_SCREEN (w))->selected_window = window;
       Fselect_screen (WINDOW_SCREEN (w), Qnil);
     }
   else
     selected_screen->selected_window = window;
+
+  /* When using the global minibuffer screen, we want the highlight to
+   go to the minibuffer's screen, and when we finish, we want the highlight
+   to return to the original screen.  Call the hook to put the highlight
+   where it belongs.  */
+  if (screen_rehighlight_hook)
+    (*screen_rehighlight_hook) ();
 #endif
 
   record_buffer (w->buffer);