From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Jayden Navarro Newsgroups: gmane.emacs.bugs Subject: bug#36328: 26.2; Args out of range on search-and-replace of *.cc file Date: Mon, 24 Jun 2019 13:03:31 -0700 Message-ID: References: <20190622132549.84518.qmail@mail.muc.de> <20190622205033.GA9167@ACM> <20190623122207.GA4736@ACM> <20190623193258.GB4736@ACM> <87k1dc2e5h.fsf@mail.linkov.net> <87ef3i7wiz.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="00000000000019aa3d058c174f41" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="241298"; mail-complaints-to="usenet@blaine.gmane.org" Cc: Alan Mackenzie , 36328@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jun 24 22:10:37 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hfVIT-0010gW-64 for geb-bug-gnu-emacs@m.gmane.org; Mon, 24 Jun 2019 22:10:37 +0200 Original-Received: from localhost ([::1]:54406 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfVIS-0002y3-3h for geb-bug-gnu-emacs@m.gmane.org; Mon, 24 Jun 2019 16:10:36 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56259) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfVC7-0006t9-Pt for bug-gnu-emacs@gnu.org; Mon, 24 Jun 2019 16:04:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hfVC6-0005Fv-Jd for bug-gnu-emacs@gnu.org; Mon, 24 Jun 2019 16:04:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:44528) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hfVC6-0005Fb-77 for bug-gnu-emacs@gnu.org; Mon, 24 Jun 2019 16:04:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hfVC5-0000sA-VC for bug-gnu-emacs@gnu.org; Mon, 24 Jun 2019 16:04:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Jayden Navarro Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 24 Jun 2019 20:04:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 36328 X-GNU-PR-Package: emacs Original-Received: via spool by 36328-submit@debbugs.gnu.org id=B36328.15614066313336 (code B ref 36328); Mon, 24 Jun 2019 20:04:01 +0000 Original-Received: (at 36328) by debbugs.gnu.org; 24 Jun 2019 20:03:51 +0000 Original-Received: from localhost ([127.0.0.1]:58072 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hfVBv-0000rk-Bc for submit@debbugs.gnu.org; Mon, 24 Jun 2019 16:03:51 -0400 Original-Received: from mail-lf1-f49.google.com ([209.85.167.49]:32947) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hfVBs-0000rW-Rq for 36328@debbugs.gnu.org; Mon, 24 Jun 2019 16:03:49 -0400 Original-Received: by mail-lf1-f49.google.com with SMTP id y17so10975821lfe.0 for <36328@debbugs.gnu.org>; Mon, 24 Jun 2019 13:03:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yugabyte-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=dGtgGtFeqpzA9FtuaRmwFcNxvJj4i93hC4zH6FL8gQY=; b=rrBn37JKbhnWSt1AI/tmUZXFyL0quKdkRU7VPoNOp2St2qL94pqYUDTDwI1JM4Eh7e Wi1pF0tlTESq4HguilgTLxI3464erkYWol0ag9heiltzHkaLhJJhRKoXKP5LhRaZkK8w AixpYsEkepQWc5Q36vRNN9GF5q48UGpsgjgYIsDKNUkGo5XGj0ReEJGlhQQ4DVkQ6ev1 IG4J102McSm+OP5cPxlrjEHcA+tfsQw5gRRwXAy/nX9ZXl0dbz+kdVo8SzRT78Nh/Dmw gfIFxT19xRCoFlRN/4iJDqx3okmSJtqXA8D5cm9qMGibY10eQ0izfsvrqLT/1gN77FHW 3N8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=dGtgGtFeqpzA9FtuaRmwFcNxvJj4i93hC4zH6FL8gQY=; b=Sox8nQCj5Ij6GBFA4nk8ZmuO2QIsZ/DQedwxX3ZsNp1kJTnaw+H6FtUND733yZ+S1g qw3wfKoujCDrc35GjYeur3jGsv1Aur4RplfKbqVx9P+FFUSOY4HLpMHGQ8BA2QHF3kPd m4OjdqqkreyaZUgOA1CpGJA8jeWdSNvFrjrTtspanN33opeOzORBckKtIZ02rFEnnb7E qvpZWNtiQbCgY35iVAZUmEIos6Tb2BgwuInWvj0mN0pPsjCLX4XmywfEgs8CNrpdEI22 vHOYJwocLZkEmoLWuZNJTiLJYdjOscoAXXdIsqr0DCmFlcdcSDU1Sg4pQAOGOWVFyTti ZJCg== X-Gm-Message-State: APjAAAWmyUF2hnAyWjyPYbPc6FUXgqDhTwQzXZ1MD3BA8wQmNQQ/iQ/L /qQg5cIGyG/qV9gC5UXY3fk6j05/Gq/4AA0akYZwIw== X-Google-Smtp-Source: APXvYqyaXNEBHnm9WjzIndTsDg3MrcE1Tw5w9y5Jei0gIhfhrudZlWhGeanowQ80BLgLqPo4SfSBEZyLYXroGHXV7+A= X-Received: by 2002:ac2:4152:: with SMTP id c18mr26783850lfi.144.1561406622765; Mon, 24 Jun 2019 13:03:42 -0700 (PDT) In-Reply-To: <87ef3i7wiz.fsf@mail.linkov.net> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.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" Xref: news.gmane.org gmane.emacs.bugs:161272 Archived-At: --00000000000019aa3d058c174f41 Content-Type: text/plain; charset="UTF-8" Hi Juri, Thank you very much for the detailed test case. > Previously I tried in the MATE terminal emulator, > but xterm-256color was an essential detail indeed. > Now I was able to reproduce with TERM="xterm-256color" > and to track down the source of this problem. > > It happens while the color "ForestGreen" is loaded for > the face font-lock-type-face that has this definition: > > (((class color) (min-colors 16) (background light)) > :foreground "ForestGreen") > > by tty-color-canonicalize. > > Could you please try this patch to see if it fixes the problem: > > diff --git a/lisp/term/tty-colors.el b/lisp/term/tty-colors.el > index 307586f221..5af8170203 100644 > --- a/lisp/term/tty-colors.el > +++ b/lisp/term/tty-colors.el > @@ -820,7 +820,7 @@ tty-color-canonicalize > "Return COLOR in canonical form. > A canonicalized color name is all-lower case, with any blanks removed." > (let ((case-fold-search nil)) > - (if (string-match "[A-Z ]" color) > + (if (string-match-p "[A-Z ]" color) > (replace-regexp-in-string " +" "" (downcase color)) > color))) > Thank you for root-causing this! The patch you provided does indeed fix the issue for me. Best, Jayden --00000000000019aa3d058c174f41 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Juri,

=
Thank you very much for t= he detailed test case.
Previously I tried in the MATE terminal emulator,=
but xterm-256color was an essential detail indeed.
Now I was able to= reproduce with TERM=3D"xterm-256color"
and to track down the = source of this problem.

It happens while the color "ForestGreen= " is loaded for
the face font-lock-type-face that has this definiti= on:

=C2=A0 (((class color) (min-colors 16) (background light))
= =C2=A0 =C2=A0:foreground "ForestGreen")

by tty-color-canon= icalize.

Could you please try this patch to see if it fixes the prob= lem:

diff --git a/lisp/term/tty-colors.el b/lisp/term/tty-colors.el<= br>index 307586f221..5af8170203 100644
--- a/lisp/term/tty-colors.el
= +++ b/lisp/term/tty-colors.el
@@ -820,7 +820,7 @@ tty-color-canonicalize=
=C2=A0 =C2=A0"Return COLOR in canonical form.
=C2=A0A canonical= ized color name is all-lower case, with any blanks removed."
=C2=A0= =C2=A0(let ((case-fold-search nil))
-=C2=A0 =C2=A0 (if (string-match &q= uot;[A-Z ]" color)
+=C2=A0 =C2=A0 (if (string-match-p "[A-Z ]&= quot; color)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 (replace-regexp-in-string "= ; +" "" (downcase color))
=C2=A0 =C2=A0 =C2=A0 =C2=A0colo= r)))

Thank you = for root-causing this! The patch you provided does indeed fix the issue for= me.

Best,
Jayden
--00000000000019aa3d058c174f41--