From d7a6097b57197da07cad511b99824fdcc95e14bf Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Thu, 9 Oct 2014 09:50:10 -0400 Subject: [PATCH] * src/frame.c (Fmouse_pixel_position): Call Vmouse_position_function. Fixes: debbugs:18638 --- src/ChangeLog | 5 +++++ src/frame.c | 13 +++++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index c6d78a5e8d1..63e0e728fee 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2014-10-09 Stefan Monnier + + * frame.c (Fmouse_pixel_position): Call Vmouse_position_function + (bug#18638). + 2014-10-08 K. Handa * coding.c (detect_coding_iso_2022): Set coding->rejected diff --git a/src/frame.c b/src/frame.c index 35fd190ba28..e894d218df7 100644 --- a/src/frame.c +++ b/src/frame.c @@ -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; -- 2.39.2