unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Vincent Lefevre <vincent@vinc17.net>
To: Glenn Morris <rgm@gnu.org>
Cc: 12354@debbugs.gnu.org
Subject: bug#12354: 24.2; garbage inserted at the beginning of the buffer even when xterm-extra-capabilities is t
Date: Wed, 27 May 2015 13:27:23 +0200	[thread overview]
Message-ID: <20150527112723.GA23516@ypig.lip.ens-lyon.fr> (raw)
In-Reply-To: <20120905184424.GQ4846@xvii.vinc17.org>

On 2012-09-05 20:44:24 +0200, Vincent Lefevre wrote:
> On 2012-09-05 12:59:30 -0400, Glenn Morris wrote:
> > Vincent Lefevre wrote:
> > 
> > >   emacs -Q -eval '(setq xterm-extra-capabilities t)' tst.c
> > 
> > By experiment, -eval is processed too late to affect the relevant
> > portion of start-up. Try putting the setting in .emacs
> 
> I had
> 
>   '(xterm-extra-capabilities (quote (modifyOtherKeys reportBackground)))
> 
> in the custom variables, but got the same problem.

The .emacs is executed too late as well: if I introduce an error in the
code below (e.g. zzz before the first when), I can see it reported. In
xterm.el, the problem is:

  (if (eq xterm-extra-capabilities 'check)
      ;; Try to find out the type of terminal by sending a "Secondary
      ;; Device Attributes (DA)" query.
      (xterm--query "\e[>0c"
                    ;; 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.
                    '(("\e[?" . xterm--version-handler)
                      ("\e[>" . xterm--version-handler)))

    (when (memq 'reportBackground xterm-extra-capabilities)
      (xterm--query "\e]11;?\e\\"
                    '(("\e]11;" .  xterm--report-background-handler))))

    (when (memq 'modifyOtherKeys xterm-extra-capabilities)
      (terminal-init-xterm-modify-other-keys)))

If I introduce a network delay with:

  tc qdisc add dev eth0 root netem delay 2000ms

the problem always occurs. But if I also remove the above code, then
it no longer occurs.

So, the above (eq xterm-extra-capabilities 'check) test seems to be
useless, and there should be a way to disable it. IMHO, this query
is ugly and should be removed entirely in favor of checking the
environment, in addition to user side settings. If the issue is that
not all xterm's behave in the same way because of new features, you
can test the XTERM_VERSION environment variable. If the default guess
is not OK, the user should have a way to fix it in his ".emacs".

-- 
Vincent Lefèvre <vincent@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)





  reply	other threads:[~2015-05-27 11:27 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-05 11:16 bug#12354: 24.2; garbage inserted at the beginning of the buffer even when xterm-extra-capabilities is t Vincent Lefevre
2012-09-05 16:59 ` Glenn Morris
2012-09-05 18:44   ` Vincent Lefevre
2015-05-27 11:27     ` Vincent Lefevre [this message]
2015-06-29  1:01       ` Stefan Monnier
2015-06-29  2:35         ` Vincent Lefevre
2015-06-29 13:12           ` Stefan Monnier
2015-06-29 13:47             ` Vincent Lefevre
2015-06-30 14:04               ` Stefan Monnier
2015-07-01  3:19                 ` Stefan Monnier
2015-07-01 15:01                   ` Vincent Lefevre
2015-07-02 14:49                     ` Stefan Monnier
2015-07-03  1:16                       ` Vincent Lefevre
2017-12-17  2:07                         ` Noam Postavsky
2012-09-08  9:57 ` Andreas Schwab
2012-09-08 11:00   ` Vincent Lefevre

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=20150527112723.GA23516@ypig.lip.ens-lyon.fr \
    --to=vincent@vinc17.net \
    --cc=12354@debbugs.gnu.org \
    --cc=rgm@gnu.org \
    /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).