From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Michael Heerdegen Newsgroups: gmane.emacs.bugs Subject: bug#31692: Emacs sometimes drops key events Date: Fri, 06 Jul 2018 19:43:04 +0200 Message-ID: <87k1q845w7.fsf@web.de> References: <83wovgd2aj.fsf@gnu.org> <87po163v65.fsf@web.de> <83in6yarhe.fsf@gnu.org> <877encq5co.fsf@web.de> <8336y0x9c3.fsf@gnu.org> <87zi078r8n.fsf@web.de> <83efhiwrmj.fsf@gnu.org> <83602uwq3y.fsf@gnu.org> <87zi042a9g.fsf@web.de> <834li316f4.fsf@gnu.org> <87d0w1o61v.fsf@web.de> <83o9flmqk0.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: blaine.gmane.org 1530898934 13224 195.159.176.226 (6 Jul 2018 17:42:14 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 6 Jul 2018 17:42:14 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: radon.neon@gmail.com, 31692@debbugs.gnu.org, monnier@IRO.UMontreal.CA To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Jul 06 19:42:10 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fbUkA-0003Cr-GR for geb-bug-gnu-emacs@m.gmane.org; Fri, 06 Jul 2018 19:42:06 +0200 Original-Received: from localhost ([::1]:59132 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fbUmF-00077Q-RN for geb-bug-gnu-emacs@m.gmane.org; Fri, 06 Jul 2018 13:44:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56848) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fbUm5-00075m-VJ for bug-gnu-emacs@gnu.org; Fri, 06 Jul 2018 13:44:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fbUm2-0001Ag-NY for bug-gnu-emacs@gnu.org; Fri, 06 Jul 2018 13:44:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:40913) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fbUm2-0001AZ-II for bug-gnu-emacs@gnu.org; Fri, 06 Jul 2018 13:44:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fbUm2-0005Ak-8J for bug-gnu-emacs@gnu.org; Fri, 06 Jul 2018 13:44:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Michael Heerdegen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 06 Jul 2018 17:44:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 31692 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 31692-submit@debbugs.gnu.org id=B31692.153089900219827 (code B ref 31692); Fri, 06 Jul 2018 17:44:02 +0000 Original-Received: (at 31692) by debbugs.gnu.org; 6 Jul 2018 17:43:22 +0000 Original-Received: from localhost ([127.0.0.1]:48810 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fbUlN-00059j-RY for submit@debbugs.gnu.org; Fri, 06 Jul 2018 13:43:22 -0400 Original-Received: from mout.web.de ([212.227.15.4]:58811) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fbUlL-00059W-Ox for 31692@debbugs.gnu.org; Fri, 06 Jul 2018 13:43:20 -0400 Original-Received: from drachen.dragon ([94.216.139.22]) by smtp.web.de (mrweb004 [213.165.67.108]) with ESMTPSA (Nemesis) id 0LpQjF-1g4nuA0E9l-00fDMF; Fri, 06 Jul 2018 19:43:07 +0200 In-Reply-To: <83o9flmqk0.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 05 Jul 2018 22:27:11 +0300") X-Provags-ID: V03:K1:mPhQMsTX5PhRIrTq8pzuAyZybQbYlTDHHgLIv75BJ/K82Yg8Ywx q+ksSKJjZv6PpUgQVO6kjFf1bjPCjdxbDQbd+gN5C7HVEm3+CokPgxb5Sp87uQgDzBdLsBu n1PApYkyC5VrOGYk4t7GNq2cNfDQkS9ACTYXlUkqt19+7U90tKRLt8YEv+IOfxip5N7z0ln xM3OFrPYp6LGuWK86L2RA== X-UI-Out-Filterresults: notjunk:1;V01:K0:E5/pbsgdDdU=:nJgb4VyM9Khb+lskgECUaL xF9Ax9OJ5/PhC4sjTgNTNN9EdKyWdQazLGbNdNoeR2y1ZI4hxs4zcPhrkmIdvA3gZL7RS0oTT N/LK0VgtbZfqy43ESoMqfB70N3TG1NuR6UM+Ycjp164ZkRdln5TEs0iU8TRwHpAZtuuBwoo0f SncyMAsZGpjUaiM6QtzVfyRiF+VNwa8xF9Bus1Yev1VE/zXkPqDsns1ke250xpEJEmhdhixho Fa9jj6hPboWisL7FJT62JYO40Cl6WeJH5ol8l+IR56/KZygfNsteh2LgV7cLYDoZJiFz0BET9 4VK1Pvt/eCX/zqHyhnzDD6KWMttirKygwkX7BS0sBH0NgAMCsdPRW64w6x2qcKTuH0eQruWMS xsMGmXHXGkjCWMOP6i6TdfAXl0P/y2OF914othBc1M4WIS8TwF70bUYzgUPDYOdnCRFCi0f2j NwxC3A9TaUTwmY/hsBHK4d/ZdaYq0L1JYCzm1cyirS46QHCyD/fXznWYPd+uJm4V+CXIcXs0f w+hpoSwEb+EQWpQr9qox9qwiyH/6V73dGdhJ4Ma24/uLhqetH2OQUFAtF5ZTmemgEa9IYEFBP FZ/1URXqfM9Pp0KfrctM7Qf6J9e2X3wygr0wxYG2FnZdlHvtia55IC6pRTZKO4ZLj6UEkkP4D IqftMGXhyYkO4v/yc0BAX34S4xBrssg60OM0JFuXiHlNpyQaXLgoo0U05i/+24zgjQNKrGmta oG7kScuWpPKIS5dEsOgXr44swD0j5T8FVeGuB+L6jH16kAhuSTRj61qTVzQ= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:148267 Archived-At: --=-=-= Content-Type: text/plain Eli Zaretskii writes: > I don't think you can reliably rebind C-g. For starters, it produces > SIGINT on TTY frames, so I think rebinding will have no effect, at > least in that use case. I think you misunderstood. My fix was not to rebind C-g. With our fix, hitting C-g while `sit-for' waits inside a `while-no-input' makes the latter throw a 'quit' signal. I can use `condition-case' to catch that quit, and call the actual binding of C-g (or just a hardcoded `abort-recursive-edit'). > Anyway, can you show some Lisp to reproduce the issue? Here is a template. To try it, call `read-test-input'. To see that C-g is not always running as expected, hit C-g while a sit-for is running (i.g. when the hint is shown). `read-test-input' reads in input and tries to do something: in this example counts words in the current buffer (which is interruptable) and uses an overlay to show a message in the minibuffer, which is automatically removed after a `sit-for' has finished. --=-=-= Content-Type: application/emacs-lisp Content-Disposition: inline; filename=testcase.el Content-Transfer-Encoding: quoted-printable ;; -*- lexical-binding: t -*- (defvar test--timer nil) (defun test-trigger-mb-hints () (if (not (timerp test--timer)) (setq test--timer (run-at-time 3 nil #'test-display-mb-hints)) (timer-set-time test--timer (time-add (current-time) 0.5)) (timer-activate test--timer))) (defun test-setup-mb-hints () (when (timerp test--timer) (cancel-timer test--timer)) (setq test--timer nil) (add-hook 'post-command-hook #'test-trigger-mb-hints t t)) (defun test-display-mb-hints () (when (minibufferp) (while-no-input (let* ((base-win (minibuffer-selected-window)) (buf (window-buffer base-win))) (let (words) (sit-for .5) (with-current-buffer buf ;; doing something potentially expensive here... (setq words (count-words (point-min) (point-max)))) (let ((ol (make-overlay (point-max) (point-max) nil t t))) (unwind-protect (cl-flet ((display-message (lambda (message &rest args) (setq message (propertize (apply #'format message args) 'face 'shadow)) (put-text-property 0 1 'cursor t message) (overlay-put ol 'after-string message) (redisplay)))) (display-message " [%s words]" words) (sit-for 10)) (delete-overlay ol)))))))) (defun test-read-input () (interactive) (minibuffer-with-setup-hook #'test-setup-mb-hints (read-string "Input: "))) --=-=-= Content-Type: text/plain Michael. --=-=-=--