From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#48042: 26.3; Macros don't work with french-postfix input method Date: Fri, 14 May 2021 14:09:34 +0300 Message-ID: <831ra9zi4x.fsf@gnu.org> References: <86pmyghqf1.fsf@upmc.fr> <425cd7715bc9fae8b39a@heytings.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24821"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 48042@debbugs.gnu.org, harven@free.fr To: Gregory Heytings , Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri May 14 13:10:13 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lhVht-0006Kr-LG for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 14 May 2021 13:10:13 +0200 Original-Received: from localhost ([::1]:42582 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lhVhs-0002WR-HA for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 14 May 2021 07:10:12 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43150) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lhVhi-0002WC-DR for bug-gnu-emacs@gnu.org; Fri, 14 May 2021 07:10:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:33630) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lhVhi-0005Wy-60 for bug-gnu-emacs@gnu.org; Fri, 14 May 2021 07:10:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lhVhi-0000jK-0o for bug-gnu-emacs@gnu.org; Fri, 14 May 2021 07:10:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 14 May 2021 11:10:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 48042 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: confirmed Original-Received: via spool by 48042-submit@debbugs.gnu.org id=B48042.16209905702740 (code B ref 48042); Fri, 14 May 2021 11:10:01 +0000 Original-Received: (at 48042) by debbugs.gnu.org; 14 May 2021 11:09:30 +0000 Original-Received: from localhost ([127.0.0.1]:45173 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lhVhC-0000i6-7T for submit@debbugs.gnu.org; Fri, 14 May 2021 07:09:30 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:49398) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lhVhB-0000hv-6q for 48042@debbugs.gnu.org; Fri, 14 May 2021 07:09:29 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:37864) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lhVh4-0005CG-Ky; Fri, 14 May 2021 07:09:23 -0400 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:4392 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lhVh4-0003k3-7y; Fri, 14 May 2021 07:09:22 -0400 In-Reply-To: <425cd7715bc9fae8b39a@heytings.org> (message from Gregory Heytings on Fri, 14 May 2021 09:29:08 +0000) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:206513 Archived-At: > Date: Fri, 14 May 2021 09:29:08 +0000 > From: Gregory Heytings > Cc: 48042@debbugs.gnu.org > > --- a/src/keyboard.c > +++ b/src/keyboard.c > @@ -3098,7 +3098,11 @@ read_char (int commandflag, Lisp_Object map, > /* When we consume events from the various unread-*-events lists, we > bypass the code that records input, so record these events now if > they were not recorded already. */ > - if (!recorded) > + if (!recorded && > + /* However, don't record events when a keyboard macro is being > + defined and an input method is activated (Bug#48042). */ > + ! (! NILP (KVAR (current_kboard, defining_kbd_macro)) && > + ! NILP (Fsymbol_value (Qcurrent_input_method)))) Bother: AFAIK, current-input-method non-nil means the user activated an input method, it doesn't mean we are in the middle of typing a key sequence that will yield a character via the input method. That is, a user could activate an input method, but still keep typing just ASCII characters. So why is this condition correct here to avoid recording input more than once? This is why I tried to have a variable that quail.el binds while actually processing keys. I'd appreciate some explanation for why that didn't work 100% in the case in point (it still avoided recording twice some of the keys, so it isn't entirely wrong). Stefan, any comments? Also, please avoid quoting a bug number in comments as a replacement for explaining the code, unless the explanation would need a very long and convoluted text. We should strive to make our comments self-explanatory. (That some code was added/modified to fix a certain bug is very easy to find out using "git log -L" and similar commands, so a bug number is almost always redundant in comments.) Thanks.