From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Nicolas Richard Newsgroups: gmane.emacs.bugs Subject: bug#16988: 24.3.50; emacs -nw -Q --eval '(kill-emacs)' takes 2 seconds unless I hit a key Date: Wed, 12 Mar 2014 09:59:13 +0100 Message-ID: <87iorj7lfv.fsf@yahoo.fr> References: <8761nkkbf6.fsf@yahoo.fr> <83iorkodqs.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1394620633 6714 80.91.229.3 (12 Mar 2014 10:37:13 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 12 Mar 2014 10:37:13 +0000 (UTC) Cc: Nicolas Richard , 16988@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Mar 12 11:37:21 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1WNgXH-0005qx-95 for geb-bug-gnu-emacs@m.gmane.org; Wed, 12 Mar 2014 11:37:19 +0100 Original-Received: from localhost ([::1]:59786 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WNgXG-00088I-D7 for geb-bug-gnu-emacs@m.gmane.org; Wed, 12 Mar 2014 06:37:18 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46533) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WNgX6-0007xb-N1 for bug-gnu-emacs@gnu.org; Wed, 12 Mar 2014 06:37:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WNgX1-0006GL-JU for bug-gnu-emacs@gnu.org; Wed, 12 Mar 2014 06:37:08 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:60964) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WNgX1-0006GF-H9 for bug-gnu-emacs@gnu.org; Wed, 12 Mar 2014 06:37:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1WNgX0-0007C6-UN for bug-gnu-emacs@gnu.org; Wed, 12 Mar 2014 06:37:03 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: <8761nkkbf6.fsf@yahoo.fr> Resent-From: Nicolas Richard Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 12 Mar 2014 10:37:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 16988 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 16988-submit@debbugs.gnu.org id=B16988.139462060927585 (code B ref 16988); Wed, 12 Mar 2014 10:37:02 +0000 Original-Received: (at 16988) by debbugs.gnu.org; 12 Mar 2014 10:36:49 +0000 Original-Received: from localhost ([127.0.0.1]:33913 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WNgWm-0007Aq-DW for submit@debbugs.gnu.org; Wed, 12 Mar 2014 06:36:48 -0400 Original-Received: from mxin.ulb.ac.be ([164.15.128.112]:29472) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WNgWj-0007Ad-Tn for 16988@debbugs.gnu.org; Wed, 12 Mar 2014 06:36:46 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvgHAF44IFOkD4Xn/2dsb2JhbABarHaYc4ExdIIlAQEBAwF5BQsIAxQNJQ8BBEMGE4dkAQwIsUaZGAGHBxeHXoZ+hD8EmEWGNYt4gW+BPzw Original-Received: from pno-math-231.ulb.ac.be (HELO LDLC-portable) ([164.15.133.231]) by smtp.ulb.ac.be with ESMTP; 12 Mar 2014 11:36:37 +0100 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:86761 Archived-At: Eli Zaretskii writes: >> $ time src/emacs -nw -Q --eval '(kill-emacs)' >> >> real 0m2.064s >> user 0m0.030s >> sys 0m0.010s > My crystal ball says that your TERM variable points to xterm, but your > terminal either isn't xterm or doesn't support the kind of queries > that xterm--query on xterm.el uses. That function indeed waits for 2s > for the terminal to respond. Since it was not a problem before, I bisected that down to commit: commit 7e594297002c7bc07083fa8d01552255e831ba2a Author: W. Trevor King Date: Wed Feb 19 23:45:19 2014 -0500 * lisp/term/xterm.el (xterm--version-handler): Adapt to xterm-280's output. which changed xterm--version-handler (in lisp/term/xterm.el) in the following way: - (when (string-match "0;\\([0-9]+\\);0" str) - (let ((version (string-to-number (match-string 1 str)))) + ;; Since xterm-280, the terminal type (NUMBER1) is now 41 instead of 0. + (when (string-match "\\([0-9]+\\);\\([0-9]+\\);0" str) + (let ((version (string-to-number (match-string 2 str)))) That has the effect of now matching gnome-terminal's string (it begins with 1 on my platform). As a side effect of this, calling "emacsclient -t" from within gnome-terminal currently acts weird : it shows the wrong buffer for up to two second and --if you press some keys before the 2 seconds-- it shows a few weird chars (a query to the terminal) (until next time that part of the screen is redrawn ?). I now see three approaches : 0. Do nothing, and let users fix their terminal emulator and/or terminfo entries. (alternatively : provide guidance for doing this.) 1. Like it is done now for rxvt (in function terminal-init-xterm), add some ad-hoc code for detecting gnome-terminal which pretends to be xterm (in fact the exact same approach might work : $COLORTERM is gnome-terminal when using gnome-terminal). 2. Test also (match-string 1 str) in the above code and make sure it is either 0 or 41. (it is equal to 1 in my gnome-terminal) Opinions ? -- Nico.