From: Kim F. Storm Date: Fri, 14 Jan 2005 12:11:15 +0000 (+0000) Subject: (Fposn_at_x_y): Add optional arg WHOLE. X-Git-Tag: ttn-vms-21-2-B4~2755 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=a25f766aa391b708a1e98e8471d767358048cac3;p=emacs.git (Fposn_at_x_y): Add optional arg WHOLE. --- diff --git a/src/keyboard.c b/src/keyboard.c index 4a99ee1bc19..fb52c7e9f61 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -6846,7 +6846,7 @@ input_available_signal (signo) #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 @@ The elements of this list correspond to the arguments of 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 @@ The `posn-' functions access elements of such lists. */) 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 @@ The `posn-' functions access elements of such lists. */) 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; }