* src/frame.c (Fmouse_pixel_position): Call Vmouse_position_function.

Fixes: debbugs:18638
This commit is contained in:
Stefan Monnier 2014-10-09 09:50:10 -04:00
parent 942a57a2a5
commit d7a6097b57
2 changed files with 14 additions and 4 deletions

View file

@ -1,3 +1,8 @@
2014-10-09 Stefan Monnier <monnier@iro.umontreal.ca>
* frame.c (Fmouse_pixel_position): Call Vmouse_position_function
(bug#18638).
2014-10-08 K. Handa <handa@gnu.org>
* coding.c (detect_coding_iso_2022): Set coding->rejected

View file

@ -1583,7 +1583,8 @@ and nil for X and Y. */)
{
struct frame *f;
Lisp_Object lispy_dummy;
Lisp_Object x, y;
Lisp_Object x, y, retval;
struct gcpro gcpro1;
f = SELECTED_FRAME ();
x = y = Qnil;
@ -1600,7 +1601,11 @@ and nil for X and Y. */)
}
XSETFRAME (lispy_dummy, f);
return Fcons (lispy_dummy, Fcons (x, y));
retval = Fcons (lispy_dummy, Fcons (x, y));
GCPRO1 (retval);
if (!NILP (Vmouse_position_function))
retval = call1 (Vmouse_position_function, retval);
RETURN_UNGCPRO (retval);
}
DEFUN ("set-mouse-position", Fset_mouse_position, Sset_mouse_position, 3, 3, 0,
@ -4662,8 +4667,8 @@ is visible. In this case you can not overscroll. */);
DEFVAR_LISP ("mouse-position-function", Vmouse_position_function,
doc: /* If non-nil, function to transform normal value of `mouse-position'.
`mouse-position' calls this function, passing its usual return value as
argument, and returns whatever this function returns.
`mouse-position' and `mouse-pixel-position' call this function, passing their
usual return value as argument, and return whatever this function returns.
This abnormal hook exists for the benefit of packages like `xt-mouse.el'
which need to do mouse handling at the Lisp level. */);
Vmouse_position_function = Qnil;