all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Julien Danjou <julien@danjou.info>
To: emacs-devel@gnu.org
Subject: read-event and unexpected buffer changes
Date: Sun, 28 Apr 2013 22:41:45 +0200	[thread overview]
Message-ID: <87zjwigzg6.fsf@dex.adm.naquadah.org> (raw)

[-- 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 --]

             reply	other threads:[~2013-04-28 20:41 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-28 20:41 Julien Danjou [this message]
2013-05-23 17:31 ` read-event and unexpected buffer changes 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

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=87zjwigzg6.fsf@dex.adm.naquadah.org \
    --to=julien@danjou.info \
    --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 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.