changeset 59543:66df67e643ac

(Fposn_at_x_y): Add optional arg WHOLE.
author Kim F. Storm <storm@cua.dk>
date Fri, 14 Jan 2005 12:11:15 +0000
parents fdada1e7ef51
children eeb8c7b63e5b
files src/keyboard.c
diffstat 1 files changed, 11 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/keyboard.c	Fri Jan 14 10:50:53 2005 +0000
+++ b/src/keyboard.c	Fri Jan 14 12:11:15 2005 +0000
@@ -6846,7 +6846,7 @@
 #else
   SIGNAL_THREAD_CHECK (signo);
 #endif
-  
+
   if (input_available_clear_time)
     EMACS_SET_SECS_USECS (*input_available_clear_time, 0, 0);
 
@@ -10518,17 +10518,19 @@
   return Flist (sizeof (val) / sizeof (val[0]), val);
 }
 
-DEFUN ("posn-at-x-y", Fposn_at_x_y, Sposn_at_x_y, 2, 3, 0,
+DEFUN ("posn-at-x-y", Fposn_at_x_y, Sposn_at_x_y, 2, 4, 0,
        doc: /* Return position information for pixel coordinates X and Y.
 By default, X and Y are relative to text area of the selected window.
 Optional third arg FRAME_OR_WINDOW non-nil specifies frame or window.
+If optional fourth arg WHOLE is non-nil, X is relative to the left
+edge of the window.
 
 The return value is similar to a mouse click position:
    (WINDOW AREA-OR-POS (X . Y) TIMESTAMP OBJECT POS (COL . ROW)
     IMAGE (DX . DY) (WIDTH . HEIGHT))
 The `posn-' functions access elements of such lists.  */)
-  (x, y, frame_or_window)
-     Lisp_Object x, y, frame_or_window;
+  (x, y, frame_or_window, whole)
+     Lisp_Object x, y, frame_or_window, whole;
 {
   if (NILP (frame_or_window))
     frame_or_window = selected_window;
@@ -10541,7 +10543,10 @@
 
       w = XWINDOW (frame_or_window);
       XSETINT (x, (WINDOW_TO_FRAME_PIXEL_X (w, XINT (x))
-		   + window_box_left_offset (w, TEXT_AREA)));
+		   + (NILP (whole)
+		      ? window_box_left_offset (w, TEXT_AREA)
+		      : - (WINDOW_LEFT_SCROLL_BAR_COLS (w)
+			   * WINDOW_FRAME_COLUMN_WIDTH (w)))));
       XSETINT (y, WINDOW_TO_FRAME_PIXEL_Y (w, XINT (y)));
       frame_or_window = w->frame;
     }
@@ -10569,7 +10574,7 @@
 
   tem = Fpos_visible_in_window_p (pos, window, Qt);
   if (!NILP (tem))
-    tem = Fposn_at_x_y (XCAR (tem), XCAR (XCDR (tem)), window);
+    tem = Fposn_at_x_y (XCAR (tem), XCAR (XCDR (tem)), window, Qnil);
   return tem;
 }