all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* read-event and unexpected buffer changes
@ 2013-04-28 20:41 Julien Danjou
  2013-05-23 17:31 ` Stefan Monnier
  2013-05-27 11:59 ` read-event and unexpected buffer changes Michael Albinus
  0 siblings, 2 replies; 9+ messages in thread
From: Julien Danjou @ 2013-04-28 20:41 UTC (permalink / raw)
  To: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 1485 bytes --]

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.

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

[-- Attachment #2: Type: application/pgp-signature, Size: 835 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2013-05-27 12:42 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 ` read-event and unexpected buffer changes Michael Albinus
2013-05-27 12:28   ` Julien Danjou
2013-05-27 12:42     ` Michael Albinus

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.