summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2014-10-09 09:50:10 -0400
committerStefan Monnier <monnier@iro.umontreal.ca>2014-10-09 09:50:10 -0400
commitd7a6097b57197da07cad511b99824fdcc95e14bf (patch)
treee7d6218363b382269fe8765f1edaff8f8338409c
parent942a57a2a5c56575a15dd22e1feebd1825f281b0 (diff)
downloademacs-d7a6097b57197da07cad511b99824fdcc95e14bf.tar.gz
* src/frame.c (Fmouse_pixel_position): Call Vmouse_position_function.
Fixes: debbugs:18638
-rw-r--r--src/ChangeLog5
-rw-r--r--src/frame.c13
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 <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
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;