]> git.eshelyaron.com Git - emacs.git/commitdiff
(coordinates_in_window): Inside the window but outside
authorRichard M. Stallman <rms@gnu.org>
Sat, 17 Jul 2004 14:59:02 +0000 (14:59 +0000)
committerRichard M. Stallman <rms@gnu.org>
Sat, 17 Jul 2004 14:59:02 +0000 (14:59 +0000)
its box to the L or R, return ON_VERTICAL_BORDER.
(window_list_1): Rotate the list to start with WINDOW.

src/window.c

index c09eaab85ba709d0e31b628fb37939d15163d8e4..907cc113916d7142ecebf3319bc0d1b3f4f99b12 100644 (file)
@@ -670,7 +670,7 @@ coordinates_in_window (w, x, y)
 
   /* 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 @@ static Lisp_Object
 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 @@ window_list_1 (window, minibuf, all_frames)
     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;
 }