From: Michael Albinus <michael.albinus@gmx.de>
To: emacs-devel@gnu.org
Subject: Re: read-event and unexpected buffer changes
Date: Mon, 27 May 2013 13:59:51 +0200 [thread overview]
Message-ID: <87zjvgfxag.fsf@gmx.de> (raw)
In-Reply-To: <87zjwigzg6.fsf@dex.adm.naquadah.org> (Julien Danjou's message of "Sun, 28 Apr 2013 22:41:45 +0200")
Julien Danjou <julien@danjou.info> writes:
> Hi there,
Hi,
> I'm using `erc-desktop-notifications' to get IRC messages sent with my
> nickname over D-Bus using `notifications-notify'. This function calls
> `dbus-call-method' which contains the following snippet at the end:
>
> (with-timeout ((if timeout (/ timeout 1000.0) 25))
> (while (eq (gethash key dbus-return-values-table :ignore) :ignore)
> (let ((event (let (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)))))))
>
> This `read-event' call causes me trouble. Basically what happens, is
> that it changes the ERC buffer in a very subtle way so that the last
> line is then on top.
>
> Hint?
Does the following patch suffices?
--8<---------------cut here---------------start------------->8---
*** /home/albinmic/src/emacs/lisp/net/dbus.el.~112739~ 2013-05-27 13:51:51.844960427 +0200
--- /home/albinmic/src/emacs/lisp/net/dbus.el 2013-05-27
13:51:33.992671583 +0200
***************
*** 270,276 ****
;; default 25". Events which are not from D-Bus must be restored.
(with-timeout ((if timeout (/ timeout 1000.0) 25))
(while (eq (gethash key dbus-return-values-table :ignore) :ignore)
! (let ((event (let (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)))))))
--- 270,277 ----
;; default 25". Events which are not from D-Bus must be restored.
(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)))))))
--8<---------------cut here---------------end--------------->8---
Best regards, Michael.
next prev parent reply other threads:[~2013-05-27 11:59 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-28 20:41 read-event and unexpected buffer changes Julien Danjou
2013-05-23 17:31 ` Stefan Monnier
2013-05-24 12:22 ` Michael Albinus
2013-05-24 15:48 ` DBus events processing (was: read-event and unexpected buffer changes) Stefan Monnier
2013-05-24 22:08 ` DBus events processing Michael Albinus
2013-05-25 1:54 ` Stefan Monnier
2013-05-27 11:59 ` Michael Albinus [this message]
2013-05-27 12:28 ` read-event and unexpected buffer changes Julien Danjou
2013-05-27 12:42 ` Michael Albinus
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87zjvgfxag.fsf@gmx.de \
--to=michael.albinus@gmx.de \
--cc=emacs-devel@gnu.org \
/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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).