From: Daniel Colascione <dancol@dancol.org>
To: Michael Albinus <michael.albinus@gmx.de>
Cc: emacs-devel@gnu.org
Subject: Re: trunk r116456: Improve dbus performance on synchronous calls
Date: Mon, 17 Feb 2014 08:17:43 -0800 [thread overview]
Message-ID: <53023627.1060001@dancol.org> (raw)
In-Reply-To: <87lhx9lo4y.fsf@gmx.de>
On 02/17/2014 08:06 AM, Michael Albinus wrote:
> Daniel Colascione <dan.colascione@gmail.com> writes:
>
>> (with-timeout ((if timeout (/ timeout 1000.0) 25))
>> (while (eq (gethash key dbus-return-values-table :ignore) :ignore)
>> - (let ((event (let ((inhibit-redisplay t) unread-command-events)
>> - (read-event nil nil 0.1))))
>> - (when (and event (not (ignore-errors (dbus-check-event event))))
>> - (setq unread-command-events
>> - (append unread-command-events (list event)))))))
>> + (let ((event (let ((inhibit-redisplay t) unread-command-events)
>> + (read-event nil nil check-interval))))
>> + (when event
>> + (push event unread-command-events))
>> + (when (< check-interval 1)
>> + (setf check-interval (* check-interval 1.05))))))
>
> Why `push'? It adds the event on top of `unread-command-events',
> changing the event order when there are already events in that list.
Hrm. I was getting it from sit-for:
(let ((read (read-event nil t seconds)))
(or (null read)
(progn
;; If last command was a prefix arg, e.g. C-u, push this event onto
;; unread-command-events as (t . EVENT) so it will be added to
;; this-command-keys by read-key-sequence.
(if (eq overriding-terminal-local-map universal-argument-map)
(setq read (cons t read)))
(push read unread-command-events)
nil)))
Speaking of which, shouldn't the dbus code just look like this?
(with-timeout ((if timeout (/ timeout 1000.0) 25))
(while (eq (gethash key dbus-return-values-table :ignore) :ignore)
(sit-for check-interval t)
(when (< check-interval 1)
(setf check-interval (* check-interval 1.05)))))
next prev parent reply other threads:[~2014-02-17 16:17 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <E1WFMaG-0002WV-8L@vcs.savannah.gnu.org>
2014-02-17 16:06 ` trunk r116456: Improve dbus performance on synchronous calls Michael Albinus
2014-02-17 16:17 ` Daniel Colascione [this message]
2014-02-17 16:41 ` dancol
2014-02-17 21:08 ` Michael Albinus
2014-02-17 21:42 ` Daniel Colascione
2014-02-18 0:00 ` Stefan Monnier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=53023627.1060001@dancol.org \
--to=dancol@dancol.org \
--cc=emacs-devel@gnu.org \
--cc=michael.albinus@gmx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.