GNU bug report logs - #31692
aggressive-indent-mode causes Emacs to sometimes drop key events

Previous Next

Package: emacs;

Reported by: Radon Rosborough <radon.neon <at> gmail.com>

Date: Sun, 3 Jun 2018 02:23:02 UTC

Severity: normal

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
Cc: radon.neon <at> gmail.com, 31692 <at> debbugs.gnu.org
Subject: bug#31692: Emacs sometimes drops key events
Date: Mon, 11 Jun 2018 23:08:06 +0200
Hello,

is this ok to install (Eli)?

> I tried to adapt Eli's patch accordingly.  To avoid confusion, I simply
> use the concrete value - the CATCH-SYM - and just return t instead of
> throwing:
>
> diff --git a/lisp/subr.el b/lisp/subr.el
> index 914112ccef..7734006d87 100644
> --- a/lisp/subr.el
> +++ b/lisp/subr.el
> @@ -3520,9 +3520,25 @@ while-no-input
>    (let ((catch-sym (make-symbol "input")))
>      `(with-local-quit
>         (catch ',catch-sym
> -	 (let ((throw-on-input ',catch-sym))
> -	   (or (input-pending-p)
> -	       (progn ,@body)))))))
> +	 (let ((throw-on-input ',catch-sym)
> +               val)
> +           (setq val
> +	         (or (input-pending-p)
> +	             (progn ,@body)))
> +           (cond
> +            ;; If quit-flag is bound to the CATCH-SYM, it means BODY
> +            ;; didn't test quit-flag, and therefore ran to completion
> +            ;; even though input arrived before it finished.  In that
> +            ;; case, we must reset quit-flag (and return t), because
> +            ;; otherwise quit-flag will remain set, and we get Quit to
> +            ;; top-level, which has undesirable consequences, such as
> +            ;; discarding input etc.
> +            ((eq quit-flag ',catch-sym)
> +             (setq quit-flag nil)
> +             t)
> +            ;; This is in case the user actually quits while BODY runs.
> +            (quit-flag nil)
> +            (t val)))))))
>  
>  (defmacro condition-case-unless-debug (var bodyform &rest handlers)
>    "Like `condition-case' except that it does not prevent debugging.




This bug report was last modified 7 years and 19 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.