summaryrefslogtreecommitdiff
path: root/lisp/subr.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2014-09-27 11:52:28 -0400
committerStefan Monnier <monnier@iro.umontreal.ca>2014-09-27 11:52:28 -0400
commit19e0f0af6d27179baf76b5ebc67588dfc4b70588 (patch)
tree2802d5e2159f7de79f1bb79394933a4712141e1e /lisp/subr.el
parent548e1696229e56053f5eb74b3f6d1c50041b0375 (diff)
downloademacs-19e0f0af6d27179baf76b5ebc67588dfc4b70588.tar.gz
* lisp/subr.el (track-mouse): New macro.
* lisp/emacs-lisp/cconv.el (cconv-convert, cconv-analyse-form): Remove track-mouse case. * lisp/emacs-lisp/bytecomp.el (byte-compile-track-mouse): Remove. * src/keyboard.c (track-mouse): Rename to internal--track-mouse. Make it into a function and change arg to be a function.
Diffstat (limited to 'lisp/subr.el')
-rw-r--r--lisp/subr.el8
1 files changed, 8 insertions, 0 deletions
diff --git a/lisp/subr.el b/lisp/subr.el
index 56b46b4fbf1..2bbc01d4533 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -2945,6 +2945,14 @@ Similar to `call-process-shell-command', but calls `process-file'."
;;;; Lisp macros to do various things temporarily.
+(defmacro track-mouse (&rest body)
+ "Evaluate BODY with mouse movement events enabled.
+Within a `track-mouse' form, mouse motion generates input events that
+ you can read with `read-event'.
+Normally, mouse motion is ignored."
+ (declare (debug t) (indent 0))
+ `(internal--track-mouse (lambda () ,@body)))
+
(defmacro with-current-buffer (buffer-or-name &rest body)
"Execute the forms in BODY with BUFFER-OR-NAME temporarily current.
BUFFER-OR-NAME must be a buffer or the name of an existing buffer.