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: Thu, 15 Oct 2015 13:37:05 +0200 Message-ID: <87eggwuzvi.fsf@gnu.org> References: <877foo4nkd.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> <87a8s0v1lp.fsf@gmx.de> <87twq8gyk0.fsf@gnu.org> <87lhbk47hb.fsf@gnu.org> <83d1ww4416.fsf@gnu.org> <878u75rctw.fsf@gnu.org> <836129xtx8.fsf@gnu.org> <876129gs2a.fsf@gnu.org> <83twptw81l.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1444909156 22700 80.91.229.3 (15 Oct 2015 11:39:16 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 15 Oct 2015 11:39:16 +0000 (UTC) Cc: 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 Thu Oct 15 13:39:03 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 1Zmgs9-00049m-Vi for geb-bug-gnu-emacs@m.gmane.org; Thu, 15 Oct 2015 13:39:02 +0200 Original-Received: from localhost ([::1]:46994 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zmgs8-0007JX-VT for geb-bug-gnu-emacs@m.gmane.org; Thu, 15 Oct 2015 07:39:00 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36827) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZmgrH-0007HW-Ae for bug-gnu-emacs@gnu.org; Thu, 15 Oct 2015 07:38:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZmgrC-0007VQ-9w for bug-gnu-emacs@gnu.org; Thu, 15 Oct 2015 07:38:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:60844) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZmgrC-0007VI-5e for bug-gnu-emacs@gnu.org; Thu, 15 Oct 2015 07:38:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1ZmgrB-0005NK-UY for bug-gnu-emacs@gnu.org; Thu, 15 Oct 2015 07:38: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: Thu, 15 Oct 2015 11:38: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.144490903120585 (code B ref 21313); Thu, 15 Oct 2015 11:38:01 +0000 Original-Received: (at 21313) by debbugs.gnu.org; 15 Oct 2015 11:37:11 +0000 Original-Received: from localhost ([127.0.0.1]:51541 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZmgqM-0005Lw-Vs for submit@debbugs.gnu.org; Thu, 15 Oct 2015 07:37:11 -0400 Original-Received: from nsmtp.uni-koblenz.de ([141.26.64.14]:34689) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZmgqJ-0005Lm-Bl for 21313@debbugs.gnu.org; Thu, 15 Oct 2015 07:37:08 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by nsmtp.uni-koblenz.de (Postfix) with ESMTP id 54B5B23A264; Thu, 15 Oct 2015 13:37:06 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at uni-koblenz.de Original-Received: from nsmtp.uni-koblenz.de ([127.0.0.1]) by localhost (nsmtp.uni-koblenz.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ikTl1CahVsOB; Thu, 15 Oct 2015 13:37:06 +0200 (CEST) Original-Received: from deliver.uni-koblenz.de (deliver.uni-koblenz.de [141.26.64.15]) by nsmtp.uni-koblenz.de (Postfix) with ESMTPS; Thu, 15 Oct 2015 13:37:06 +0200 (CEST) Original-Received: from thinkpad-t440p (dhcp66.uni-koblenz.de [141.26.71.66]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by deliver.uni-koblenz.de (Postfix) with ESMTPSA id 1BBC01A8374; Thu, 15 Oct 2015 13:37:06 +0200 (CEST) In-Reply-To: <83twptw81l.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 14 Oct 2015 22:43:02 +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:107642 Archived-At: Eli Zaretskii writes: >> I added some debug code which spits out something like >> >> record_char: 107 >> -> NOT storing as part of macro >> -2> set to recent_keys at index 28 >> >> where the 107 is the result of formatting the Lisp_Object with "%S", the >> second line indicates if store_kbd_macro_char is doing something, and >> the -2> line means that the second ASET (recent_keys, ...) invocation in >> record_char has been executed. >> >> That's what you had in mind, right? > > Yes, thanks. Ok, great. But somehow my debugging code changes the behavior with respect to hitting C-g in the minibuffer and I don't see how that can happen. Concretely, normally C-g in the minibuffer will exit the minibuffer or exit the recursive minibuffer popping to the previous one. But with my change, I need to hit C-g twice in quick succession. A single C-g does nothing (record_char isn't called at all), and pressing it many times with reasonably long pauses in between does nothing, too (no record_char). Oh, wait. Now I can tell you exactly how quickly I have to type the second C-g. When I type C-g, the echo area shows Quit and then switches back to the prompt I had before. The second C-g must come within the time the echo area still shows Quit. That's the output I get when doing M-x C-g C-g quickly. The second record_char output appears just after the second C-g in the sequence. --8<---------------cut here---------------start------------->8--- record_char: 134217848 ;; M-x -> NOT storing as part of macro -2> set to recent_keys at index 15 record_char: 7 ;; issued after C-g twice in quick succession -> NOT storing as part of macro -2> set to recent_keys at index 17 --8<---------------cut here---------------end--------------->8--- And these are my changes. Do you see anything stupid in there, or is this some sort of a timing issue (which would at least partially explain why I seem to be the only one seeing these "strange problems")? --8<---------------cut here---------------start------------->8--- debug-record_char 74795245e4afc71dac56cd625a574a13be42227e Author: Tassilo Horn AuthorDate: Wed Oct 14 21:22:27 2015 +0200 Commit: Tassilo Horn CommitDate: Thu Oct 15 13:29:28 2015 +0200 Parent: 59def59 Refer to `(elisp)Basic Completion' in completing-read docstring Merged: debug-record_char master Containing: debug-record_char Follows: emacs-24.5-rc3-fixed (6228) Debug record_char 2 files changed, 11 insertions(+), 1 deletion(-) src/keyboard.c | 8 ++++++++ src/macros.c | 4 +++- modified src/keyboard.c @@ -3151,6 +3151,9 @@ help_char_p (Lisp_Object c) static void record_char (Lisp_Object c) { + AUTO_STRING (format, "%S"); + printf ("record_char: %s\n", SSDATA (CALLN (Fformat, format, c))); + int recorded = 0; if (CONSP (c) && (EQ (XCAR (c), Qhelp_echo) || EQ (XCAR (c), Qmouse_movement))) @@ -3213,6 +3216,7 @@ record_char (Lisp_Object c) { ASET (recent_keys, ix1, c); recorded = 1; + printf (" -1> set to recent_keys at index %d\n", ix1); } } } @@ -3223,6 +3227,7 @@ record_char (Lisp_Object c) { total_keys += total_keys < NUM_RECENT_KEYS; ASET (recent_keys, recent_keys_index, c); + printf (" -2> set to recent_keys at index %d\n", recent_keys_index); if (++recent_keys_index >= NUM_RECENT_KEYS) recent_keys_index = 0; } @@ -3242,9 +3247,12 @@ record_char (Lisp_Object c) if (--recent_keys_index < 0) recent_keys_index = NUM_RECENT_KEYS - 1; ASET (recent_keys, recent_keys_index, Qnil); + printf (" -3> set to recent_keys at index %d\n", recent_keys_index); } } + fflush (stdout); + num_nonmacro_input_events++; /* Write c to the dribble file. If c is a lispy event, write modified src/macros.c @@ -185,6 +185,7 @@ store_kbd_macro_char (Lisp_Object c) if (!NILP (KVAR (kb, defining_kbd_macro))) { + printf (" -> storing as part of macro\n"); if (kb->kbd_macro_ptr - kb->kbd_macro_buffer == kb->kbd_macro_bufsize) { ptrdiff_t ptr_offset, end_offset, nbytes; @@ -200,9 +201,10 @@ store_kbd_macro_char (Lisp_Object c) kb->kbd_macro_ptr = kb->kbd_macro_buffer + ptr_offset; kb->kbd_macro_end = kb->kbd_macro_buffer + end_offset; } - *kb->kbd_macro_ptr++ = c; } + else + printf (" -> NOT storing as part of macro\n"); } /* Declare that all chars stored so far in the kbd macro being defined --8<---------------cut here---------------end--------------->8--- Bye, Tassilo