diff options
| author | Kim F. Storm | 2005-01-14 12:11:15 +0000 |
|---|---|---|
| committer | Kim F. Storm | 2005-01-14 12:11:15 +0000 |
| commit | a25f766aa391b708a1e98e8471d767358048cac3 (patch) | |
| tree | e14e934341fdbe5eafe2dcb9f44719073381d023 /src | |
| parent | a92f67e14e1c4cec0871acb3bb9fbfe8cf235261 (diff) | |
| download | emacs-a25f766aa391b708a1e98e8471d767358048cac3.tar.gz emacs-a25f766aa391b708a1e98e8471d767358048cac3.zip | |
(Fposn_at_x_y): Add optional arg WHOLE.
Diffstat (limited to 'src')
| -rw-r--r-- | src/keyboard.c | 17 |
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) | |||
| 6846 | #else | 6846 | #else |
| 6847 | SIGNAL_THREAD_CHECK (signo); | 6847 | SIGNAL_THREAD_CHECK (signo); |
| 6848 | #endif | 6848 | #endif |
| 6849 | 6849 | ||
| 6850 | if (input_available_clear_time) | 6850 | if (input_available_clear_time) |
| 6851 | EMACS_SET_SECS_USECS (*input_available_clear_time, 0, 0); | 6851 | EMACS_SET_SECS_USECS (*input_available_clear_time, 0, 0); |
| 6852 | 6852 | ||
| @@ -10518,17 +10518,19 @@ The elements of this list correspond to the arguments of | |||
| 10518 | return Flist (sizeof (val) / sizeof (val[0]), val); | 10518 | return Flist (sizeof (val) / sizeof (val[0]), val); |
| 10519 | } | 10519 | } |
| 10520 | 10520 | ||
| 10521 | DEFUN ("posn-at-x-y", Fposn_at_x_y, Sposn_at_x_y, 2, 3, 0, | 10521 | DEFUN ("posn-at-x-y", Fposn_at_x_y, Sposn_at_x_y, 2, 4, 0, |
| 10522 | doc: /* Return position information for pixel coordinates X and Y. | 10522 | doc: /* Return position information for pixel coordinates X and Y. |
| 10523 | By default, X and Y are relative to text area of the selected window. | 10523 | By default, X and Y are relative to text area of the selected window. |
| 10524 | Optional third arg FRAME_OR_WINDOW non-nil specifies frame or window. | 10524 | Optional third arg FRAME_OR_WINDOW non-nil specifies frame or window. |
| 10525 | If optional fourth arg WHOLE is non-nil, X is relative to the left | ||
| 10526 | edge of the window. | ||
| 10525 | 10527 | ||
| 10526 | The return value is similar to a mouse click position: | 10528 | The return value is similar to a mouse click position: |
| 10527 | (WINDOW AREA-OR-POS (X . Y) TIMESTAMP OBJECT POS (COL . ROW) | 10529 | (WINDOW AREA-OR-POS (X . Y) TIMESTAMP OBJECT POS (COL . ROW) |
| 10528 | IMAGE (DX . DY) (WIDTH . HEIGHT)) | 10530 | IMAGE (DX . DY) (WIDTH . HEIGHT)) |
| 10529 | The `posn-' functions access elements of such lists. */) | 10531 | The `posn-' functions access elements of such lists. */) |
| 10530 | (x, y, frame_or_window) | 10532 | (x, y, frame_or_window, whole) |
| 10531 | Lisp_Object x, y, frame_or_window; | 10533 | Lisp_Object x, y, frame_or_window, whole; |
| 10532 | { | 10534 | { |
| 10533 | if (NILP (frame_or_window)) | 10535 | if (NILP (frame_or_window)) |
| 10534 | frame_or_window = selected_window; | 10536 | frame_or_window = selected_window; |
| @@ -10541,7 +10543,10 @@ The `posn-' functions access elements of such lists. */) | |||
| 10541 | 10543 | ||
| 10542 | w = XWINDOW (frame_or_window); | 10544 | w = XWINDOW (frame_or_window); |
| 10543 | XSETINT (x, (WINDOW_TO_FRAME_PIXEL_X (w, XINT (x)) | 10545 | XSETINT (x, (WINDOW_TO_FRAME_PIXEL_X (w, XINT (x)) |
| 10544 | + window_box_left_offset (w, TEXT_AREA))); | 10546 | + (NILP (whole) |
| 10547 | ? window_box_left_offset (w, TEXT_AREA) | ||
| 10548 | : - (WINDOW_LEFT_SCROLL_BAR_COLS (w) | ||
| 10549 | * WINDOW_FRAME_COLUMN_WIDTH (w))))); | ||
| 10545 | XSETINT (y, WINDOW_TO_FRAME_PIXEL_Y (w, XINT (y))); | 10550 | XSETINT (y, WINDOW_TO_FRAME_PIXEL_Y (w, XINT (y))); |
| 10546 | frame_or_window = w->frame; | 10551 | frame_or_window = w->frame; |
| 10547 | } | 10552 | } |
| @@ -10569,7 +10574,7 @@ The `posn-' functions access elements of such lists. */) | |||
| 10569 | 10574 | ||
| 10570 | tem = Fpos_visible_in_window_p (pos, window, Qt); | 10575 | tem = Fpos_visible_in_window_p (pos, window, Qt); |
| 10571 | if (!NILP (tem)) | 10576 | if (!NILP (tem)) |
| 10572 | tem = Fposn_at_x_y (XCAR (tem), XCAR (XCDR (tem)), window); | 10577 | tem = Fposn_at_x_y (XCAR (tem), XCAR (XCDR (tem)), window, Qnil); |
| 10573 | return tem; | 10578 | return tem; |
| 10574 | } | 10579 | } |
| 10575 | 10580 | ||