unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Gregory Heytings <gregory@heytings.org>,
	Stefan Monnier <monnier@iro.umontreal.ca>
Cc: 48042@debbugs.gnu.org, harven@free.fr
Subject: bug#48042: 26.3; Macros don't work with french-postfix input method
Date: Fri, 14 May 2021 14:09:34 +0300	[thread overview]
Message-ID: <831ra9zi4x.fsf@gnu.org> (raw)
In-Reply-To: <425cd7715bc9fae8b39a@heytings.org> (message from Gregory Heytings on Fri, 14 May 2021 09:29:08 +0000)

> Date: Fri, 14 May 2021 09:29:08 +0000
> From: Gregory Heytings <gregory@heytings.org>
> 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.





  parent reply	other threads:[~2021-05-14 11:09 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-26 18:05 bug#48042: 26.3; Macros don't work with french-postfix input method harven
2021-04-26 18:22 ` Eli Zaretskii
2021-04-28 18:24 ` harven
2021-05-14  9:29 ` Gregory Heytings
2021-05-14  9:55   ` Basil L. Contovounesios
2021-05-14 10:03     ` Gregory Heytings
2021-05-14 11:09   ` Eli Zaretskii [this message]
2021-05-14 13:38     ` Gregory Heytings
2021-05-14 13:54       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-05-14 14:08         ` Gregory Heytings
2021-05-14 14:12           ` Eli Zaretskii
2021-05-14 14:04       ` Eli Zaretskii
2021-05-14 14:16         ` Gregory Heytings
2021-05-14 14:36           ` Eli Zaretskii
2021-05-14 15:00             ` Gregory Heytings
2021-05-14 15:11               ` Eli Zaretskii
2021-05-14 15:51             ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-05-14 15:59               ` Eli Zaretskii
2021-05-14 17:07               ` Gregory Heytings
2021-05-14 17:13                 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-05-15  9:46                   ` Gregory Heytings
2021-05-15 10:21                     ` Eli Zaretskii
2021-05-15 18:47                       ` Gregory Heytings
2021-05-15 18:52                         ` Eli Zaretskii
2021-05-15 20:17                           ` Gregory Heytings
2021-05-29  8:20                             ` Eli Zaretskii

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=831ra9zi4x.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=48042@debbugs.gnu.org \
    --cc=gregory@heytings.org \
    --cc=harven@free.fr \
    --cc=monnier@iro.umontreal.ca \
    /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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).