unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Chong Yidong <cyd@stupidchicken.com>
To: Dan Nicolaescu <dann@ics.uci.edu>
Cc: 1495@emacsbugs.donarmstrong.com, Paul R <paul.r.ml@gmail.com>,
	emacs-devel@gnu.org
Subject: Re: emacs -nw inserts unwanted chars if user is impatient
Date: Thu, 04 Dec 2008 23:10:35 -0500	[thread overview]
Message-ID: <87skp3w9c4.fsf@cyd.mit.edu> (raw)
In-Reply-To: <200812042030.mB4KU5Jn003761@mothra.ics.uci.edu> (Dan Nicolaescu's message of "Thu, 4 Dec 2008 12:30:05 -0800 (PST)")

Dan Nicolaescu <dann@ics.uci.edu> writes:

> I'm fairly confident this is due to the code in xterm.el that deals
> with modifyOtherKeys, the input probably comes while emacs is waiting
> from an answer from xterm.

This indeed seems to be the problem.

Discard pending input before doing the terminal query seems to fix the
bug for me.  I don't know if it's possible for the user's input to come
inat exactly at the correct moment to fool the terminal query; if so, a
more complicated solution might be required.

Thoughts?

*** trunk/lisp/term/xterm.el.~1.59.~	2008-09-30 20:01:30.000000000 -0400
--- trunk/lisp/term/xterm.el	2008-12-04 23:07:47.000000000 -0500
***************
*** 475,480 ****
--- 475,481 ----
  	  (str nil))
        ;; Try to find out the type of terminal by sending a "Secondary
        ;; Device Attributes (DA)" query.
+       (discard-input)
        (send-string-to-terminal "\e[>0c")
  
        ;; The reply should be of the form: \e [ > NUMBER1 ; NUMBER2 ; NUMBER3 c




  reply	other threads:[~2008-12-05  4:10 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-04 19:06 emacs -nw inserts unwanted chars if user is impatient Paul R
2008-12-04 19:30 ` Chong Yidong
2008-12-04 20:30   ` Dan Nicolaescu
2008-12-05  4:10     ` Chong Yidong [this message]
2008-12-11 16:32       ` Stefan Monnier
2008-12-04 21:52   ` Paul R

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=87skp3w9c4.fsf@cyd.mit.edu \
    --to=cyd@stupidchicken.com \
    --cc=1495@emacsbugs.donarmstrong.com \
    --cc=dann@ics.uci.edu \
    --cc=emacs-devel@gnu.org \
    --cc=paul.r.ml@gmail.com \
    /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).