From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#11447: 24.1.50; notifications-notify eats keystrokes Date: Fri, 11 May 2012 13:28:49 -0400 Message-ID: References: <87likzrcix.fsf@micropit.couberia.bzh> <87vck3qgy9.fsf@gmx.de> <87ipg2reoh.fsf@gmx.de> <87ehqqrb45.fsf@gmx.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1336757404 27590 80.91.229.3 (11 May 2012 17:30:04 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 11 May 2012 17:30:04 +0000 (UTC) Cc: Peter =?UTF-8?Q?M=C3=BCnster?= , 11447@debbugs.gnu.org To: Michael Albinus Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri May 11 19:30:03 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SStfG-0008Sx-5m for geb-bug-gnu-emacs@m.gmane.org; Fri, 11 May 2012 19:30:02 +0200 Original-Received: from localhost ([::1]:54323 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SStfF-0000QW-Ii for geb-bug-gnu-emacs@m.gmane.org; Fri, 11 May 2012 13:30:01 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:42391) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SStfD-0000QG-9K for bug-gnu-emacs@gnu.org; Fri, 11 May 2012 13:30:00 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SStfB-0000eh-Dx for bug-gnu-emacs@gnu.org; Fri, 11 May 2012 13:29:58 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:55296) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SStfB-0000ec-AL for bug-gnu-emacs@gnu.org; Fri, 11 May 2012 13:29:57 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1SStfG-0004N1-OY for bug-gnu-emacs@gnu.org; Fri, 11 May 2012 13:30:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 11 May 2012 17:30:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 11447 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 11447-submit@debbugs.gnu.org id=B11447.133675734316702 (code B ref 11447); Fri, 11 May 2012 17:30:02 +0000 Original-Received: (at 11447) by debbugs.gnu.org; 11 May 2012 17:29:03 +0000 Original-Received: from localhost ([127.0.0.1]:49367 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SSteJ-0004LK-0o for submit@debbugs.gnu.org; Fri, 11 May 2012 13:29:03 -0400 Original-Received: from ironport-out.teksavvy.com ([206.248.143.162]:36238) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SSteH-0004Kp-Ix for 11447@debbugs.gnu.org; Fri, 11 May 2012 13:29:02 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AjIKACxOgk9FpYsJ/2dsb2JhbABDtheCDAOBDIEIggkBAQQBViECBQsLNBIUGA0kiBwFtjKLYYR5BKRFgV2DAw X-IronPort-AV: E=Sophos;i="4.75,391,1330923600"; d="scan'208";a="179670304" Original-Received: from 69-165-139-9.dsl.teksavvy.com (HELO pastel.home) ([69.165.139.9]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 11 May 2012 13:28:49 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 54570590CF; Fri, 11 May 2012 13:28:49 -0400 (EDT) In-Reply-To: <87ehqqrb45.fsf@gmx.de> (Michael Albinus's message of "Fri, 11 May 2012 17:27:54 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.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-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:59946 Archived-At: >>> (with-timeout ((if timeout (/ timeout 1000.0) 25)) >>> (while (eq (gethash key dbus-return-values-table :ignore) :ignore) >>> (or (input-pending-p) (sit-for 0.1 'nodisp)))) >> Well, actually if you use sit-for you don't need input-pending-p. > OK. >>> With the example in this bug report, I get blocked then. >> What do you mean by "blocked"? > An input char goes into unread-command-event. Why? Who puts it there? > Since nobody handles it, the while-loop runs forever. I think I understand what you mean: you mean that while you do `sit-for' you actually want to run the code associated with the incoming events, since that code might be the one which changes dbus-return-values-table. So, indeed sit-for and input-pending-p won't cut it. Your code looks OK, then, though you don't need to use a 0.1 timeout, AFAICT. And in order to avoid the (let (unread-command-events) ...), I'd do something like: (let ((seen ())) (unwind-protect (let ((event (read-event))) (when (and event (not (ignore-errors (dbus-check-event event)))) (push event seen))) (setq unread-command-events (append unread-command-events (nreverse seen))))) -- Stefan