From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Julien Danjou Newsgroups: gmane.emacs.devel Subject: read-event and unexpected buffer changes Date: Sun, 28 Apr 2013 22:41:45 +0200 Message-ID: <87zjwigzg6.fsf@dex.adm.naquadah.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" X-Trace: ger.gmane.org 1367181718 1449 80.91.229.3 (28 Apr 2013 20:41:58 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 28 Apr 2013 20:41:58 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Apr 28 22:41:59 2013 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UWYQ3-0001K3-75 for ged-emacs-devel@m.gmane.org; Sun, 28 Apr 2013 22:41:59 +0200 Original-Received: from localhost ([::1]:36114 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UWYQ2-0000u7-Nx for ged-emacs-devel@m.gmane.org; Sun, 28 Apr 2013 16:41:58 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:57362) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UWYPv-0000u0-MO for emacs-devel@gnu.org; Sun, 28 Apr 2013 16:41:55 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UWYPr-0006NB-Nk for emacs-devel@gnu.org; Sun, 28 Apr 2013 16:41:51 -0400 Original-Received: from prometheus.naquadah.org ([91.121.37.122]:48486 helo=mx1.naquadah.org) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UWYPr-0006MD-Hr for emacs-devel@gnu.org; Sun, 28 Apr 2013 16:41:47 -0400 Original-Received: from dex.adm.naquadah.org (fes75-2-78-192-50-146.fbxo.proxad.net [78.192.50.146]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by mx1.naquadah.org (Postfix) with ESMTPSA id 9D5C2E0255 for ; Sun, 28 Apr 2013 22:41:45 +0200 (CEST) Mail-Followup-To: emacs-devel@gnu.org User-Agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.3.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 91.121.37.122 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:159200 Archived-At: --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable 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: /----- | ohla | hey | 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: /----- | how are you jd? | [#bar] | |=20 \----- 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? =2D-=20 Julien Danjou # Free Software hacker # freelance consultant # http://julien.danjou.info --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iQIcBAEBAgAGBQJRfYmJAAoJEGEbqVCLeKXCu0gQAKcsuAXHKMmNg+07BcVGZE7n pY+vWPt1tlQSo1+ywy8K0JbcQws8FqY40m8n4HRlvvf8NmoWd29Q9slmHlKCqQoU LHmTBuevcnvsfLC7TZ7xofcQd//oNjaZrtiqQIFvUTRGSrSPfaiitsgySxLBe5qx CuMWt/4LXKdVKC9CTPJ04cyfOr2Ls5/nAgIN1qqw7kpdknKvc6WI//eovshwiGYG jHo1vgXubbLcw6Iw1YCFD3cHZvkI9hl7KU1GPV+vEUmYuWK1gbbIx3BGktkydrae OsMRMqloKSnlXDL7uGRJGfM5N76CeJwxXgO9hefAnTQYoZCEbBLcjhC8VbUzX4B/ EjJoBgxS/iW+enpV4ZTKHU1GWWidPY+IX3sZKh1RqEUMNdpZTboJAycMHcxWLkM/ dwffYT/2LY2Q9spMeLTcJpAoc+Xdy//VMpjJ5+9uiabrPewqsEfMBG6MECH3RMuC FW85iQzU/tvuZz6RDQV998hxmW8J5iWw2YeRosVAiigAVwiSzMjyIoOyZUi7YPdD tmQFmfF/cR7IeF/W6b0DTp6iaEIP9rz53p/2/gZGhUhDQBl0A7FLDDXgYw65wI3n xOr0pk9TDY9L7epQbA34B3B086Eyd+d+OqHWRXIuCssYYLanAECCLZ/VDWhl4ph5 VGWNHHnNrakWzmrSCr1h =1E7V -----END PGP SIGNATURE----- --=-=-=--