Mercurial > emacs
changeset 36697:7526acd3385c
(buffer_posn_from_coords): Add parameters OBJECT and
POS; return void.
author | Gerd Moellmann <gerd@gnu.org> |
---|---|
date | Fri, 09 Mar 2001 14:50:33 +0000 |
parents | ba2a7a0cfb84 |
children | e976eee4983f |
files | src/dispnew.c |
diffstat | 1 files changed, 12 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/src/dispnew.c Fri Mar 09 14:50:05 2001 +0000 +++ b/src/dispnew.c Fri Mar 09 14:50:33 2001 +0000 @@ -5685,14 +5685,17 @@ X/Y Position -> Buffer Position ***********************************************************************/ -/* Return the character position of the character at window relative - pixel position (*X, *Y). *X and *Y are adjusted to character - boundaries. */ - -int -buffer_posn_from_coords (w, x, y) +/* Determine what's under window-relative pixel position (*X, *Y). + Return in *OBJECT the object (string or buffer) that's there. + Return in *POS the position in that object. Adjust *X and *Y + to character boundaries. */ + +void +buffer_posn_from_coords (w, x, y, object, pos) struct window *w; int *x, *y; + Lisp_Object *object; + struct display_pos *pos; { struct it it; struct buffer *old_current_buffer = current_buffer; @@ -5712,7 +5715,9 @@ *x = it.current_x - it.first_visible_x + left_area_width; *y = it.current_y; current_buffer = old_current_buffer; - return IT_CHARPOS (it); + + *object = STRINGP (it.string) ? it.string : w->buffer; + *pos = it.current; }