unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Kangas <stefan@marxist.se>
To: Ryan Johnson <ryanjohn@ece.cmu.edu>
Cc: 6920@debbugs.gnu.org
Subject: bug#6920: 23.2; ESC passed out of order to post-read-conversion
Date: Fri, 11 Oct 2019 16:14:51 +0200	[thread overview]
Message-ID: <CADwFkmmSzMOf4WhUVZXz8441wRy819r3MxMwz0-31rOG=5zWpw@mail.gmail.com> (raw)
In-Reply-To: <4C762592.6080309@ece.cmu.edu>

Ryan Johnson <ryanjohn@ece.cmu.edu> writes:

>  This problem shows up running in terminal mode on a cygwin xterm,
> apparently because it sends terminal escape sequences one character at a
> time (where linux usually sends the whole thing at once). To reproduce,
> run the following three elisp commands:
>
> (define-coding-system 'utf-8-echo
>   "Echoes all input to the message area"
>   :coding-type 'utf-8
>   :mnemonic ?U
>   :ascii-compatible-p t
>   :charset-list '(unicode)
>   :post-read-conversion 'echo-conversion)
> (defun echo-conversion (len)
>   (let* ((p (point))
>      (e (+ p len))
>      (str (buffer-substring p e)))
>     (message "%s" str)
>     len))
> (set-keyboard-coding-system 'utf-8-echo)
>
> Then start using the left arrow key to navigate. The escape sequence is
> '^[OD' and every few arrow presses garbled bits of the "OD" portion will
> appear in the buffer and the point doesn't move properly. A
> representative sample of the message buffer looks like this:
>
> ^[
> O
> D
> ^[
> O
> D
> O
> D
> ^[ [2 times]
> O
> D
>
> The lossage buffer (below) shows how emacs becomes very confused as a
> result, reporting 'ESC O D O D D O D D ESC' at one point. Defining a
> similar coding system based on iso-8859-1 instead of utf-8 causes emacs
> to crash. Unfortunately, cygwin-gdb doesn't trap the signal so I can't
> produce a stack trace, but sometimes it gets stuck in an endless loop
> inside malloc, which suggests some sort of memory corruption is the
> culprit. As far as I know, 'ESC O D' is valid in both coding systems
> so that shouldn't be the problem.
>
> System info follows...
>
> In GNU Emacs 23.2.1 (i686-pc-cygwin)
>  of 2010-08-12 on host
> configured using `configure  '--prefix=/home/Ryan/apps/emacs-23.2'
> '--without-xpm' '--without-png' '--without-gif''

This was reported 9 years ago but unfortunately never got a reply at the
time.  Can you still reproduce it on a modern version of Emacs, for
example the latest version 26.3?

Best regards,
Stefan Kangas





  reply	other threads:[~2019-10-11 14:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-26  8:28 bug#6920: 23.2; ESC passed out of order to post-read-conversion Ryan Johnson
2019-10-11 14:14 ` Stefan Kangas [this message]
2019-10-11 14:16   ` Stefan Kangas

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='CADwFkmmSzMOf4WhUVZXz8441wRy819r3MxMwz0-31rOG=5zWpw@mail.gmail.com' \
    --to=stefan@marxist.se \
    --cc=6920@debbugs.gnu.org \
    --cc=ryanjohn@ece.cmu.edu \
    /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).