changeset 56456:7f86a9a89685

(coordinates_in_window): Inside the window but outside its box to the L or R, return ON_VERTICAL_BORDER. (window_list_1): Rotate the list to start with WINDOW.
author Richard M. Stallman <rms@gnu.org>
date Sat, 17 Jul 2004 14:59:02 +0000
parents 66c2afb52fc1
children 75852f9fc8d7
files src/window.c
diffstat 1 files changed, 13 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/window.c	Sat Jul 17 14:54:56 2004 +0000
+++ b/src/window.c	Sat Jul 17 14:59:02 2004 +0000
@@ -670,7 +670,7 @@
 
   /* Outside any interesting column?  */
   if (*x < left_x || *x > right_x)
-    return ON_NOTHING;
+    return ON_VERTICAL_BORDER;
 
   lmargin_width = window_box_width (w, LEFT_MARGIN_AREA);
   rmargin_width = window_box_width (w, RIGHT_MARGIN_AREA);
@@ -1799,7 +1799,7 @@
 window_list_1 (window, minibuf, all_frames)
      Lisp_Object window, minibuf, all_frames;
 {
-  Lisp_Object tail, list;
+  Lisp_Object tail, list, rest;
 
   decode_next_window_args (&window, &minibuf, &all_frames);
   list = Qnil;
@@ -1808,7 +1808,17 @@
     if (candidate_window_p (XCAR (tail), window, minibuf, all_frames))
       list = Fcons (XCAR (tail), list);
 
-  return Fnreverse (list);
+  /* Rotate the list to start with WINDOW.  */
+  list = Fnreverse (list);
+  rest = Fmemq (window, list);
+  if (!NILP (rest) && !EQ (rest, list))
+    {
+      for (tail = list; XCDR (tail) != rest; tail = XCDR (tail))
+	;
+      XSETCDR (tail, Qnil);
+      list = nconc2 (rest, list);
+    }
+  return list;
 }