]> git.eshelyaron.com Git - emacs.git/commitdiff
Define with-new-thread macro.
authorTom Tromey <tromey@redhat.com>
Sat, 19 Sep 2009 22:02:05 +0000 (00:02 +0200)
committerGiuseppe Scrivano <gscrivano@gnu.org>
Sat, 19 Sep 2009 22:02:05 +0000 (00:02 +0200)
lisp/subr.el

index be06a558e5a4d6c2cff742570b339e7a00ff21c9..1c24149e7e00d4036f261fdff1e2c73d512988e3 100644 (file)
@@ -2889,6 +2889,10 @@ The value returned is the value of the last form in BODY."
                  ,@body)
         (with-current-buffer ,old-buffer
           (set-case-table ,old-case-table))))))
+
+(defmacro with-new-thread (&rest body)
+  "Execute the forms in BODY in a new thread."
+  `(run-in-thread (lambda () ,@body)))
 \f
 ;;; Matching and match data.