summaryrefslogtreecommitdiff
path: root/src/keyboard.c
diff options
context:
space:
mode:
authorKim F. Storm <storm@cua.dk>2005-01-14 12:11:15 +0000
committerKim F. Storm <storm@cua.dk>2005-01-14 12:11:15 +0000
commita25f766aa391b708a1e98e8471d767358048cac3 (patch)
treee14e934341fdbe5eafe2dcb9f44719073381d023 /src/keyboard.c
parenta92f67e14e1c4cec0871acb3bb9fbfe8cf235261 (diff)
downloademacs-a25f766aa391b708a1e98e8471d767358048cac3.tar.gz
(Fposn_at_x_y): Add optional arg WHOLE.
Diffstat (limited to 'src/keyboard.c')
-rw-r--r--src/keyboard.c17
1 files changed, 11 insertions, 6 deletions
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;
}