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


Message #85 received at 31692 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Michael Heerdegen <michael_heerdegen <at> web.de>, radon.neon <at> gmail.com,
 31692 <at> debbugs.gnu.org
Subject: Re: bug#31692: Emacs sometimes drops key events
Date: Thu, 07 Jun 2018 11:30:58 -0400
> @@ -3511,9 +3511,25 @@
>    (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 equal to throw-on-input, 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 throw manually, 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 throw-on-input)
> +             (throw 'throw-on-input t))
> +            ;; This is in case the user actually quits while BODY runs.
> +            (quit-flag
> +             nil)
> +            (t val)))))))

I don't understand the (throw 'throw-on-input t)
(throw throw-on-input t) would make more sense, but in any case we're
just about to exit that `catch` so throwing won't have any real effect.
I think instead of (throw 'throw-on-input t) what is needed here is

    (setq quit-flag nil)

which will also make the body return nil (rather than t like (throw
throw-on-input t) would), which I believe is also the right thing.


        Stefan




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.