emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: read-event and unexpected buffer changes


From: Michael Albinus
Subject: Re: read-event and unexpected buffer changes
Date: Mon, 27 May 2013 13:59:51 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

Julien Danjou <address@hidden> 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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]