From ad9041ffe767fffe9d31e97af1efa764db703981 Mon Sep 17 00:00:00 2001 From: Giuseppe Scrivano Date: Tue, 22 Sep 2009 15:13:41 +0200 Subject: [PATCH] Move with-no-threads inside the let body block. --- lisp/subr.el | 63 ++++++++++++++++++++++++++++++------------------------------ 1 file changed, 32 insertions(+), 31 deletions(-) diff --git a/lisp/subr.el b/lisp/subr.el index 80cd13c7da2..7ad94b31d19 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -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) -- 2.11.4.GIT