[Top][All Lists]

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

read-event and unexpected buffer changes

From: Julien Danjou
Subject: read-event and unexpected buffer changes
Date: Sun, 28 Apr 2013 22:41:45 +0200
User-agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.3.50 (gnu/linux)

Hi there,

I'm having a nasty bug and just spent an hour tracking it down.

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. Basically, the buffer is supposed to be shown as:

| <jd> ohla
| <foo> hey
| <foo> how are you jd?
| [#bar]

But because of this `read-event' call, the buffer is "recentered to the
top" and I finally see this instead:

| <foo> how are you jd?
| [#bar]

Which is utterly inconvenient. I've tried adding `save-excursion' around
(read-event), but that doesn't change anything. I wonder what this
function can do that changes the buffer, and in any way, that doesn't
look like an expected and right side effect.

Julien Danjou
# Free Software hacker # freelance consultant
# http://julien.danjou.info

Attachment: pgp2TABg5v4kT.pgp
Description: PGP signature

reply via email to

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