diff options
| author | Kim F. Storm | 2005-10-13 22:42:01 +0000 |
|---|---|---|
| committer | Kim F. Storm | 2005-10-13 22:42:01 +0000 |
| commit | 6507c4c73dad972eb4f6bc224c8c22de6cbeec97 (patch) | |
| tree | 801585b0350e9c4fae79c4a4479b8da8179b6ae9 /src | |
| parent | 8460eb1eb5129fa1b162cc92098f58bd1ad52841 (diff) | |
| download | emacs-6507c4c73dad972eb4f6bc224c8c22de6cbeec97.tar.gz emacs-6507c4c73dad972eb4f6bc224c8c22de6cbeec97.zip | |
(make_lispy_position): Adjust wx for left margin if ON_TEXT.
(Fposn_at_x_y): Fix calculation of x coordinate.
(Fposn_at_point): Return nil if point is hscrolled out of view.
Diffstat (limited to 'src')
| -rw-r--r-- | src/keyboard.c | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/src/keyboard.c b/src/keyboard.c index 56419ef5679..96bc115412e 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -5054,7 +5054,11 @@ make_lispy_position (f, x, y, time) | |||
| 5054 | XSETINT (*x, wx); | 5054 | XSETINT (*x, wx); |
| 5055 | XSETINT (*y, wy); | 5055 | XSETINT (*y, wy); |
| 5056 | 5056 | ||
| 5057 | if (part == ON_MODE_LINE || part == ON_HEADER_LINE) | 5057 | if (part == ON_TEXT) |
| 5058 | { | ||
| 5059 | wx += WINDOW_LEFT_MARGIN_WIDTH (w); | ||
| 5060 | } | ||
| 5061 | else if (part == ON_MODE_LINE || part == ON_HEADER_LINE) | ||
| 5058 | { | 5062 | { |
| 5059 | /* Mode line or header line. Look for a string under | 5063 | /* Mode line or header line. Look for a string under |
| 5060 | the mouse that may have a `local-map' property. */ | 5064 | the mouse that may have a `local-map' property. */ |
| @@ -10592,11 +10596,11 @@ The `posn-' functions access elements of such lists. */) | |||
| 10592 | CHECK_LIVE_WINDOW (frame_or_window); | 10596 | CHECK_LIVE_WINDOW (frame_or_window); |
| 10593 | 10597 | ||
| 10594 | w = XWINDOW (frame_or_window); | 10598 | w = XWINDOW (frame_or_window); |
| 10595 | XSETINT (x, (WINDOW_TO_FRAME_PIXEL_X (w, XINT (x)) | 10599 | XSETINT (x, (XINT (x) |
| 10600 | + WINDOW_LEFT_EDGE_X (w) | ||
| 10596 | + (NILP (whole) | 10601 | + (NILP (whole) |
| 10597 | ? window_box_left_offset (w, TEXT_AREA) | 10602 | ? window_box_left_offset (w, TEXT_AREA) |
| 10598 | : - (WINDOW_LEFT_SCROLL_BAR_COLS (w) | 10603 | : 0))); |
| 10599 | * WINDOW_FRAME_COLUMN_WIDTH (w))))); | ||
| 10600 | XSETINT (y, WINDOW_TO_FRAME_PIXEL_Y (w, XINT (y))); | 10604 | XSETINT (y, WINDOW_TO_FRAME_PIXEL_Y (w, XINT (y))); |
| 10601 | frame_or_window = w->frame; | 10605 | frame_or_window = w->frame; |
| 10602 | } | 10606 | } |
| @@ -10622,9 +10626,21 @@ The `posn-' functions access elements of such lists. */) | |||
| 10622 | { | 10626 | { |
| 10623 | Lisp_Object tem; | 10627 | Lisp_Object tem; |
| 10624 | 10628 | ||
| 10629 | if (NILP (window)) | ||
| 10630 | window = selected_window; | ||
| 10631 | |||
| 10625 | tem = Fpos_visible_in_window_p (pos, window, Qt); | 10632 | tem = Fpos_visible_in_window_p (pos, window, Qt); |
| 10626 | if (!NILP (tem)) | 10633 | if (!NILP (tem)) |
| 10627 | tem = Fposn_at_x_y (XCAR (tem), XCAR (XCDR (tem)), window, Qnil); | 10634 | { |
| 10635 | Lisp_Object x = XCAR (tem); | ||
| 10636 | Lisp_Object y = XCAR (XCDR (tem)); | ||
| 10637 | |||
| 10638 | /* Point invisible due to hscrolling? */ | ||
| 10639 | if (XINT (x) < 0) | ||
| 10640 | return Qnil; | ||
| 10641 | tem = Fposn_at_x_y (x, y, window, Qnil); | ||
| 10642 | } | ||
| 10643 | |||
| 10628 | return tem; | 10644 | return tem; |
| 10629 | } | 10645 | } |
| 10630 | 10646 | ||