]> git.eshelyaron.com Git - emacs.git/commitdiff
Move with-no-threads inside the let body block.
authorGiuseppe Scrivano <gscrivano@gnu.org>
Tue, 22 Sep 2009 13:13:41 +0000 (15:13 +0200)
committerGiuseppe Scrivano <gscrivano@gnu.org>
Tue, 22 Sep 2009 13:13:41 +0000 (15:13 +0200)
lisp/subr.el

index 80cd13c7da200044b07f7db3c9b22fb040ff74b6..7ad94b31d19170d26640c6866153eabefb93d6ee 100644 (file)
@@ -1815,37 +1815,37 @@ obey the input decoding and translations usually done by `read-key-sequence'.
 So escape sequences and keyboard encoding are taken into account.
 When there's an ambiguity because the key looks like the prefix of
 some sort of escape sequence, the ambiguity is resolved via `read-key-delay'."
-  (with-no-threads
-   (let ((overriding-terminal-local-map read-key-empty-map)
-         (overriding-local-map nil)
-         (old-global-map (current-global-map))
-         (timer (run-with-idle-timer
-                 ;; Wait long enough that Emacs has the time to receive and
-                 ;; process all the raw events associated with the single-key.
-                 ;; But don't wait too long, or the user may find the delay
-                 ;; annoying (or keep hitting more keys which may then get
-                 ;; lost or misinterpreted).
-                 ;; This is only relevant for keys which Emacs perceives as
-                 ;; "prefixes", such as C-x (because of the C-x 8 map in
-                 ;; key-translate-table and the C-x @ map in function-key-map)
-                 ;; or ESC (because of terminal escape sequences in
-                 ;; input-decode-map).
-                 read-key-delay t
-                 (lambda ()
-                   (let ((keys (this-command-keys-vector)))
-                     (unless (zerop (length keys))
-                       ;; `keys' is non-empty, so the user has hit at least
-                       ;; one key; there's no point waiting any longer, even
-                       ;; though read-key-sequence thinks we should wait
-                       ;; for more input to decide how to interpret the
-                       ;; current input.
-                       (throw 'read-key keys)))))))
-     (unwind-protect
-         (progn
-           (use-global-map read-key-empty-map)
-           (aref       (catch 'read-key (read-key-sequence prompt nil t)) 0))
-       (cancel-timer timer)
-       (use-global-map old-global-map)))))
+  (let ((overriding-terminal-local-map read-key-empty-map)
+       (overriding-local-map nil)
+       (old-global-map (current-global-map))
+       (with-no-threads
+        (timer (run-with-idle-timer
+                ;; Wait long enough that Emacs has the time to receive and
+                ;; process all the raw events associated with the single-key.
+                ;; But don't wait too long, or the user may find the delay
+                ;; annoying (or keep hitting more keys which may then get
+                ;; lost or misinterpreted).
+                ;; This is only relevant for keys which Emacs perceives as
+                ;; "prefixes", such as C-x (because of the C-x 8 map in
+                ;; key-translate-table and the C-x @ map in function-key-map)
+                ;; or ESC (because of terminal escape sequences in
+                ;; input-decode-map).
+                read-key-delay t
+                (lambda ()
+                  (let ((keys (this-command-keys-vector)))
+                    (unless (zerop (length keys))
+                      ;; `keys' is non-empty, so the user has hit at least
+                      ;; one key; there's no point waiting any longer, even
+                      ;; though read-key-sequence thinks we should wait
+                      ;; for more input to decide how to interpret the
+                      ;; current input.
+                      (throw 'read-key keys))))))))
+    (unwind-protect
+        (progn
+         (use-global-map read-key-empty-map)
+         (aref (catch 'read-key (read-key-sequence prompt nil t)) 0))
+      (cancel-timer timer)
+      (use-global-map old-global-map))))
 
 (defun read-quoted-char (&optional prompt)
   "Like `read-char', but do not allow quitting.
@@ -2653,6 +2653,7 @@ Similar to `call-process-shell-command', but calls `process-file'."
 
 (defmacro with-no-threads (&rest body)
   "Disable temporarily other threads to be executed."
+  (declare (indent 1) (debug t))
   `(unwind-protect
        (progn (inhibit-yield t)
               ,@body)