From unknown Fri Aug 15 16:57:45 2025 X-Loop: help-debbugs@gnu.org Subject: bug#6758: 23.2; xterm.el: please provide an option to not discard input in terminal-init-xterm Resent-From: Jim Paris Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 29 Jul 2010 20:32:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 6758 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 6758@debbugs.gnu.org Cc: jim@jtan.com X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.128043546924967 (code B ref -1); Thu, 29 Jul 2010 20:32:02 +0000 Received: (at submit) by debbugs.gnu.org; 29 Jul 2010 20:31:09 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OeZky-0006Ue-Ul for submit@debbugs.gnu.org; Thu, 29 Jul 2010 16:31:09 -0400 Received: from mx10.gnu.org ([199.232.76.166]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OeZkw-0006UH-A1 for submit@debbugs.gnu.org; Thu, 29 Jul 2010 16:31:07 -0400 Received: from lists.gnu.org ([199.232.76.165]:36149) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1OeZlA-0002yn-3c for submit@debbugs.gnu.org; Thu, 29 Jul 2010 16:31:20 -0400 Received: from [140.186.70.92] (port=33644 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OeZl7-0004Re-U1 for bug-gnu-emacs@gnu.org; Thu, 29 Jul 2010 16:31:19 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_RP_MATCHES_RCVD autolearn=unavailable version=3.3.1 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OeZW5-0007bp-5J for bug-gnu-emacs@gnu.org; Thu, 29 Jul 2010 16:15:46 -0400 Received: from jim.sh ([75.150.123.25]:52820 helo=psychosis.jim.sh) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OeZW5-0007bd-1w for bug-gnu-emacs@gnu.org; Thu, 29 Jul 2010 16:15:45 -0400 Received: from psychosis.jim.sh (localhost [127.0.0.1]) by psychosis.jim.sh (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id o6TKFgEY031590 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 29 Jul 2010 16:15:42 -0400 Received: (from jim@localhost) by psychosis.jim.sh (8.14.3/8.14.3/Submit) id o6TKFgPB031588; Thu, 29 Jul 2010 16:15:42 -0400 From: Jim Paris Date: Thu, 29 Jul 2010 16:15:42 -0400 Message-ID: <87r5im11u9.fsf@psychosis.jim.sh> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: clamav-milter 0.96 at psychosis X-Virus-Status: Clean X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Spam-Score: -6.6 (------) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.6 (------) This bug report will be sent to the Free Software Foundation, not to your local site managers! Please write in English if possible, because the Emacs maintainers usually do not have translators to read other languages for them. Your bug report will be posted to the bug-gnu-emacs@gnu.org mailing list, and to the gnu.emacs.bug news group. Please describe exactly what actions triggered the bug and the precise symptoms of the bug. If you can, give a recipe starting from `emacs -Q': Since upgrading to emacs-23, the terminal-init-xterm function in term/xterm.el performs a "discard-input" followed by a couple of xterm queries. You can see the effect of this in the "recent input" line below -- all I did was start emacs and do M-x report-bug, the preceding input was generated by the xterm in response to terminal-init-xterm's queries. This causes several problems when I start emacs in a terminal: - Everything that I type while emacs is still loading gets discarded. This problem is more common than you might initially think, because I very frequently load emacs and immediately hit C-s to search for something. Now, the C-s gets lost and my search terms go into the buffer instead. To reproduce this, just start emacs (preferably on a slow machine, or one with delays in ~/.emacs, for example) and start typing before emacs has finished loading. Everything typed is lost. - There are race conditions here. If I'm typing when this query-response happens, my typing is discarded by terminal-init-xterm, and the actual xterm response gets inserted directly into my buffer as if I had typed it. Since I type quickly, I see this quite frequently: I load emacs, start typing, and the buffer ends up with "0;251;0c" rather than what I had typed. This one is harder to reproduce, but it is not difficult for me if I just run "emacs -nw" from the commandline and quickly hit "asdfasdf" while it's loading. I understand that the modify-other-keys feature is useful, but this makes emacs-23 difficult to use. Can an option be provided to disable these probes? Maybe we can just skip the discard-input and query/response if the user provides, say, predetermined "xterm-version" and "xterm-background-color" variables in their ~/.emacs? That seems to be the quickest and easiest approach, although it requires user intervention to work around the issue. I can also imagine a more complete fix that would involve not flushing the input buffer, and interpreting the Xterm responses in a more asynchronous fashion: - Don't discard input - Send the \e[>0c probe - Allow input into the buffer as usual, but for the next few seconds, interpret \e[>0;251;0c responses and perform (xterm-turn-on-modify-other-keys) etc. as necessary. -jim If Emacs crashed, and you have the Emacs process in the gdb debugger, please include the output from the following gdb commands: `bt full' and `xbacktrace'. For information about debugging Emacs, please read the file /usr/share/emacs/23.2/etc/DEBUG. In GNU Emacs 23.2.1 (x86_64-pc-linux-gnu, GTK+ Version 2.20.1) of 2010-05-16 on barber, modified by Debian configured using `configure '--build' 'x86_64-linux-gnu' '--build' 'x86_64-linux-gnu' '--prefix=/usr' '--sharedstatedir=/var/lib' '--libexecdir=/usr/lib' '--localstatedir=/var/lib' '--infodir=/usr/share/info' '--mandir=/usr/share/man' '--with-pop=yes' '--enable-locallisppath=/etc/emacs23:/etc/emacs:/usr/local/share/emacs/23.2/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/23.2/site-lisp:/usr/share/emacs/site-lisp:/usr/share/emacs/23.2/leim' '--with-x=yes' '--with-x-toolkit=gtk' '--with-toolkit-scroll-bars' 'build_alias=x86_64-linux-gnu' 'CFLAGS=-DDEBIAN -g -O2' 'LDFLAGS=-g' 'CPPFLAGS='' Important settings: value of $LC_ALL: nil value of $LC_COLLATE: nil value of $LC_CTYPE: en_US.UTF-8 value of $LC_MESSAGES: en_US value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: POSIX value of $XMODIFIERS: nil locale-coding-system: utf-8-unix default enable-multibyte-characters: t Major mode: Text Minor modes in effect: tooltip-mode: t mouse-wheel-mode: t tool-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t auto-encryption-mode: t auto-compression-mode: t column-number-mode: t line-number-mode: t transient-mark-mode: t Recent input: ESC [ > 0 ; 2 5 1 ; 0 c ESC ] 1 1 ; r g b : 0 0 0 0 / 0 0 0 0 / 0 0 0 0 ESC \ ESC x r e p o r t TAB RE T Recent messages: Loading /etc/emacs/site-start.d/50namazu2.el (source)...done Loading /etc/emacs/site-start.d/50php-elisp.el (source)...done Loading /etc/emacs/site-start.d/50psvn.el (source)...done Loading /etc/emacs/site-start.d/51debian-el.el (source)...done Loading /etc/emacs/site-start.d/70jim.el (source)... Toggling menu-bar-mode off; better pass an explicit argument. Ready. Loading /etc/emacs/site-start.d/70jim.el (source)...done Loading quail/latin-ltx...done Ready. Load-path shadows: /usr/share/emacs/23.2/site-lisp/debian-startup hides /usr/share/emacs/site-lisp/debian-startup /usr/share/emacs23/site-lisp/easypg/epg hides /usr/share/emacs/23.2/lisp/epg /usr/share/emacs23/site-lisp/easypg/epa-mail hides /usr/share/emacs/23.2/lisp/epa-mail /usr/share/emacs23/site-lisp/easypg/epa-dired hides /usr/share/emacs/23.2/lisp/epa-dired /usr/share/emacs23/site-lisp/flim/sha1 hides /usr/share/emacs/23.2/lisp/sha1 /usr/share/emacs23/site-lisp/easypg/epa-file hides /usr/share/emacs/23.2/lisp/epa-file /usr/share/emacs23/site-lisp/emacs-goodies-el/ido hides /usr/share/emacs/23.2/lisp/ido /usr/share/emacs23/site-lisp/flim/md4 hides /usr/share/emacs/23.2/lisp/md4 /usr/share/emacs23/site-lisp/emacs-goodies-el/ibuffer hides /usr/share/emacs/23.2/lisp/ibuffer /usr/share/emacs23/site-lisp/emacs-goodies-el/wdired hides /usr/share/emacs/23.2/lisp/wdired /usr/share/emacs23/site-lisp/flim/hex-util hides /usr/share/emacs/23.2/lisp/hex-util /usr/share/emacs23/site-lisp/easypg/epg-config hides /usr/share/emacs/23.2/lisp/epg-config /usr/share/emacs23/site-lisp/easypg/epa hides /usr/share/emacs/23.2/lisp/epa /usr/share/emacs23/site-lisp/dictionaries-common/ispell hides /usr/share/emacs/23.2/lisp/textmodes/ispell /usr/share/emacs23/site-lisp/emacs-goodies-el/table hides /usr/share/emacs/23.2/lisp/textmodes/table /usr/share/emacs23/site-lisp/dictionaries-common/flyspell hides /usr/share/emacs/23.2/lisp/textmodes/flyspell /usr/share/emacs23/site-lisp/emacs-goodies-el/cfengine hides /usr/share/emacs/23.2/lisp/progmodes/cfengine /usr/share/emacs23/site-lisp/flim/ntlm hides /usr/share/emacs/23.2/lisp/net/ntlm /usr/share/emacs23/site-lisp/flim/hmac-def hides /usr/share/emacs/23.2/lisp/net/hmac-def /usr/share/emacs23/site-lisp/flim/sasl hides /usr/share/emacs/23.2/lisp/net/sasl /usr/share/emacs23/site-lisp/emacs-goodies-el/newsticker hides /usr/share/emacs/23.2/lisp/net/newsticker /usr/share/emacs23/site-lisp/flim/sasl-digest hides /usr/share/emacs/23.2/lisp/net/sasl-digest /usr/share/emacs23/site-lisp/flim/hmac-md5 hides /usr/share/emacs/23.2/lisp/net/hmac-md5 /usr/share/emacs23/site-lisp/flim/sasl-ntlm hides /usr/share/emacs/23.2/lisp/net/sasl-ntlm /usr/share/emacs23/site-lisp/flim/sasl-cram hides /usr/share/emacs/23.2/lisp/net/sasl-cram /usr/share/emacs23/site-lisp/latex-cjk-thai/thai-word hides /usr/share/emacs/23.2/lisp/language/thai-word Features: (shadow sort mail-extr message sendmail regexp-opt ecomplete rfc822 mml mml-sec password-cache mm-decode mm-bodies mm-encode mailcap mail-parse rfc2231 rfc2047 rfc2045 qp ietf-drums mailabbrev nnheader gnus-util netrc time-date mm-util mail-prsvr gmm-utils wid-edit mailheader canlock sha1 sha1-el hex-util hashcash mail-utils warnings emacsbug quail help-mode easymenu view debian-el debian-el-loaddefs path-util byte-opt bytecomp byte-compile advice help-fns advice-preload poe pym static apel-ver product emacs-goodies-el emacs-goodies-custom emacs-goodies-loaddefs epa-setup epa-file epa derived epg epg-config epg-package-info dpkg-dev-el dpkg-dev-el-loaddefs tooltip ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd font-setting tool-bar dnd fontset image fringe lisp-mode register page menu-bar rfn-eshadow timer select scroll-bar mldrag mouse jit-lock font-lock syntax facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev loaddefs button minibuffer faces cus-face files text-properties overlay md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote make-network-process dbusbind system-font-setting font-render-setting gtk x-toolkit x multi-tty emacs) From unknown Fri Aug 15 16:57:45 2025 X-Loop: help-debbugs@gnu.org Subject: bug#6758: 23.2; xterm.el: please provide an option to not discard input in terminal-init-xterm Resent-From: Stefan Monnier Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 01 Aug 2010 23:03:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 6758 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Jim Paris Cc: 6758@debbugs.gnu.org Received: via spool by 6758-submit@debbugs.gnu.org id=B6758.128070376623313 (code B ref 6758); Sun, 01 Aug 2010 23:03:02 +0000 Received: (at 6758) by debbugs.gnu.org; 1 Aug 2010 23:02:46 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OfhYL-00063y-PR for submit@debbugs.gnu.org; Sun, 01 Aug 2010 19:02:45 -0400 Received: from impaqm3.telefonica.net ([213.4.138.3]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OfhYJ-00063r-KY for 6758@debbugs.gnu.org; Sun, 01 Aug 2010 19:02:44 -0400 Received: from IMPmailhost3.adm.correo ([10.20.102.124]) by IMPaqm3.telefonica.net with bizsmtp id pAbP1e0102h2L9m3PB345c; Mon, 02 Aug 2010 01:03:04 +0200 Received: from ceviche.home ([83.61.38.247]) by IMPmailhost3.adm.correo with BIZ IMP id pB321e0025KwfZf1jB33TV; Mon, 02 Aug 2010 01:03:04 +0200 X-Brightmail-Tracker: AAAAAA== X-TE-authinfo: authemail="monnier$movistar.es" |auth_email="monnier@movistar.es" X-TE-AcuTerraCos: auth_cuTerraCos="cosuitnetc01" Received: by ceviche.home (Postfix, from userid 20848) id 547C366140; Mon, 2 Aug 2010 01:03:02 +0200 (CEST) From: Stefan Monnier Message-ID: References: <87r5im11u9.fsf@psychosis.jim.sh> Date: Mon, 02 Aug 2010 01:03:02 +0200 In-Reply-To: <87r5im11u9.fsf@psychosis.jim.sh> (Jim Paris's message of "Thu, 29 Jul 2010 16:15:42 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -0.8 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.1 (-) > I can also imagine a more complete fix that would involve not flushing > the input buffer, and interpreting the Xterm responses in a more > asynchronous fashion: > - Don't discard input > - Send the \e[>0c probe > - Allow input into the buffer as usual, but for the next few seconds, > interpret \e[>0;251;0c responses and perform > (xterm-turn-on-modify-other-keys) etc. as necessary. Time-dependent processing is considered brittle (especially when working remotely via something like SSH), so we prefer to avoid it. Especially since coding it right could prove pretty darn tricky. OTOH, I thought we had agreed that we need to add a configuration variable xterm-turn-on-modify-other-keys which could be set to t or nil to force the modifyOtherKeys feature of Xterm ON or OFF without first checking whether the current xterm indeed supports it or not. Its default value would be `auto', which would first check for support and then turn it ON if applicable. Since the "discard input" is needed for the check, this would solve your problem. Now, I don't see such a variable, so either I misremeber, or the patch was never written, or never committed, ... Stefan From unknown Fri Aug 15 16:57:45 2025 X-Loop: help-debbugs@gnu.org Subject: bug#6758: 23.2; xterm.el: please provide an option to not discard input in terminal-init-xterm Resent-From: Johan =?UTF-8?Q?Bockg=C3=A5rd?= Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 02 Aug 2010 20:39:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 6758 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Stefan Monnier Cc: 6758@debbugs.gnu.org, Jim Paris Received: via spool by 6758-submit@debbugs.gnu.org id=B6758.12807815064157 (code B ref 6758); Mon, 02 Aug 2010 20:39:01 +0000 Received: (at 6758) by debbugs.gnu.org; 2 Aug 2010 20:38:26 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Og1mE-000150-8i for submit@debbugs.gnu.org; Mon, 02 Aug 2010 16:38:26 -0400 Received: from smtprelay-h31.telenor.se ([213.150.131.4]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Og1mC-00014o-DV for 6758@debbugs.gnu.org; Mon, 02 Aug 2010 16:38:25 -0400 Received: from ipb1.telenor.se (ipb1.telenor.se [195.54.127.164]) by smtprelay-h31.telenor.se (Postfix) with ESMTP id DFDB5E9536 for <6758@debbugs.gnu.org>; Mon, 2 Aug 2010 22:38:47 +0200 (CEST) X-SENDER-IP: [85.228.201.87] X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AhU0AAnKVkxV5MlXPGdsb2JhbACgAgwBAQEBNS3FSoU5BIgh X-IronPort-AV: E=Sophos;i="4.55,305,1278280800"; d="scan'208";a="113959548" Received: from c-57c9e455.04-211-6c6b701.cust.bredbandsbolaget.se (HELO muon.localdomain) ([85.228.201.87]) by ipb1.telenor.se with ESMTP; 02 Aug 2010 22:38:47 +0200 Received: by muon.localdomain (Postfix, from userid 1000) id B36F24841A0; Mon, 2 Aug 2010 22:38:43 +0200 (CEST) From: Johan =?UTF-8?Q?Bockg=C3=A5rd?= References: <87r5im11u9.fsf@psychosis.jim.sh> Mail-Copies-To: never Date: Mon, 02 Aug 2010 22:38:43 +0200 In-Reply-To: (Stefan Monnier's message of "Mon, 02 Aug 2010 01:03:02 +0200") Message-ID: <8739uwrbqk.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -2.9 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.8 (--) Stefan Monnier writes: > OTOH, I thought we had agreed that we need to add a configuration > variable xterm-turn-on-modify-other-keys which could be set to t or nil > to force the modifyOtherKeys feature of Xterm ON or OFF without first > checking whether the current xterm indeed supports it or not. > Its default value would be `auto', which would first check for support > and then turn it ON if applicable. > Since the "discard input" is needed for the check, this would solve > your problem. > > Now, I don't see such a variable, so either I misremeber, or the patch > was never written, or never committed, ... http://lists.gnu.org/archive/html/emacs-devel/2009-08/msg01276.html From unknown Fri Aug 15 16:57:45 2025 X-Loop: help-debbugs@gnu.org Subject: bug#6758: 23.2; xterm.el: please provide an option to not discard input in terminal-init-xterm References: <87r5im11u9.fsf@psychosis.jim.sh> Resent-From: Jim Paris Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 02 Aug 2010 21:00:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 6758 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Stefan Monnier , Johan =?UTF-8?Q?Bockg=C3=A5rd?= Cc: 6758@debbugs.gnu.org Received: via spool by 6758-submit@debbugs.gnu.org id=B6758.12807827787150 (code B ref 6758); Mon, 02 Aug 2010 21:00:03 +0000 Received: (at 6758) by debbugs.gnu.org; 2 Aug 2010 20:59:38 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Og26k-0001rH-7g for submit@debbugs.gnu.org; Mon, 02 Aug 2010 16:59:38 -0400 Received: from jim.sh ([75.150.123.25] helo=psychosis.jim.sh) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Og26h-0001rB-M1 for 6758@debbugs.gnu.org; Mon, 02 Aug 2010 16:59:36 -0400 Received: from psychosis.jim.sh (localhost [127.0.0.1]) by psychosis.jim.sh (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id o72Kxxkn003012 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 2 Aug 2010 16:59:59 -0400 Received: (from jim@localhost) by psychosis.jim.sh (8.14.3/8.14.3/Submit) id o72KxxIv003011; Mon, 2 Aug 2010 16:59:59 -0400 Date: Mon, 2 Aug 2010 16:59:59 -0400 From: Jim Paris Message-ID: <20100802205959.GA1974@psychosis.jim.sh> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8739uwrbqk.fsf@gnu.org> User-Agent: Mutt/1.5.20 (2009-06-14) X-Virus-Scanned: clamav-milter 0.96 at psychosis X-Virus-Status: Clean X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -0.9 (/) Stefan Monnier wrote: > > I can also imagine a more complete fix that would involve not flushing > > the input buffer, and interpreting the Xterm responses in a more > > asynchronous fashion: > > - Don't discard input > > - Send the \e[>0c probe > > - Allow input into the buffer as usual, but for the next few seconds, > > interpret \e[>0;251;0c responses and perform > > (xterm-turn-on-modify-other-keys) etc. as necessary. > > Time-dependent processing is considered brittle (especially when > working remotely via something like SSH), so we prefer to avoid it. > Especially since coding it right could prove pretty darn tricky. Forget the time-dependent part of what I said, let's just send the query and handle the response whenever it happens to come in. See the below patch. This fixes everything -- it still detects both modifyOtherKeys and the background color, but doesn't require flushing input or rely on any timeouts at all, unlike the existing code. And there's nothing tricky. What do you think? > OTOH, I thought we had agreed that we need to add a configuration > variable xterm-turn-on-modify-other-keys which could be set to t or nil > to force the modifyOtherKeys feature of Xterm ON or OFF without first > checking whether the current xterm indeed supports it or not. > Its default value would be `auto', which would first check for support > and then turn it ON if applicable. This may still be useful for people who don't want any queries sent to their terminal. -jim --- xterm.el-orig 2010-04-03 18:26:04.000000000 -0400 +++ xterm.el 2010-08-02 16:51:45.000000000 -0400 @@ -440,6 +440,65 @@ ;; List of terminals for which modify-other-keys has been turned on. (defvar xterm-modify-other-keys-terminal-list nil) +(defun xterm-osc-translate (event) + "Read and handle a Operating System Controls response" + (let* ((str "") + (chr nil) + (recompute-faces nil)) + + ;; The reply should be of the form: \e ] 11 ; rgb: NUMBER1 / NUMBER2 / NUMBER3 \e \\ + (while (not (equal (setq chr (read-char)) ?\\)) + (setq str (concat str (string chr)))) + + (when (string-match "rgb:\\([a-f0-9]+\\)/\\([a-f0-9]+\\)/\\([a-f0-9]+\\)" str) + (setq recompute-faces + (xterm-maybe-set-dark-background-mode + (string-to-number (match-string 1 str) 16) + (string-to-number (match-string 2 str) 16) + (string-to-number (match-string 3 str) 16)))) + + (when recompute-faces + (tty-set-up-initial-frame-faces)) + + "")) + +(defun xterm-secondary-da-translate (event) + "Read and handle a Secondary Device Attributes response" + (let* ((str "") + (chr nil) + version) + + ;; The reply should be of the form: \e [ > NUMBER1 ; NUMBER2 ; NUMBER3 c + (while (not (equal (setq chr (read-char)) ?c)) + (setq str (concat str (string chr)))) + + (when (string-match "0;\\([0-9]+\\);0" str) + (setq version (string-to-number + (substring str (match-beginning 1) (match-end 1)))) + ;; NUMBER2 is the xterm version number, look for something + ;; greater than 216, the version when modifyOtherKeys was + ;; introduced. + (when (>= version 216) + ;; Make sure that the modifyOtherKeys state is restored when + ;; suspending, resuming and exiting. + (add-hook 'suspend-hook 'xterm-turn-off-modify-other-keys) + (add-hook 'suspend-resume-hook 'xterm-turn-on-modify-other-keys) + (add-hook 'kill-emacs-hook 'xterm-remove-modify-other-keys) + (add-hook 'delete-terminal-functions 'xterm-remove-modify-other-keys) + ;; Add the selected frame to the list of frames that + ;; need to deal with modify-other-keys. + (push (frame-terminal (selected-frame)) + xterm-modify-other-keys-terminal-list) + (xterm-turn-on-modify-other-keys)) + + ;; xterm version 235 supports reporting the background + ;; color, maybe earlier versions do too... + (when (>= version 235) + (define-key input-decode-map "\e]11;" 'xterm-osc-translate) + (send-string-to-terminal "\e]11;?\e\\"))) + + "")) + (defun terminal-init-xterm () "Terminal initialization function for xterm." ;; rxvt terminals sometimes set the TERM variable to "xterm", but @@ -469,71 +528,12 @@ ;; C-. C-, etc. ;; To do that we need to find out if the current terminal supports ;; modifyOtherKeys. At this time only xterm does. - (let ((coding-system-for-read 'binary) - (chr nil) - (str nil) - (recompute-faces nil) - version) - ;; Pending input can be mistakenly returned by the calls to - ;; read-event below. Discard it. - (discard-input) - ;; Try to find out the type of terminal by sending a "Secondary - ;; Device Attributes (DA)" query. - (send-string-to-terminal "\e[>0c") - - ;; The reply should be of the form: \e [ > NUMBER1 ; NUMBER2 ; NUMBER3 c - ;; If the timeout is completely removed for read-event, this - ;; might hang for terminals that pretend to be xterm, but don't - ;; respond to this escape sequence. RMS' opinion was to remove - ;; it completely. That might be right, but let's first try to - ;; see if by using a longer timeout we get rid of most issues. - (when (equal (read-event nil nil 2) ?\e) - (when (equal (read-event nil nil 2) ?\[) - (while (not (equal (setq chr (read-event nil nil 2)) ?c)) - (setq str (concat str (string chr)))) - (when (string-match ">0;\\([0-9]+\\);0" str) - (setq version (string-to-number - (substring str (match-beginning 1) (match-end 1)))) - ;; xterm version 242 supports reporting the background - ;; color, maybe earlier versions do too... - (when (>= version 242) - (send-string-to-terminal "\e]11;?\e\\") - (when (equal (read-event nil nil 2) ?\e) - (when (equal (read-event nil nil 2) ?\]) - (setq str "") - (while (not (equal (setq chr (read-event nil nil 2)) ?\\)) - (setq str (concat str (string chr)))) - (when (string-match "11;rgb:\\([a-f0-9]+\\)/\\([a-f0-9]+\\)/\\([a-f0-9]+\\)" str) - (setq recompute-faces - (xterm-maybe-set-dark-background-mode - (string-to-number (match-string 1 str) 16) - (string-to-number (match-string 2 str) 16) - (string-to-number (match-string 3 str) 16))))))) - ;; NUMBER2 is the xterm version number, look for something - ;; greater than 216, the version when modifyOtherKeys was - ;; introduced. - (when (>= version 216) - ;; Make sure that the modifyOtherKeys state is restored when - ;; suspending, resuming and exiting. - (add-hook 'suspend-hook 'xterm-turn-off-modify-other-keys) - (add-hook 'suspend-resume-hook 'xterm-turn-on-modify-other-keys) - (add-hook 'kill-emacs-hook 'xterm-remove-modify-other-keys) - (add-hook 'delete-terminal-functions 'xterm-remove-modify-other-keys) - ;; Add the selected frame to the list of frames that - ;; need to deal with modify-other-keys. - (push (frame-terminal (selected-frame)) - xterm-modify-other-keys-terminal-list) - (xterm-turn-on-modify-other-keys)) - - ;; Recompute faces here in case the background mode was - ;; set to dark. We used to call - ;; `tty-set-up-initial-frame-faces' only once, but that - ;; caused the light background faces to be computed - ;; incorrectly. See: - ;; http://permalink.gmane.org/gmane.emacs.devel/119627 - (when recompute-faces - (tty-set-up-initial-frame-faces)))))) + ;; Try to find out the type of terminal by sending a "Secondary + ;; Device Attributes (DA)" query. + (define-key input-decode-map "\e[>" 'xterm-secondary-da-translate) + (send-string-to-terminal "\e[>0c") + (run-hooks 'terminal-init-xterm-hook)) ;; Set up colors, for those versions of xterm that support it. From unknown Fri Aug 15 16:57:45 2025 X-Loop: help-debbugs@gnu.org Subject: bug#6758: 23.2; xterm.el: please provide an option to not discard input in terminal-init-xterm Resent-From: Andreas Schwab Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 02 Aug 2010 21:28:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 6758 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Jim Paris Cc: 6758@debbugs.gnu.org, Johan, Stefan Monnier , =?UTF-8?Q?=C3=A5rd?= Received: via spool by 6758-submit@debbugs.gnu.org id=B6758.12807844457858 (code B ref 6758); Mon, 02 Aug 2010 21:28:02 +0000 Received: (at 6758) by debbugs.gnu.org; 2 Aug 2010 21:27:25 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Og2Xc-00022h-MX for submit@debbugs.gnu.org; Mon, 02 Aug 2010 17:27:25 -0400 Received: from mail-out.m-online.net ([212.18.0.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Og2Xa-00022c-Sn for 6758@debbugs.gnu.org; Mon, 02 Aug 2010 17:27:23 -0400 Received: from frontend1.mail.m-online.net (unknown [192.168.8.180]) by mail-out.m-online.net (Postfix) with ESMTP id 6ACF11C002A7; Mon, 2 Aug 2010 23:27:46 +0200 (CEST) Received: from igel.home (ppp-88-217-106-57.dynamic.mnet-online.de [88.217.106.57]) by mail.mnet-online.de (Postfix) with ESMTP id 3DFF21C00197; Mon, 2 Aug 2010 23:27:46 +0200 (CEST) Received: by igel.home (Postfix, from userid 501) id E2797CA297; Mon, 2 Aug 2010 23:27:45 +0200 (CEST) From: Andreas Schwab References: <87r5im11u9.fsf@psychosis.jim.sh> <20100802205959.GA1974@psychosis.jim.sh> X-Yow: Hold the MAYO & pass the COSMIC AWARENESS... Date: Mon, 02 Aug 2010 23:27:45 +0200 In-Reply-To: <20100802205959.GA1974@psychosis.jim.sh> (Jim Paris's message of "Mon, 2 Aug 2010 16:59:59 -0400") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -2.6 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) Jim Paris writes: > + ;; The reply should be of the form: \e ] 11 ; rgb: NUMBER1 / NUMBER2 / NUMBER3 \e \\ > + (while (not (equal (setq chr (read-char)) ?\\)) > + (setq str (concat str (string chr)))) At least this loop needs to have a timeout, in case the terminator character gets lost for whatever reason. > + ;; The reply should be of the form: \e [ > NUMBER1 ; NUMBER2 ; NUMBER3 c > + (while (not (equal (setq chr (read-char)) ?c)) > + (setq str (concat str (string chr)))) Likewise. (It isn't all that hard to type ESC [ > by accident). Andreas. -- Andreas Schwab, schwab@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different." From unknown Fri Aug 15 16:57:45 2025 X-Loop: help-debbugs@gnu.org Subject: bug#6758: 23.2; xterm.el: please provide an option to not discard input in terminal-init-xterm Resent-From: Jim Paris Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 02 Aug 2010 21:36:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 6758 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Andreas Schwab Cc: 6758@debbugs.gnu.org, Stefan Monnier , Johan =?UTF-8?Q?Bockg=C3=A5rd?= Received: via spool by 6758-submit@debbugs.gnu.org id=B6758.12807849578085 (code B ref 6758); Mon, 02 Aug 2010 21:36:02 +0000 Received: (at 6758) by debbugs.gnu.org; 2 Aug 2010 21:35:57 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Og2ft-00026M-3J for submit@debbugs.gnu.org; Mon, 02 Aug 2010 17:35:57 -0400 Received: from jim.sh ([75.150.123.25] helo=psychosis.jim.sh) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Og2fr-00026G-3i for 6758@debbugs.gnu.org; Mon, 02 Aug 2010 17:35:55 -0400 Received: from psychosis.jim.sh (localhost [127.0.0.1]) by psychosis.jim.sh (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id o72LaJgE008583 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 2 Aug 2010 17:36:19 -0400 Received: (from jim@localhost) by psychosis.jim.sh (8.14.3/8.14.3/Submit) id o72LaIEs008582; Mon, 2 Aug 2010 17:36:18 -0400 Date: Mon, 2 Aug 2010 17:36:18 -0400 From: Jim Paris Message-ID: <20100802213618.GA7767@psychosis.jim.sh> References: <87r5im11u9.fsf@psychosis.jim.sh> <20100802205959.GA1974@psychosis.jim.sh> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) X-Virus-Scanned: clamav-milter 0.96 at psychosis X-Virus-Status: Clean X-Spam-Score: -2.4 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.5 (--) Andreas Schwab wrote: > Jim Paris writes: > > > + ;; The reply should be of the form: \e ] 11 ; rgb: NUMBER1 / NUMBER2 / NUMBER3 \e \\ > > + (while (not (equal (setq chr (read-char)) ?\\)) > > + (setq str (concat str (string chr)))) > > At least this loop needs to have a timeout, in case the terminator > character gets lost for whatever reason. > > > + ;; The reply should be of the form: \e [ > NUMBER1 ; NUMBER2 ; NUMBER3 c > > + (while (not (equal (setq chr (read-char)) ?c)) > > + (setq str (concat str (string chr)))) > > Likewise. (It isn't all that hard to type ESC [ > by accident). Ok, (read-char) can be replaced with (read-event nil nil 2). There may also need to be a (let (coding-system-for-read 'binary)) in there somewhere -- I'm really not familiar with emacs programming, this is mostly just based on other code I've found (like xt-mouse.el) -jim From unknown Fri Aug 15 16:57:45 2025 X-Loop: help-debbugs@gnu.org Subject: bug#6758: 23.2; xterm.el: please provide an option to not discard input in terminal-init-xterm Resent-From: Stefan Monnier Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 02 Aug 2010 22:21:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 6758 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Jim Paris Cc: 6758@debbugs.gnu.org, Johan =?UTF-8?Q?Bockg=C3=A5rd?= Received: via spool by 6758-submit@debbugs.gnu.org id=B6758.128078765011749 (code B ref 6758); Mon, 02 Aug 2010 22:21:02 +0000 Received: (at 6758) by debbugs.gnu.org; 2 Aug 2010 22:20:50 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Og3NK-00033S-N5 for submit@debbugs.gnu.org; Mon, 02 Aug 2010 18:20:50 -0400 Received: from impaqm2.telefonica.net ([213.4.138.2]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Og3NJ-00033L-53 for 6758@debbugs.gnu.org; Mon, 02 Aug 2010 18:20:49 -0400 Received: from IMPmailhost4.adm.correo ([10.20.102.125]) by IMPaqm2.telefonica.net with bizsmtp id paAo1e02Z2iL0W23MaMCMx; Tue, 03 Aug 2010 00:21:12 +0200 Received: from ceviche.home ([83.61.38.247]) by IMPmailhost4.adm.correo with BIZ IMP id paM91e0035KwfZf1kaMAmk; Tue, 03 Aug 2010 00:21:12 +0200 X-Brightmail-Tracker: AAAAAA== X-TE-authinfo: authemail="monnier$movistar.es" |auth_email="monnier@movistar.es" X-TE-AcuTerraCos: auth_cuTerraCos="cosuitnetc01" Received: by ceviche.home (Postfix, from userid 20848) id 72AAB66125; Tue, 3 Aug 2010 00:21:09 +0200 (CEST) From: Stefan Monnier Message-ID: References: <20100802205959.GA1974@psychosis.jim.sh> Date: Tue, 03 Aug 2010 00:21:09 +0200 In-Reply-To: <20100802205959.GA1974@psychosis.jim.sh> (Jim Paris's message of "Mon, 2 Aug 2010 16:59:59 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -1.9 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) > Forget the time-dependent part of what I said, let's just send the > query and handle the response whenever it happens to come in. See > the below patch. This fixes everything -- it still detects both > modifyOtherKeys and the background color, but doesn't require flushing > input or rely on any timeouts at all, unlike the existing code. > And there's nothing tricky. What do you think? Looks pretty good from here, thank you. We may want to get rid of the "\e[>" (and "\e]11;") decode rules after they've been used, just in case (or better yet: make them more robust). Any objection? Stefan From unknown Fri Aug 15 16:57:45 2025 X-Loop: help-debbugs@gnu.org Subject: bug#6758: 23.2; xterm.el: please provide an option to not discard input in terminal-init-xterm Resent-From: Jim Paris Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 03 Aug 2010 20:15:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 6758 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Stefan Monnier Cc: 6758@debbugs.gnu.org, Johan =?UTF-8?Q?Bockg=C3=A5rd?= Received: via spool by 6758-submit@debbugs.gnu.org id=B6758.128086647417769 (code B ref 6758); Tue, 03 Aug 2010 20:15:02 +0000 Received: (at 6758) by debbugs.gnu.org; 3 Aug 2010 20:14:34 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OgNsf-0004cX-Bv for submit@debbugs.gnu.org; Tue, 03 Aug 2010 16:14:33 -0400 Received: from jim.sh ([75.150.123.25] helo=psychosis.jim.sh) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OgNsc-0004cS-Nz for 6758@debbugs.gnu.org; Tue, 03 Aug 2010 16:14:31 -0400 Received: from psychosis.jim.sh (localhost [127.0.0.1]) by psychosis.jim.sh (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id o73KEvYZ008614 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 3 Aug 2010 16:14:57 -0400 Received: (from jim@localhost) by psychosis.jim.sh (8.14.3/8.14.3/Submit) id o73KEuJM008613; Tue, 3 Aug 2010 16:14:56 -0400 Date: Tue, 3 Aug 2010 16:14:56 -0400 From: Jim Paris Message-ID: <20100803201456.GA8182@psychosis.jim.sh> References: <20100802205959.GA1974@psychosis.jim.sh> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) X-Virus-Scanned: clamav-milter 0.96 at psychosis X-Virus-Status: Clean X-Spam-Score: -1.2 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.3 (--) Stefan Monnier wrote: > > Forget the time-dependent part of what I said, let's just send the > > query and handle the response whenever it happens to come in. See > > the below patch. This fixes everything -- it still detects both > > modifyOtherKeys and the background color, but doesn't require flushing > > input or rely on any timeouts at all, unlike the existing code. > > And there's nothing tricky. What do you think? > > Looks pretty good from here, thank you. > We may want to get rid of the "\e[>" (and "\e]11;") decode rules after > they've been used, just in case (or better yet: make them more > robust). > > Any objection? I found a problem: the Mac OS X terminal sets TERM=xterm-color, but it responds to the "Secondary DA" query as if it were a "Primary DA" query. Instead of a response like xterm's "\e[>0;253;0c", it sends "\e[?1;2c". The below patch accounts for this. It also adds the 2-second timeout when reading responses, and unsets the decode rules once they're unused. -jim --- xterm.el-orig 2010-04-03 18:26:04.000000000 -0400 +++ xterm.el 2010-08-03 16:05:49.000000000 -0400 @@ -440,6 +440,86 @@ ;; List of terminals for which modify-other-keys has been turned on. (defvar xterm-modify-other-keys-terminal-list nil) +(defun xterm-osc-translate (event) + "Read and handle a Operating System Controls response" + (let* ((str "") + (chr nil) + (recompute-faces nil)) + + ;; The reply should be of the form: \e ] 11 ; rgb: NUMBER1 / NUMBER2 / NUMBER3 \e \\ + (while (not (equal (setq chr (read-event nil nil 2)) ?\\)) + (setq str (concat str (string chr)))) + + (when (string-match "rgb:\\([a-f0-9]+\\)/\\([a-f0-9]+\\)/\\([a-f0-9]+\\)" str) + (setq recompute-faces + (xterm-maybe-set-dark-background-mode + (string-to-number (match-string 1 str) 16) + (string-to-number (match-string 2 str) 16) + (string-to-number (match-string 3 str) 16)))) + + (when recompute-faces + (tty-set-up-initial-frame-faces)) + + ;; We no longer expect the OSC response + (define-key input-decode-map "\e]11;" nil) + "")) + +(defun xterm-primary-da-translate (event) + "Read and handle a Primary Device Attributes response" + (let* ((str "") + (chr nil)) + + ;; The reply should be of the form: \e [ ? Pd c + (while (not (equal (setq chr (read-event nil nil 2)) ?c)) + (setq str (concat str (string chr)))) + + ;; No need to do anything with this response. + + ;; Undefine both DA responses, as we don't expect either anymore + (define-key input-decode-map "\e[?" nil) + (define-key input-decode-map "\e[>" nil) + "")) + +(defun xterm-secondary-da-translate (event) + "Read and handle a Secondary Device Attributes response" + (let* ((str "") + (chr nil) + version) + + ;; The reply should be of the form: \e [ > NUMBER1 ; NUMBER2 ; NUMBER3 c + (while (not (equal (setq chr (read-event nil nil 2)) ?c)) + (setq str (concat str (string chr)))) + + (when (string-match "0;\\([0-9]+\\);0" str) + (setq version (string-to-number + (substring str (match-beginning 1) (match-end 1)))) + ;; NUMBER2 is the xterm version number, look for something + ;; greater than 216, the version when modifyOtherKeys was + ;; introduced. + (when (>= version 216) + ;; Make sure that the modifyOtherKeys state is restored when + ;; suspending, resuming and exiting. + (add-hook 'suspend-hook 'xterm-turn-off-modify-other-keys) + (add-hook 'suspend-resume-hook 'xterm-turn-on-modify-other-keys) + (add-hook 'kill-emacs-hook 'xterm-remove-modify-other-keys) + (add-hook 'delete-terminal-functions 'xterm-remove-modify-other-keys) + ;; Add the selected frame to the list of frames that + ;; need to deal with modify-other-keys. + (push (frame-terminal (selected-frame)) + xterm-modify-other-keys-terminal-list) + (xterm-turn-on-modify-other-keys)) + + ;; xterm version 235 supports reporting the background + ;; color, maybe earlier versions do too... + (when (>= version 235) + (define-key input-decode-map "\e]11;" 'xterm-osc-translate) + (send-string-to-terminal "\e]11;?\e\\"))) + + ;; Undefine both DA responses, as we don't expect either anymore + (define-key input-decode-map "\e[?" nil) + (define-key input-decode-map "\e[>" nil) + "")) + (defun terminal-init-xterm () "Terminal initialization function for xterm." ;; rxvt terminals sometimes set the TERM variable to "xterm", but @@ -469,71 +549,15 @@ ;; C-. C-, etc. ;; To do that we need to find out if the current terminal supports ;; modifyOtherKeys. At this time only xterm does. - (let ((coding-system-for-read 'binary) - (chr nil) - (str nil) - (recompute-faces nil) - version) - ;; Pending input can be mistakenly returned by the calls to - ;; read-event below. Discard it. - (discard-input) - ;; Try to find out the type of terminal by sending a "Secondary - ;; Device Attributes (DA)" query. - (send-string-to-terminal "\e[>0c") - - ;; The reply should be of the form: \e [ > NUMBER1 ; NUMBER2 ; NUMBER3 c - ;; If the timeout is completely removed for read-event, this - ;; might hang for terminals that pretend to be xterm, but don't - ;; respond to this escape sequence. RMS' opinion was to remove - ;; it completely. That might be right, but let's first try to - ;; see if by using a longer timeout we get rid of most issues. - (when (equal (read-event nil nil 2) ?\e) - (when (equal (read-event nil nil 2) ?\[) - (while (not (equal (setq chr (read-event nil nil 2)) ?c)) - (setq str (concat str (string chr)))) - (when (string-match ">0;\\([0-9]+\\);0" str) - (setq version (string-to-number - (substring str (match-beginning 1) (match-end 1)))) - ;; xterm version 242 supports reporting the background - ;; color, maybe earlier versions do too... - (when (>= version 242) - (send-string-to-terminal "\e]11;?\e\\") - (when (equal (read-event nil nil 2) ?\e) - (when (equal (read-event nil nil 2) ?\]) - (setq str "") - (while (not (equal (setq chr (read-event nil nil 2)) ?\\)) - (setq str (concat str (string chr)))) - (when (string-match "11;rgb:\\([a-f0-9]+\\)/\\([a-f0-9]+\\)/\\([a-f0-9]+\\)" str) - (setq recompute-faces - (xterm-maybe-set-dark-background-mode - (string-to-number (match-string 1 str) 16) - (string-to-number (match-string 2 str) 16) - (string-to-number (match-string 3 str) 16))))))) - ;; NUMBER2 is the xterm version number, look for something - ;; greater than 216, the version when modifyOtherKeys was - ;; introduced. - (when (>= version 216) - ;; Make sure that the modifyOtherKeys state is restored when - ;; suspending, resuming and exiting. - (add-hook 'suspend-hook 'xterm-turn-off-modify-other-keys) - (add-hook 'suspend-resume-hook 'xterm-turn-on-modify-other-keys) - (add-hook 'kill-emacs-hook 'xterm-remove-modify-other-keys) - (add-hook 'delete-terminal-functions 'xterm-remove-modify-other-keys) - ;; Add the selected frame to the list of frames that - ;; need to deal with modify-other-keys. - (push (frame-terminal (selected-frame)) - xterm-modify-other-keys-terminal-list) - (xterm-turn-on-modify-other-keys)) - - ;; Recompute faces here in case the background mode was - ;; set to dark. We used to call - ;; `tty-set-up-initial-frame-faces' only once, but that - ;; caused the light background faces to be computed - ;; incorrectly. See: - ;; http://permalink.gmane.org/gmane.emacs.devel/119627 - (when recompute-faces - (tty-set-up-initial-frame-faces)))))) + ;; Try to find out the type of terminal by sending a "Secondary + ;; Device Attributes (DA)" query. Some terminals (like OS X's + ;; Terminal.app) respond to this query as if it were a "Primary + ;; Device Attributes" query instead, so we should handle that too. + (define-key input-decode-map "\e[?" 'xterm-primary-da-translate) + (define-key input-decode-map "\e[>" 'xterm-secondary-da-translate) + (send-string-to-terminal "\e[>0c") + (run-hooks 'terminal-init-xterm-hook)) ;; Set up colors, for those versions of xterm that support it. From unknown Fri Aug 15 16:57:45 2025 X-Loop: help-debbugs@gnu.org Subject: bug#6758: 23.2; xterm.el: please provide an option to not discard input in terminal-init-xterm Resent-From: Jim Paris Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 24 Aug 2010 00:47:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 6758 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Stefan Monnier Cc: 6758@debbugs.gnu.org, Johan =?UTF-8?Q?Bockg=C3=A5rd?= Received: via spool by 6758-submit@debbugs.gnu.org id=B6758.128261080622815 (code B ref 6758); Tue, 24 Aug 2010 00:47:02 +0000 Received: (at 6758) by debbugs.gnu.org; 24 Aug 2010 00:46:46 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Onhf3-0005vw-Qo for submit@debbugs.gnu.org; Mon, 23 Aug 2010 20:46:46 -0400 Received: from jim.sh ([75.150.123.25] helo=psychosis.jim.sh) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Onhf2-0005vo-3p for 6758@debbugs.gnu.org; Mon, 23 Aug 2010 20:46:44 -0400 Received: from psychosis.jim.sh (localhost [127.0.0.1]) by psychosis.jim.sh (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id o7O0m2c9018660 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 23 Aug 2010 20:48:02 -0400 Received: (from jim@localhost) by psychosis.jim.sh (8.14.3/8.14.3/Submit) id o7O0m1NM018653; Mon, 23 Aug 2010 20:48:01 -0400 Date: Mon, 23 Aug 2010 20:48:01 -0400 From: Jim Paris Message-ID: <20100824004800.GA18600@psychosis.jim.sh> References: <20100802205959.GA1974@psychosis.jim.sh> <20100803201456.GA8182@psychosis.jim.sh> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100803201456.GA8182@psychosis.jim.sh> User-Agent: Mutt/1.5.20 (2009-06-14) X-Virus-Scanned: clamav-milter 0.96 at psychosis X-Virus-Status: Clean X-Spam-Score: -1.1 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.2 (--) Any thoughts on this patch? I've found further problems with doing aynchronous terminal queries: minibuffer prompts get aborted by the xterm response. For example, when opening up a large file: 1) Emacs loads and sends "\e[>0c" 2) Emacs prints the "File x is large (123MB), really open? (y or n)" prompt 3) Xterm sends the "\e[>0;253;0c" response, aborting the prompt Is there a way to make the (define-key input-decode-map "\e[?" nil) stuff take effect in the minibuffer too so the response can be properly handled? Or handle the xterm responses at a higher level so it doesn't matter where they get sent? Sigh, this whole terminal response stuff is a real mess and new failure modes keep popping up every month... I don't see how this can be enabled by default for anyone in its current form. -jim From unknown Fri Aug 15 16:57:45 2025 X-Loop: help-debbugs@gnu.org Subject: bug#6758: 23.2; xterm.el: please provide an option to not discard input in terminal-init-xterm Resent-From: Stefan Monnier Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 11 Sep 2010 14:07:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 6758 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Jim Paris Cc: 6758@debbugs.gnu.org, Johan =?UTF-8?Q?Bockg=C3=A5rd?= Received: via spool by 6758-submit@debbugs.gnu.org id=B6758.128421399510887 (code B ref 6758); Sat, 11 Sep 2010 14:07:02 +0000 Received: (at 6758) by debbugs.gnu.org; 11 Sep 2010 14:06:35 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OuQix-0002pY-5o for submit@debbugs.gnu.org; Sat, 11 Sep 2010 10:06:35 -0400 Received: from impaqm5.telefonica.net ([213.4.138.5]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OuQiv-0002pK-SB for 6758@debbugs.gnu.org; Sat, 11 Sep 2010 10:06:34 -0400 Received: from IMPmailhost4.adm.correo ([10.20.102.125]) by IMPaqm5.telefonica.net with bizsmtp id 5S8M1f01p2iL0W23RS8fzT; Sat, 11 Sep 2010 16:08:39 +0200 Received: from ceviche.home ([83.61.39.212]) by IMPmailhost4.adm.correo with BIZ IMP id 5S8e1f0054aeRwb1kS8eoD; Sat, 11 Sep 2010 16:08:39 +0200 X-Brightmail-Tracker: AAAAAA== X-TE-authinfo: authemail="monnier$movistar.es" |auth_email="monnier@movistar.es" X-TE-AcuTerraCos: auth_cuTerraCos="cosuitnetc01" Received: by ceviche.home (Postfix, from userid 20848) id 345AE660D2; Sat, 11 Sep 2010 16:08:38 +0200 (CEST) From: Stefan Monnier Message-ID: References: <20100802205959.GA1974@psychosis.jim.sh> <20100803201456.GA8182@psychosis.jim.sh> <20100824004800.GA18600@psychosis.jim.sh> Date: Sat, 11 Sep 2010 16:08:38 +0200 In-Reply-To: <20100824004800.GA18600@psychosis.jim.sh> (Jim Paris's message of "Mon, 23 Aug 2010 20:48:01 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.0 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.0 (--) > Any thoughts on this patch? > I've found further problems with doing aynchronous terminal queries: > minibuffer prompts get aborted by the xterm response. For example, > when opening up a large file: > 1) Emacs loads and sends "\e[>0c" > 2) Emacs prints the "File x is large (123MB), really open? (y or n)" prompt > 3) Xterm sends the "\e[>0;253;0c" response, aborting the prompt Indeed. But this one is "easy": y-or-n-p should use read-key rather than read-event, so that input-decode-map will be obeyed. Of course, that probably requires moving y-or-n-p from C to Elisp. Stefan From unknown Fri Aug 15 16:57:45 2025 X-Loop: help-debbugs@gnu.org Subject: bug#6758: 23.2; xterm.el: please provide an option to not discard input in terminal-init-xterm Resent-From: Stefan Monnier Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 11 Sep 2010 14:58:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 6758 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Jim Paris Cc: 6758@debbugs.gnu.org, Johan =?UTF-8?Q?Bockg=C3=A5rd?= Received: via spool by 6758-submit@debbugs.gnu.org id=B6758.128421706015840 (code B ref 6758); Sat, 11 Sep 2010 14:58:02 +0000 Received: (at 6758) by debbugs.gnu.org; 11 Sep 2010 14:57:40 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OuRWN-00047Q-DR for submit@debbugs.gnu.org; Sat, 11 Sep 2010 10:57:40 -0400 Received: from impaqm1.telefonica.net ([213.4.138.1]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OuRWL-00047A-19 for 6758@debbugs.gnu.org; Sat, 11 Sep 2010 10:57:38 -0400 Received: from IMPmailhost3.adm.correo ([10.20.102.124]) by IMPaqm1.telefonica.net with bizsmtp id 5R1u1f00i2h2L9m01SzY2R; Sat, 11 Sep 2010 16:59:32 +0200 Received: from ceviche.home ([83.61.39.212]) by IMPmailhost3.adm.correo with BIZ IMP id 5SzV1f0094aeRwb1jSzWMD; Sat, 11 Sep 2010 16:59:32 +0200 X-Brightmail-Tracker: AAAAAA== X-TE-authinfo: authemail="monnier$movistar.es" |auth_email="monnier@movistar.es" X-TE-AcuTerraCos: auth_cuTerraCos="cosuitnetc01" Received: by ceviche.home (Postfix, from userid 20848) id 56D4D660D2; Sat, 11 Sep 2010 16:59:29 +0200 (CEST) From: Stefan Monnier Message-ID: References: <20100802205959.GA1974@psychosis.jim.sh> <20100803201456.GA8182@psychosis.jim.sh> <20100824004800.GA18600@psychosis.jim.sh> Date: Sat, 11 Sep 2010 16:59:29 +0200 In-Reply-To: <20100824004800.GA18600@psychosis.jim.sh> (Jim Paris's message of "Mon, 23 Aug 2010 20:48:01 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -1.2 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) > Any thoughts on this patch? > I've found further problems with doing aynchronous terminal queries: > minibuffer prompts get aborted by the xterm response. For example, > when opening up a large file: > 1) Emacs loads and sends "\e[>0c" > 2) Emacs prints the "File x is large (123MB), really open? (y or n)" prompt > 3) Xterm sends the "\e[>0;253;0c" response, aborting the prompt You can try the patch below (may require manual application, it's made against a non-vanilla tree) to see if it fixes your problem, Stefan === modified file 'lisp/subr.el' --- lisp/subr.el 2010-09-11 09:14:23 +0000 +++ lisp/subr.el 2010-09-11 14:57:41 +0000 @@ -3680,6 +3680,52 @@ buffer) +(defun y-or-n-p (prompt) + "Ask user a \"y or n\" question. Return t if answer is \"y\". +The argument PROMPT is the string to display to ask the question. +It should end in a space; `y-or-n-p' adds `(y or n) ' to it. +No confirmation of the answer is requested; a single character is enough. +Also accepts Space to mean yes, or Delete to mean no. \(Actually, it uses +the bindings in `query-replace-map'; see the documentation of that variable +for more information. In this case, the useful bindings are `act', `skip', +`recenter', and `quit'.\) + +Under a windowing system a dialog box will be used if `last-nonmenu-event' +is nil and `use-dialog-box' is non-nil." + (let ((answer 'none) + (xprompt (setq prompt (propertize (concat prompt "(y or n) ") + 'face 'minibuffer-prompt)))) + (if (and (display-popup-menus-p) + (listp last-nonmenu-event) + use-dialog-box) + (progn + (setq answer + (x-popup-dialog t `(,prompt ("yes" . t) ("No" . nil))))) + (while + (progn + (when minibuffer-auto-raise + (raise-frame (window-frame (minibuffer-window)))) + (let* ((key + (let ((cursor-in-echo-area t)) + (read-key xprompt)))) + (setq answer (lookup-key query-replace-map (vector key) t)) + (case answer + ((skip act) nil) + (recenter (recenter) t) + ((exit-prefix quit) (signal 'quit nil) t) + (t t)))) + (ding) + (discard-input) + (setq xprompt + (if (eq answer 'recenter) prompt + (propertize (concat "Please answer y or n. " prompt) + 'face 'minibuffer-prompt)))) + + (let ((ret (eq answer 'act))) + (unless noninteractive + (message "%s %s" prompt (if ret "y" "n"))) + ret)))) + ;; (defun get-doc-string (pos &optional unibyte definition) ;; (let ((file (or (car-safe pos) internal-doc-file-name)) ;; (position (or (cdr-safe pos) pos)) === modified file 'src/fileio.c' --- src/fileio.c 2010-08-10 10:46:59 +0000 +++ src/fileio.c 2010-09-11 14:22:33 +0000 @@ -1842,7 +1842,7 @@ tem = format2 ("File %s already exists; %s anyway? ", absname, build_string (querystring)); if (quick) - tem = Fy_or_n_p (tem); + tem = call1 (intern ("y-or-n-p"), tem); else tem = do_yes_or_no_p (tem); UNGCPRO; === modified file 'src/fns.c' --- src/fns.c 2010-08-14 22:35:37 +0000 +++ src/fns.c 2010-09-11 14:10:27 +0000 @@ -2437,146 +2437,6 @@ return sequence; } -/* Anything that calls this function must protect from GC! */ - -DEFUN ("y-or-n-p", Fy_or_n_p, Sy_or_n_p, 1, 1, 0, - doc: /* Ask user a "y or n" question. Return t if answer is "y". -Takes one argument, which is the string to display to ask the question. -It should end in a space; `y-or-n-p' adds `(y or n) ' to it. -No confirmation of the answer is requested; a single character is enough. -Also accepts Space to mean yes, or Delete to mean no. \(Actually, it uses -the bindings in `query-replace-map'; see the documentation of that variable -for more information. In this case, the useful bindings are `act', `skip', -`recenter', and `quit'.\) - -Under a windowing system a dialog box will be used if `last-nonmenu-event' -is nil and `use-dialog-box' is non-nil. */) - (Lisp_Object prompt) -{ - register Lisp_Object obj, key, def, map; - register int answer; - Lisp_Object xprompt; - Lisp_Object args[2]; - struct gcpro gcpro1, gcpro2; - int count = SPECPDL_INDEX (); - - specbind (Qcursor_in_echo_area, Qt); - - map = Fsymbol_value (intern ("query-replace-map")); - - CHECK_STRING (prompt); - xprompt = prompt; - GCPRO2 (prompt, xprompt); - -#ifdef HAVE_WINDOW_SYSTEM - if (display_hourglass_p) - cancel_hourglass (); -#endif - - while (1) - { - -#ifdef HAVE_MENUS - if (FRAME_WINDOW_P (SELECTED_FRAME ()) - && (NILP (last_nonmenu_event) || CONSP (last_nonmenu_event)) - && use_dialog_box - && have_menus_p ()) - { - Lisp_Object pane, menu; - redisplay_preserve_echo_area (3); - pane = Fcons (Fcons (build_string ("Yes"), Qt), - Fcons (Fcons (build_string ("No"), Qnil), - Qnil)); - menu = Fcons (prompt, pane); - obj = Fx_popup_dialog (Qt, menu, Qnil); - answer = !NILP (obj); - break; - } -#endif /* HAVE_MENUS */ - cursor_in_echo_area = 1; - choose_minibuf_frame (); - - { - Lisp_Object pargs[3]; - - /* Colorize prompt according to `minibuffer-prompt' face. */ - pargs[0] = build_string ("%s(y or n) "); - pargs[1] = intern ("face"); - pargs[2] = intern ("minibuffer-prompt"); - args[0] = Fpropertize (3, pargs); - args[1] = xprompt; - Fmessage (2, args); - } - - if (minibuffer_auto_raise) - { - Lisp_Object mini_frame; - - mini_frame = WINDOW_FRAME (XWINDOW (minibuf_window)); - - Fraise_frame (mini_frame); - } - - temporarily_switch_to_single_kboard (SELECTED_FRAME ()); - obj = read_filtered_event (1, 0, 0, 0, Qnil); - cursor_in_echo_area = 0; - /* If we need to quit, quit with cursor_in_echo_area = 0. */ - QUIT; - - key = Fmake_vector (make_number (1), obj); - def = Flookup_key (map, key, Qt); - - if (EQ (def, intern ("skip"))) - { - answer = 0; - break; - } - else if (EQ (def, intern ("act"))) - { - answer = 1; - break; - } - else if (EQ (def, intern ("recenter"))) - { - Frecenter (Qnil); - xprompt = prompt; - continue; - } - else if (EQ (def, intern ("quit"))) - Vquit_flag = Qt; - /* We want to exit this command for exit-prefix, - and this is the only way to do it. */ - else if (EQ (def, intern ("exit-prefix"))) - Vquit_flag = Qt; - - QUIT; - - /* If we don't clear this, then the next call to read_char will - return quit_char again, and we'll enter an infinite loop. */ - Vquit_flag = Qnil; - - Fding (Qnil); - Fdiscard_input (); - if (EQ (xprompt, prompt)) - { - args[0] = build_string ("Please answer y or n. "); - args[1] = prompt; - xprompt = Fconcat (2, args); - } - } - UNGCPRO; - - if (! noninteractive) - { - cursor_in_echo_area = -1; - message_with_string (answer ? "%s(y or n) y" : "%s(y or n) n", - xprompt, 0); - } - - unbind_to (count, Qnil); - return answer ? Qt : Qnil; -} - /* This is how C code calls `yes-or-no-p' and allows the user to redefined it. @@ -5057,7 +4917,6 @@ defsubr (&Smapcar); defsubr (&Smapc); defsubr (&Smapconcat); - defsubr (&Sy_or_n_p); defsubr (&Syes_or_no_p); defsubr (&Sload_average); defsubr (&Sfeaturep); === modified file 'src/lisp.h' --- src/lisp.h 2010-09-10 23:24:48 +0000 +++ src/lisp.h 2010-09-11 14:09:41 +0000 @@ -2586,7 +2586,6 @@ EXFUN (Fnconc, MANY); EXFUN (Fmapcar, 2); EXFUN (Fmapconcat, 3); -EXFUN (Fy_or_n_p, 1); extern Lisp_Object do_yes_or_no_p (Lisp_Object); EXFUN (Frequire, 3); EXFUN (Fprovide, 2); From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 29 00:15:45 2012 Received: (at control) by debbugs.gnu.org; 29 Jan 2012 05:15:46 +0000 Received: from localhost ([127.0.0.1]:42803 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RrN7A-00057A-Kg for submit@debbugs.gnu.org; Sun, 29 Jan 2012 00:15:45 -0500 Received: from fencepost.gnu.org ([140.186.70.10]:54885 ident=Debian-exim) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RrN78-000571-3M for control@debbugs.gnu.org; Sun, 29 Jan 2012 00:15:43 -0500 Received: from bb121-7-229-69.singnet.com.sg ([121.7.229.69]:46549 helo=furball) by fencepost.gnu.org with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1RrN74-00063m-JX for control@debbugs.gnu.org; Sun, 29 Jan 2012 00:15:39 -0500 From: Chong Yidong To: control@debbugs.gnu.org Subject: merge 6758 8482 Date: Sun, 29 Jan 2012 13:15:31 +0800 Message-ID: <871uqj6qdo.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -4.2 (----) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.2 (----) merge 6758 8482 thanks From debbugs-submit-bounces@debbugs.gnu.org Thu Mar 29 23:52:11 2012 Received: (at control) by debbugs.gnu.org; 30 Mar 2012 03:52:11 +0000 Received: from localhost ([127.0.0.1]:45709 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SDSsK-0007zS-8S for submit@debbugs.gnu.org; Thu, 29 Mar 2012 23:52:11 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.181]:8365) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SDSrq-0007yk-9A; Thu, 29 Mar 2012 23:51:41 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AicFAKU/KE9MCqRV/2dsb2JhbACBX5x7eYhwnhmGGQSbGYQJ X-IronPort-AV: E=Sophos;i="4.73,1,1325480400"; d="scan'208";a="170644560" Received: from 76-10-164-85.dsl.teksavvy.com (HELO fmsmemgm.homelinux.net) ([76.10.164.85]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 29 Mar 2012 23:19:43 -0400 Received: by fmsmemgm.homelinux.net (Postfix, from userid 20848) id E14A2AE14B; Thu, 29 Mar 2012 23:19:42 -0400 (EDT) From: Stefan Monnier To: Vincent Lefevre Subject: Re: bug#11129: 23.4; garbage inserted at the beginning of the buffer when starting Emacs in a terminal on a remote machine Message-ID: References: <87k422hok3.fsf@xvii.vinc17.org> <20120330020543.GF8851@xvii.vinc17.org> Date: Thu, 29 Mar 2012 23:19:42 -0400 In-Reply-To: <20120330020543.GF8851@xvii.vinc17.org> (Vincent Lefevre's message of "Fri, 30 Mar 2012 04:05:43 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.94 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: control Cc: 11129@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) forcemerge 6758 11129 thanks >> Start "emacs -Q" on a remote machine with a slow connection, well... >> a high latency (e.g. ADSL during a file transfer). > [...] > Actually Emacs should be run in an xterm (after connecting to a > remote machine by ssh). It's a known problem. You can work around it by setting xterm-extra-capabilities to t or nil. Stefan From unknown Fri Aug 15 16:57:45 2025 X-Loop: help-debbugs@gnu.org Subject: bug#6758: 23.2; xterm.el: please provide an option to not discard input in terminal-init-xterm Resent-From: Chong Yidong Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 17 Jun 2012 05:33:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 6758 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Jim Paris Cc: 6758@debbugs.gnu.org Received: via spool by 6758-submit@debbugs.gnu.org id=B6758.13399111395424 (code B ref 6758); Sun, 17 Jun 2012 05:33:01 +0000 Received: (at 6758) by debbugs.gnu.org; 17 Jun 2012 05:32:19 +0000 Received: from localhost ([127.0.0.1]:45431 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Sg85y-0001PQ-Ej for submit@debbugs.gnu.org; Sun, 17 Jun 2012 01:32:19 -0400 Received: from fencepost.gnu.org ([208.118.235.10]:44608) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Sg85w-0001PJ-U8 for 6758@debbugs.gnu.org; Sun, 17 Jun 2012 01:32:17 -0400 Received: from cm162.gamma80.maxonline.com.sg ([202.156.80.162]:50995 helo=ulysses) by fencepost.gnu.org with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1Sg82s-0002Bc-GZ; Sun, 17 Jun 2012 01:29:07 -0400 From: Chong Yidong References: <87r5im11u9.fsf@psychosis.jim.sh> Date: Sun, 17 Jun 2012 13:28:59 +0800 In-Reply-To: <87r5im11u9.fsf@psychosis.jim.sh> (Jim Paris's message of "Thu, 29 Jul 2010 16:15:42 -0400") Message-ID: <87txyaik10.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -6.9 (------) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.9 (------) Jim Paris writes: > Since upgrading to emacs-23, the terminal-init-xterm function in > term/xterm.el performs a "discard-input" followed by a couple of xterm > queries. > > Can an option be provided to disable these probes? Emacs 24.1 has `xterm-extra-capabilities' for this. Closing. From debbugs-submit-bounces@debbugs.gnu.org Sun Jun 17 01:32:27 2012 Received: (at control) by debbugs.gnu.org; 17 Jun 2012 05:32:27 +0000 Received: from localhost ([127.0.0.1]:45434 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Sg867-0001Pk-2t for submit@debbugs.gnu.org; Sun, 17 Jun 2012 01:32:27 -0400 Received: from fencepost.gnu.org ([208.118.235.10]:44610) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Sg865-0001Pd-2K for control@debbugs.gnu.org; Sun, 17 Jun 2012 01:32:25 -0400 Received: from cm162.gamma80.maxonline.com.sg ([202.156.80.162]:50996 helo=ulysses) by fencepost.gnu.org with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1Sg831-0002C9-5e for control@debbugs.gnu.org; Sun, 17 Jun 2012 01:29:16 -0400 From: Chong Yidong To: control@debbugs.gnu.org Subject: close 6758 Date: Sun, 17 Jun 2012 13:29:10 +0800 Message-ID: <87k3z6v74p.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -6.9 (------) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.9 (------) close 6758 thanks From unknown Fri Aug 15 16:57:45 2025 X-Loop: help-debbugs@gnu.org Subject: bug#6758: So what do I need to do to keep emacs from eating my typeahead? References: <87r5im11u9.fsf@psychosis.jim.sh> In-Reply-To: <87r5im11u9.fsf@psychosis.jim.sh> Resent-From: "Karl O. Pinc" Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 19 Jun 2012 04:07:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 6758 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 6758@debbugs.gnu.org, Jim Paris Received: via spool by 6758-submit@debbugs.gnu.org id=B6758.134007879530873 (code B ref 6758); Tue, 19 Jun 2012 04:07:01 +0000 Received: (at 6758) by debbugs.gnu.org; 19 Jun 2012 04:06:35 +0000 Received: from localhost ([127.0.0.1]:47600 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Sgpi6-00081t-J2 for submit@debbugs.gnu.org; Tue, 19 Jun 2012 00:06:34 -0400 Received: from janus.meme.com ([69.17.73.118]:35406 helo=smtp.meme.com) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Sgpi3-00081l-HQ for 6758@debbugs.gnu.org; Tue, 19 Jun 2012 00:06:32 -0400 Received: by smtp.meme.com (Postfix, from userid 1001) id 36C71A459; Mon, 18 Jun 2012 23:03:11 -0500 (CDT) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on janus.meme.com X-Spam-Level: Received: from mofo.meme.com (unknown [192.168.1.2]) by smtp.meme.com (Postfix) with ESMTP id 375EAA3E7; Mon, 18 Jun 2012 23:03:10 -0500 (CDT) Received: from mofo (localhost.localdomain [127.0.0.1]) by mofo.meme.com (Postfix) with ESMTP id C7A1143F26; Mon, 18 Jun 2012 23:03:09 -0500 (CDT) Date: Mon, 18 Jun 2012 23:03:09 -0500 From: "Karl O. Pinc" X-Mailer: Balsa 2.4.1 Message-Id: <1340078589.15074.5@mofo> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable X-Spam-Score: -1.9 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) Hi, Thanks for fixing this, but I'm left unclear on what I would need to do to keep emacs from discarding my typeahead on startup. (Bug report #8482, merged with bug #6758.) I'll also have to get a new emacs (24.1), which might be why this is not clear. Sorry if this is the case, but I remain nervous that the solution will be obvious; `xterm-extra-capabilities' does not scream out to me as something that fixes a problem with typeahead. Thanks again for your work. Karl Free Software: "You don't pay back, you pay forward." -- Robert A. Heinlein From unknown Fri Aug 15 16:57:45 2025 X-Loop: help-debbugs@gnu.org Subject: bug#6758: So what do I need to do to keep emacs from eating my typeahead? Resent-From: Glenn Morris Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 19 Jun 2012 07:56:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 6758 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: "Karl O. Pinc" Cc: 6758@debbugs.gnu.org Received: via spool by 6758-submit@debbugs.gnu.org id=B6758.134009252021504 (code B ref 6758); Tue, 19 Jun 2012 07:56:02 +0000 Received: (at 6758) by debbugs.gnu.org; 19 Jun 2012 07:55:20 +0000 Received: from localhost ([127.0.0.1]:47764 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SgtHT-0005an-Tf for submit@debbugs.gnu.org; Tue, 19 Jun 2012 03:55:20 -0400 Received: from fencepost.gnu.org ([208.118.235.10]:34950) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SgtHR-0005af-9O for 6758@debbugs.gnu.org; Tue, 19 Jun 2012 03:55:18 -0400 Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1SgtEB-00036M-J7; Tue, 19 Jun 2012 03:51:55 -0400 From: Glenn Morris References: <87r5im11u9.fsf@psychosis.jim.sh> <1340078589.15074.5@mofo> X-Spook: Project Monarch Ft. Bragg bluebird fundamentalist X-Ran: $=e/SmT5KDs}sy (Karl O. Pinc's message of "Mon, 18 Jun 2012 23:03:09 -0500") Message-ID: User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -6.9 (------) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.9 (------) "Karl O. Pinc" wrote: > Thanks for fixing this, but I'm left unclear on what I would need to > do to keep emacs from discarding my typeahead on startup. (Bug report > #8482, merged with bug #6758.) Set xterm-extra-capabilities to a value other than `check' (the default). See that variable's documentation (in term/xterm.el) for more details. Eg you may set it to nil. From debbugs-submit-bounces@debbugs.gnu.org Mon Mar 11 10:43:10 2013 Received: (at control) by debbugs.gnu.org; 11 Mar 2013 14:43:10 +0000 Received: from localhost ([127.0.0.1]:46436 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UF3wU-0007Io-BS for submit@debbugs.gnu.org; Mon, 11 Mar 2013 10:43:10 -0400 Received: from relais.videotron.ca ([24.201.245.36]:10416) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UF3wQ-0007Ie-3r for control@debbugs.gnu.org; Mon, 11 Mar 2013 10:43:06 -0400 MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII Received: from ceviche.home ([24.201.208.110]) by VL-VM-MR005.ip.videotron.ca (Oracle Communications Messaging Exchange Server 7u4-22.01 64bit (built Apr 21 2011)) with ESMTP id <0MJI00CN73I8IB20@VL-VM-MR005.ip.videotron.ca> for control@debbugs.gnu.org; Mon, 11 Mar 2013 10:42:10 -0400 (EDT) Received: by ceviche.home (Postfix, from userid 20848) id 9FA22660D9; Mon, 11 Mar 2013 10:42:06 -0400 (EDT) From: Stefan Monnier To: control@debbugs.gnu.org (GNU bug Tracking System) Subject: Re: Archived problem report bug#6758 (bug#6758: 23.2; xterm.el: please provide an option to not discard input in terminal-init-xterm) Message-id: References: <87r5im11u9.fsf@psychosis.jim.sh> Date: Mon, 11 Mar 2013 10:42:06 -0400 In-reply-to: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-Spam-Score: 1.6 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: unarchive 6758 thanks [...] Content analysis details: (1.6 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [24.201.245.36 listed in list.dnswl.org] 0.7 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) 0.8 BAYES_50 BODY: Bayes spam probability is 40 to 60% [score: 0.4999] 0.1 HDRS_LCASE Odd capitalization of message header 0.0 T_MANY_HDRS_LCASE Odd capitalization of multiple message headers X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: 0.7 (/) unarchive 6758 thanks From unknown Fri Aug 15 16:57:45 2025 X-Loop: help-debbugs@gnu.org Subject: bug#6758: 23.2; xterm.el: please provide an option to not discard input in terminal-init-xterm Resent-From: Stefan Monnier Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 11 Mar 2013 21:03:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 6758 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Jim Paris Cc: 6758-done@debbugs.gnu.org, Johan =?UTF-8?Q?Bockg=C3=A5rd?= Received: via spool by 6758-done@debbugs.gnu.org id=D6758.13630357363958 (code D ref 6758); Mon, 11 Mar 2013 21:03:02 +0000 Received: (at 6758-done) by debbugs.gnu.org; 11 Mar 2013 21:02:16 +0000 Received: from localhost ([127.0.0.1]:46905 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UF9rL-00011j-Cb for submit@debbugs.gnu.org; Mon, 11 Mar 2013 17:02:15 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.182]:61981) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UF9rJ-00011Y-Sf for 6758-done@debbugs.gnu.org; Mon, 11 Mar 2013 17:02:14 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av8EABK/CFHO+KL9/2dsb2JhbABEvw4Xc4IeAQEEAToCARkjBQsLNBIUGA0kiB4GwS2RCgOkeoFegxM X-IPAS-Result: Av8EABK/CFHO+KL9/2dsb2JhbABEvw4Xc4IeAQEEAToCARkjBQsLNBIUGA0kiB4GwS2RCgOkeoFegxM X-IronPort-AV: E=Sophos;i="4.84,565,1355115600"; d="scan'208";a="4289972" Received: from 206-248-162-253.dsl.teksavvy.com (HELO ceviche.home) ([206.248.162.253]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 11 Mar 2013 17:01:10 -0400 Received: by ceviche.home (Postfix, from userid 20848) id E5825660E5; Mon, 11 Mar 2013 17:01:11 -0400 (EDT) Resent-Message-ID: Resent-To: 6758-done@debbugs.gnu.org Resent-From: Stefan Monnier Resent-Date: Mon, 11 Mar 2013 17:01:11 -0400 X-Original-To: monnier@iro.umontreal.ca Received: from pinpin.iro.umontreal.ca (pinpin.iro.umontreal.ca [132.204.24.52]) by mercure.iro.umontreal.ca (Postfix) with ESMTP id CF8488482E for ; Mon, 11 Mar 2013 10:13:11 -0400 (EDT) Received: from relais.videotron.ca (relais.videotron.ca [24.201.245.36]) by pinpin.iro.umontreal.ca (Postfix) with ESMTP id 2F1593B8E5D for ; Mon, 11 Mar 2013 10:13:00 -0400 (EDT) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII Received: from ceviche.home ([24.201.208.110]) by VL-VM-MR006.ip.videotron.ca (Oracle Communications Messaging Exchange Server 7u4-22.01 64bit (built Apr 21 2011)) with ESMTP id <0MJI00GRF25NOTG0@VL-VM-MR006.ip.videotron.ca> for monnier@iro.umontreal.ca; Mon, 11 Mar 2013 10:13:00 -0400 (EDT) Received: by ceviche.home (Postfix, from userid 20848) id 03504660E5; Mon, 11 Mar 2013 10:12:57 -0400 (EDT) From: Stefan Monnier Message-id: References: <20100802205959.GA1974@psychosis.jim.sh> <20100803201456.GA8182@psychosis.jim.sh> <20100824004800.GA18600@psychosis.jim.sh> Date: Mon, 11 Mar 2013 10:12:57 -0400 In-reply-to: <20100824004800.GA18600@psychosis.jim.sh> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-DIRO-MailScanner-Information: Please contact the ISP for more information X-DIRO-MailScanner: Found to be clean X-DIRO-MailScanner-SpamCheck: n'est pas un polluriel, SpamAssassin (score=-1.939, requis 5, BAYES_00 -2.60, MC_TSTLAST 0.00, RECEIVED_FROM_NOUNK 0.66) X-DIRO-MailScanner-From: monnier@iro.umontreal.ca X-Spam-Status: No X-Spam-Score: 0.9 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: 0.8 (/) > Any thoughts on this patch? I installed a similar patch (tho rewritten based on the latest version of the code), except that it only uses your asynchronous approach if there's pending input. This way, the old synchronous method is still used in "most" cases and the new riskier approach is only used when we would otherwise have had to discard-input. Thank you for your help, Stefan