From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tassilo Horn Newsgroups: gmane.emacs.bugs Subject: bug#21313: 25.0.50; Strange errors from dbus-handle-event Date: Sat, 03 Oct 2015 10:10:58 +0200 Message-ID: <87y4fkgynh.fsf@gnu.org> References: <877foo4nkd.fsf@gnu.org> <87wpvzs4r3.fsf@gnu.org> <87bnd9cf7g.fsf@gnu.org> <831te53zbq.fsf@gnu.org> <871te5cdg7.fsf@gnu.org> <83wpvx2h16.fsf@gnu.org> <87r3lziti9.fsf@gnu.org> <83zj0n7jtl.fsf@gnu.org> <87wpvjovfu.fsf@gnu.org> <877fnikhms.fsf@gmail.com> <87oaguq2yw.fsf@gnu.org> <8737xtt8wt.fsf@gnu.org> <834mi95bx1.fsf@gnu.org> <87twq9roxn.fsf@gnu.org> <83wpv53rjn.fsf@gnu.org> <87h9m9rmgk.fsf@gmx.de> <87wpv4qzm2.fsf@gnu.org> <877fn4ihrb.fsf@gnu.org> <83twq84e5r.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1443859945 7618 80.91.229.3 (3 Oct 2015 08:12:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 3 Oct 2015 08:12:25 +0000 (UTC) Cc: rpluim@gmail.com, michael.albinus@gmx.de, 21313@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Oct 03 10:12:13 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1ZiHvO-00017j-Cy for geb-bug-gnu-emacs@m.gmane.org; Sat, 03 Oct 2015 10:12:10 +0200 Original-Received: from localhost ([::1]:37388 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZiHvN-0005Ua-MH for geb-bug-gnu-emacs@m.gmane.org; Sat, 03 Oct 2015 04:12:09 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43071) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZiHvJ-0005UR-Ng for bug-gnu-emacs@gnu.org; Sat, 03 Oct 2015 04:12:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZiHvG-0008Du-HI for bug-gnu-emacs@gnu.org; Sat, 03 Oct 2015 04:12:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:35525) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZiHvG-0008Dq-EY for bug-gnu-emacs@gnu.org; Sat, 03 Oct 2015 04:12:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1ZiHvG-0001rp-05 for bug-gnu-emacs@gnu.org; Sat, 03 Oct 2015 04:12:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Tassilo Horn Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 03 Oct 2015 08:12:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 21313 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 21313-submit@debbugs.gnu.org id=B21313.14438598647095 (code B ref 21313); Sat, 03 Oct 2015 08:12:01 +0000 Original-Received: (at 21313) by debbugs.gnu.org; 3 Oct 2015 08:11:04 +0000 Original-Received: from localhost ([127.0.0.1]:52729 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZiHuK-0001qM-8Z for submit@debbugs.gnu.org; Sat, 03 Oct 2015 04:11:04 -0400 Original-Received: from out4-smtp.messagingengine.com ([66.111.4.28]:50380) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZiHuI-0001qF-KJ for 21313@debbugs.gnu.org; Sat, 03 Oct 2015 04:11:03 -0400 Original-Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 5394D2070C for <21313@debbugs.gnu.org>; Sat, 3 Oct 2015 04:11:02 -0400 (EDT) Original-Received: from frontend2 ([10.202.2.161]) by compute2.internal (MEProxy); Sat, 03 Oct 2015 04:11:02 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=smtpout; bh=KeH9CCG4VqH5+9RkhoS95H3jjw8=; b=scx8a Nb7MpQRpu7aVh7Bc8aRiAScMqViz7yPUVzhOYf9cy6K2uGC+pOEdlQMpJMB2OlG/ Ucx28nA4+CGhwgoaZdGOMrj69g0S0rNpq4R9jfC4slkQffcbtzmuGJEseV+Jju1c RKZfk3/QlD6uTtRxDdX8Kg2Ooy183PoPdY56u8= X-Sasl-enc: X8TgqYCnPQdqMcZLOgVMsM7CG9PHei6zJ78cUKIlS8+S 1443859861 Original-Received: from thinkpad-t440p (unknown [2.160.114.254]) by mail.messagingengine.com (Postfix) with ESMTPA id 10D266801B4; Sat, 3 Oct 2015 04:11:00 -0400 (EDT) In-Reply-To: <83twq84e5r.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 03 Oct 2015 10:14:24 +0300") User-Agent: Gnus/5.130014 (Ma Gnus v0.14) Emacs/25.0.50 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:107243 Archived-At: Eli Zaretskii writes: > Fmake_vector needs a Lisp integer as its first argument, i.e. you need > to use make_number. (And I'd suggest to use Qnil or some other Lisp > object as the second, not a C zero, although currently Qnil's value is > indeed zero.) Ah, ok. And then Vth_event_buffer_idx also needs to be a Lisp integer. So I tried this: --8<---------------cut here---------------start------------->8--- diff --git a/src/keyboard.c b/src/keyboard.c index 966af69..fce819c 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -3412,6 +3412,12 @@ kbd_buffer_nr_stored (void) void kbd_buffer_store_event (register struct input_event *event) { + Faset (Vth_event_buffer, Vth_event_buffer_idx, make_lispy_event (event)); + if (Vth_event_buffer_idx == make_number (99)) + Vth_event_buffer_idx = make_number (0); + else + Vth_event_buffer_idx = call2 (Qplus, Vth_event_buffer, make_number (1)); + kbd_buffer_store_event_hold (event, 0); } @@ -11131,6 +11137,14 @@ syms_of_keyboard (void) defsubr (&Sposn_at_point); defsubr (&Sposn_at_x_y); + DEFVAR_LISP ("th-input-event-buffer", Vth_event_buffer, + doc: /* The last 100 events. */); + Vth_event_buffer = Fmake_vector(make_number (100), Qnil); + + DEFVAR_LISP ("th-input-event-buffer-idx", Vth_event_buffer_idx, + doc: /* Current index in th-event-buffer. */); + Vth_event_buffer_idx = make_number (0); + DEFVAR_LISP ("last-command-event", last_command_event, doc: /* Last input event that was part of a command. */); --8<---------------cut here---------------end--------------->8--- But then I get: --8<---------------cut here---------------start------------->8--- In toplevel form: notifications.el:37:1:Error: Wrong type argument: number-or-marker-p, [(dbus-event :system 2 2 "org.freedesktop.DBus" nil nil nil dbus-call-method-handler) nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil] Makefile:269: recipe for target 'notifications.elc' failed make[2]: *** [notifications.elc] Error 1 make[2]: *** Waiting for unfinished jobs.... ELC pcmpl-linux.elc In pcomplete/tar: pcmpl-gnu.el:162:47:Warning: \u2018pcomplete-suffix-list\u2019 is an obsolete variable (as of 24.1). make[2]: Leaving directory '/home/horn/Repos/el/emacs-debug/lisp' Makefile:292: recipe for target 'compile-main' failed make[1]: *** [compile-main] Error 2 make[1]: Leaving directory '/home/horn/Repos/el/emacs-debug/lisp' Makefile:385: recipe for target 'lisp' failed make: *** [lisp] Error 2 --8<---------------cut here---------------end--------------->8--- I guess that naive approach won't work because make_lispy_event is not free of side-effects. It actually modifies the event so calling it twice per event has negative consequences. Well, I now try following Michaels suggesting of reverting this one commit about `unread-command-events'. Bye, Tassilo