bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#24635: 24.5; Missing preview of entered unicode codepoints (C-q code


From: Eli Zaretskii
Subject: bug#24635: 24.5; Missing preview of entered unicode codepoints (C-q codepoint SPC)
Date: Mon, 21 Nov 2016 18:13:24 +0200

> Date: Fri, 07 Oct 2016 15:35:50 +0300
> From: Eli Zaretskii <eliz@gnu.org>
> Cc: 24635@debbugs.gnu.org
> 
> > From: Qqwy/W-M <qqwy@gmx.com>
> > Date: Fri, 7 Oct 2016 11:53:41 +0200
> > 
> > Today I learned from [this video
> > tutorial](https://youtu.be/3hwUnhdKWiI?t=4m27s), (link to the time with
> > exact explanation) of this feature that you can type C-q, followed by
> > the octal(or, if configured, decimal or hexadecimal) unicode codepoint,
> > followed by a non-digit key, to insert the appropriate unicode character.
> > 
> > However, for some reason, these typed codepoints do not show up in the
> > echo bar at the far bottom, making it very easy to mistype.
> 
> This bug was introduced in Emacs 24.4.  Further bisection is welcome.

The reason is this commit:

  commit 321e1a9c4283e1fd1db5a6b7c75325d5ed7b97e1
  Author:     Stefan Monnier <monnier@iro.umontreal.ca>
  AuthorDate: Fri Jul 5 20:10:54 2013 -0400
  Commit:     Stefan Monnier <monnier@iro.umontreal.ca>
  CommitDate: Fri Jul 5 20:10:54 2013 -0400

      * lisp/subr.el (read-quoted-char): Use read-key.
      (sit-for): Let read-event decode tty input.

      Fixes: debbugs:14782

Only the second part of the change is AFAIU actually related to
bug#14782.  The change in read-quoted-char (and in at least one more
place not even mentioned in the log) is due to some general issue with
read-event that is hinted at in the comment in sit-for added by this
commit.

If I replace the call to read-key in read-quoted-char with an
equivalent call to read-event, the "C-q" echoing is back.

Stefan, do you see a way to make read-key or the functions it calls
echo the input characters?  I didn't see a way to do that, but maybe I
missed something.

Failing that, I'm inclined to go back to using read-event in
read-quoted-char.  After all, we didn't have any bug reports due to
that, and the echo is a valuable feature, IMO.

A somewhat kludgy alternative is something like the patch below, but
I'm not sure it's justified here.  (It doesn't exactly restore
previous behavior, because the initial "C-q-" prompt appears
immediately, rather than after read-key-delay, but it's close.)

--- lisp/simple.el~0    2016-10-25 07:30:02.000000000 +0300
+++ lisp/simple.el      2016-11-21 10:11:35.430192000 +0200
@@ -776,7 +776,7 @@
            (let (translation-table-for-input input-method-function)
              (if (or (not overwrite-mode)
                      (eq overwrite-mode 'overwrite-mode-binary))
-                 (read-quoted-char)
+                 (read-quoted-char (key-description (this-command-keys)))
                (read-char))))))
     ;; This used to assume character codes 0240 - 0377 stand for
     ;; characters in some single-byte character set, and converted them





reply via email to

[Prev in Thread] Current Thread [Next in Thread]