From unknown Sat Aug 09 04:56:03 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#24223 <24223@debbugs.gnu.org> To: bug#24223 <24223@debbugs.gnu.org> Subject: Status: 25.1; Error in ansi-color-filter-apply when control sequences are dropped Reply-To: bug#24223 <24223@debbugs.gnu.org> Date: Sat, 09 Aug 2025 11:56:03 +0000 retitle 24223 25.1; Error in ansi-color-filter-apply when control sequences= are dropped reassign 24223 emacs submitter 24223 Ivan Andrus severity 24223 normal tag 24223 fixed thanks From debbugs-submit-bounces@debbugs.gnu.org Sun Aug 14 01:43:39 2016 Received: (at submit) by debbugs.gnu.org; 14 Aug 2016 05:43:39 +0000 Received: from localhost ([127.0.0.1]:56738 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bYoCx-00019C-Iv for submit@debbugs.gnu.org; Sun, 14 Aug 2016 01:43:39 -0400 Received: from eggs.gnu.org ([208.118.235.92]:42071) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bYoCv-00018z-AB for submit@debbugs.gnu.org; Sun, 14 Aug 2016 01:43:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bYoCp-0003Qq-2k for submit@debbugs.gnu.org; Sun, 14 Aug 2016 01:43:31 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM, T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:36892) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bYoCo-0003Qm-Vr for submit@debbugs.gnu.org; Sun, 14 Aug 2016 01:43:31 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33042) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bYoCm-0003r0-RK for bug-gnu-emacs@gnu.org; Sun, 14 Aug 2016 01:43:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bYoCi-0003QF-K0 for bug-gnu-emacs@gnu.org; Sun, 14 Aug 2016 01:43:27 -0400 Received: from mail-it0-x242.google.com ([2607:f8b0:4001:c0b::242]:36170) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bYoCi-0003PE-El for bug-gnu-emacs@gnu.org; Sun, 14 Aug 2016 01:43:24 -0400 Received: by mail-it0-x242.google.com with SMTP id j124so1602955ith.3 for ; Sat, 13 Aug 2016 22:43:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:content-transfer-encoding:subject:date:message-id:cc:to :mime-version; bh=nGtqHHXxw5Mxvzfd4cck++xULdPh23cbOK5DhFh7VY4=; b=pRwvQW39Gl6V9SHtgl6wtSZTT8kAZZDctHdpWu+YLjrkyjygD0p6TDMF7mQ6vGi0Lt tsgNSJoWVg1Eci0npFPuv00U0LBAlFfwRCMXxgjb4OIb/xrqM4OP6tra72B1hoWWAUNt 2P+SpfsYfVjm+5zB0ytzvzgVP2qadIBzxtxyqYFWYKA39CDVErl2HGqKebDvjbIYMZBU hXzkkzxmrRdj/C1cu1XjZAKzC1g97d3a3kCOga3KgZXT5xFdplULjE1oIEr18pkuCnTz OihHMqLsTZqZVmpeGjAbpkjyOOd9FS1QV/LialdXbvNWJk0qLx8IH7ndheAyVuiFIL0X ExPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:content-transfer-encoding:subject:date :message-id:cc:to:mime-version; bh=nGtqHHXxw5Mxvzfd4cck++xULdPh23cbOK5DhFh7VY4=; b=LswlE+RtZtIaupbbuLt+/nS7Txr2n8rKsh8TPLZ2ffc0Fz6r5pqKt6Qjge4vQMlmWM 6ecgzQ8ZBFGYsIH1dhkPE+GbK4HsUaRVTACdktfCvuZY14P1NDnAWWNR8BrlSHmj63dh EUTPRvpnc6jU3GxNHQHBJ/ogoNXDai+VKIMEDNY2I/aUfZAptg8yAqHXIfJrsm63K/Du op129e2ME4MAVW92jI+18TBeGlnaqn4GcSc8folabQZSJn110NaC9L3JAJmVBkZ2Mqh8 tDHrOquxYfB0IbW0gsMNlQ6XqIWbA57qFsgGyxQXwU2QEShVllABOMxE8G9H0BUfW2P1 n+PQ== X-Gm-Message-State: AEkoouvRUr/QX/JAHiT7xZCBhvupWnHUBUxfEtusXZ3qsvFWn1n7Wm8oDsrkza/FxBNZqw== X-Received: by 10.36.144.68 with SMTP id x65mr6849715itd.70.1471153403304; Sat, 13 Aug 2016 22:43:23 -0700 (PDT) Received: from [192.168.0.3] (97-117-19-144.slkc.qwest.net. [97.117.19.144]) by smtp.gmail.com with ESMTPSA id e66sm4660977itd.22.2016.08.13.22.43.22 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 13 Aug 2016 22:43:22 -0700 (PDT) From: Ivan Andrus Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Subject: 25.1; Error in ansi-color-filter-apply when control sequences are dropped Date: Sat, 13 Aug 2016 23:43:20 -0600 Message-Id: <27FDE7BF-9477-4987-B62A-B492DEFD0597@gmail.com> To: bug-gnu-emacs@gnu.org Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) X-Mailer: Apple Mail (2.3124) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit Cc: Daniel Colascione X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) In `ansi-color-filter-apply' the block "eliminate unrecognized escape sequences" occurs after the "find the next escape sequence" block. This is problematic because the variable start is set in the "next sequence" block and used in the "save context, add the remainder of the string to the result" block. However, dropping control sequences with `ansi-color-drop-regexp' can cause the string to shorten and start to point past the end of the string. I merely swapped the order of the first two blocks mentioned and was able to get past the error. But there are likely other places that need to be fixed as well. I have commit access, and can make the change (as well as tracking down other places where it might be necessary), but I would like some feedback on whether this is the right way solve it. Presumably there was a reason escape sequences were dropped after start was set up. -Ivan diff --git a/lisp/ansi-color.el b/lisp/ansi-color.el index 788a7bd..7cea2d9 100644 --- a/lisp/ansi-color.el +++ b/lisp/ansi-color.el @@ -258,14 +258,14 @@ ansi-color-filter-apply (if (cadr ansi-color-context) (setq string (concat (cadr ansi-color-context) string) ansi-color-context nil)) - ;; find the next escape sequence - (while (setq end (string-match ansi-color-regexp string start)) - (setq result (concat result (substring string start end)) - start (match-end 0))) ;; eliminate unrecognized escape sequences (while (string-match ansi-color-drop-regexp string) (setq string (replace-match "" nil nil string))) + ;; find the next escape sequence + (while (setq end (string-match ansi-color-regexp string start)) + (setq result (concat result (substring string start end)) + start (match-end 0))) ;; save context, add the remainder of the string to the result (let (fragment) (if (string-match "\033" string start) In GNU Emacs 25.1.2 (x86_64-apple-darwin15.5.0, NS appkit-1404.47 = Version 10.11.6 (Build 15G31)) of 2016-08-04 built on iandrus-osx Repository revision: 784291b06c4e4fe52f4c1aa15bc99874abc517c4 Windowing system distributor 'Apple', version 10.3.1404 Configured using: 'configure --with-ns --with-modules PKG_CONFIG_PATH=3D/opt/X11/lib/pkgconfig' Configured features: JPEG RSVG IMAGEMAGICK DBUS NOTIFY ACL GNUTLS LIBXML2 ZLIB TOOLKIT_SCROLL_BARS NS MODULES Important settings: value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix From debbugs-submit-bounces@debbugs.gnu.org Sun Aug 14 07:11:21 2016 Received: (at control) by debbugs.gnu.org; 14 Aug 2016 11:11:21 +0000 Received: from localhost ([127.0.0.1]:56800 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bYtK5-0000hs-0A for submit@debbugs.gnu.org; Sun, 14 Aug 2016 07:11:21 -0400 Received: from mail-io0-f169.google.com ([209.85.223.169]:34956) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bYtK3-0000he-7c for control@debbugs.gnu.org; Sun, 14 Aug 2016 07:11:19 -0400 Received: by mail-io0-f169.google.com with SMTP id m101so60163545ioi.2 for ; Sun, 14 Aug 2016 04:11:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:subject:date:message-id:mime-version; bh=DNgCLkv2PjtH3TtTKE4sV6YC+evVy9wXd8++E63U7Uk=; b=w+472xmHVrpfDTThsMAV2/Q/5PSVH4F4Uf8V0m7lN01iJrVTQXtC6M9chLV2qFv+VT IAlneXXILBHdOnHGny67mMvJoAvIhvfiJCDMGt8xmOIjr0lDlsGxWMRDJ0GTrI/Oc4G1 oMEvsoLJGxUgqlb5cEDzURy6KjD6ndMZqTXNJQFixcMq5trdNaxEZm/jJoo1YWuAKl7A nobnXqIVTgkol6mlBDLe/xB+sIJBCG4M6ZXxqpxiUMGwQD8TI8edcfXDEh/ptUbf852+ jf+5+iFsaYQFwC5oWk1c5c94LCQIKpEXZc7+XN1MO6JS2rEwjE70dndUC/NKjZDyx2b1 9ekQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:subject:date:message-id :mime-version; bh=DNgCLkv2PjtH3TtTKE4sV6YC+evVy9wXd8++E63U7Uk=; b=R1glZZiSNGH8RYf1SFfrTUKg63G26fdNKSLGudFSjfTcQ74GlVNtpbVXw0BX4+pnfC manJvx8iPRAXOK9w6GhkSxkA0aUgW981uTwRAIe68ua1O7fdJeb5448rl8d1NRPdOgIa RenboTdNcaw3doB1Xr5mB4HS9vsKZgXUBMy/dRrcceWNYtmcnTQz0oAEqzbX8n78OxgQ eZ/xe0TCSlrJGaupCbPHvQrGb0m3rOdoaMrxBiogfOTe/oO7dE3uc4ytsrA/xvMo4o8c fYnh7CARxQmr3qkeW4QoycR4Gb5r3GGZmQQxr6Wi6QWrKtOuhwdxCpDnY5lcGAw+UTiX cvXg== X-Gm-Message-State: AEkoousr3zrXj9utF3AvLxUyXH/wQt/zAhl9I7QeSjYuq3Z8y2tErDDbHQTyRcRYWCSe9Q== X-Received: by 10.107.131.11 with SMTP id f11mr27945404iod.136.1471173073543; Sun, 14 Aug 2016 04:11:13 -0700 (PDT) Received: from zony (206-188-64-44.cpe.distributel.net. [206.188.64.44]) by smtp.googlemail.com with ESMTPSA id o184sm5133383ith.2.2016.08.14.04.11.12 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 14 Aug 2016 04:11:12 -0700 (PDT) From: npostavs@users.sourceforge.net To: control@debbugs.gnu.org Subject: control message for bug #24223 Date: Sun, 14 Aug 2016 07:11:22 -0400 Message-ID: <87ziofvc4l.fsf@users.sourceforge.net> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) merge 24223 24189 quit From debbugs-submit-bounces@debbugs.gnu.org Wed Jan 11 13:19:49 2017 Received: (at control) by debbugs.gnu.org; 11 Jan 2017 18:19:49 +0000 Received: from localhost ([127.0.0.1]:50148 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cRNUz-0004tK-J0 for submit@debbugs.gnu.org; Wed, 11 Jan 2017 13:19:49 -0500 Received: from eggs.gnu.org ([208.118.235.92]:33520) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cRNUy-0004t5-48 for control@debbugs.gnu.org; Wed, 11 Jan 2017 13:19:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cRNUs-0002FV-Ca for control@debbugs.gnu.org; Wed, 11 Jan 2017 13:19:43 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:54522) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cRNUs-0002FN-9N for control@debbugs.gnu.org; Wed, 11 Jan 2017 13:19:42 -0500 Received: from rgm by fencepost.gnu.org with local (Exim 4.82) (envelope-from ) id 1cRNUr-0006h2-VK for control@debbugs.gnu.org; Wed, 11 Jan 2017 13:19:42 -0500 Subject: control message for bug 24189 To: X-Mailer: mail (GNU Mailutils 2.99.98) Message-Id: From: Glenn Morris Date: Wed, 11 Jan 2017 13:19:41 -0500 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -8.2 (--------) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -8.2 (--------) merge 21381 24189 From debbugs-submit-bounces@debbugs.gnu.org Wed Jan 11 13:20:54 2017 Received: (at control) by debbugs.gnu.org; 11 Jan 2017 18:20:54 +0000 Received: from localhost ([127.0.0.1]:50152 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cRNW1-0004vK-TI for submit@debbugs.gnu.org; Wed, 11 Jan 2017 13:20:54 -0500 Received: from eggs.gnu.org ([208.118.235.92]:33855) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cRNW0-0004v8-Dj for control@debbugs.gnu.org; Wed, 11 Jan 2017 13:20:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cRNVu-0002pv-Lf for control@debbugs.gnu.org; Wed, 11 Jan 2017 13:20:47 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:54539) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cRNVu-0002pr-IN for control@debbugs.gnu.org; Wed, 11 Jan 2017 13:20:46 -0500 Received: from rgm by fencepost.gnu.org with local (Exim 4.82) (envelope-from ) id 1cRNVt-0006qQ-NP for control@debbugs.gnu.org; Wed, 11 Jan 2017 13:20:45 -0500 Subject: control message for bug 21381 To: X-Mailer: mail (GNU Mailutils 2.99.98) Message-Id: From: Glenn Morris Date: Wed, 11 Jan 2017 13:20:45 -0500 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -8.2 (--------) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -8.2 (--------) notfound 21381 24.5 From debbugs-submit-bounces@debbugs.gnu.org Wed Jan 11 13:23:11 2017 Received: (at control) by debbugs.gnu.org; 11 Jan 2017 18:23:11 +0000 Received: from localhost ([127.0.0.1]:50156 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cRNYF-0004zs-87 for submit@debbugs.gnu.org; Wed, 11 Jan 2017 13:23:11 -0500 Received: from eggs.gnu.org ([208.118.235.92]:34830) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cRNYD-0004zd-4N for control@debbugs.gnu.org; Wed, 11 Jan 2017 13:23:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cRNY7-0004tN-Ap for control@debbugs.gnu.org; Wed, 11 Jan 2017 13:23:04 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:54569) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cRNY7-0004tD-7l for control@debbugs.gnu.org; Wed, 11 Jan 2017 13:23:03 -0500 Received: from rgm by fencepost.gnu.org with local (Exim 4.82) (envelope-from ) id 1cRNY6-00070s-Tv for control@debbugs.gnu.org; Wed, 11 Jan 2017 13:23:03 -0500 Subject: control message for bug 24655 To: X-Mailer: mail (GNU Mailutils 2.99.98) Message-Id: From: Glenn Morris Date: Wed, 11 Jan 2017 13:23:02 -0500 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -8.2 (--------) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -8.2 (--------) block 24655 by 24223 From debbugs-submit-bounces@debbugs.gnu.org Thu Jan 12 11:44:22 2017 Received: (at control) by debbugs.gnu.org; 12 Jan 2017 16:44:22 +0000 Received: from localhost ([127.0.0.1]:51735 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cRiUA-0002OD-Dw for submit@debbugs.gnu.org; Thu, 12 Jan 2017 11:44:22 -0500 Received: from eggs.gnu.org ([208.118.235.92]:59888) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cRiU9-0002Nr-G3 for control@debbugs.gnu.org; Thu, 12 Jan 2017 11:44:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cRiTt-0000c9-AM for control@debbugs.gnu.org; Thu, 12 Jan 2017 11:44:09 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:40051) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cRiTt-0000c5-6u for control@debbugs.gnu.org; Thu, 12 Jan 2017 11:44:05 -0500 Received: from rgm by fencepost.gnu.org with local (Exim 4.82) (envelope-from ) id 1cRiTs-00005r-T4 for control@debbugs.gnu.org; Thu, 12 Jan 2017 11:44:04 -0500 Subject: control message for bug 21966 To: X-Mailer: mail (GNU Mailutils 2.99.98) Message-Id: From: Glenn Morris Date: Thu, 12 Jan 2017 11:44:04 -0500 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -8.2 (--------) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -8.2 (--------) block 21966 by 24223 From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 15 23:42:50 2017 Received: (at 24223) by debbugs.gnu.org; 16 Jun 2017 03:42:50 +0000 Received: from localhost ([127.0.0.1]:50062 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dLi9q-0004ZQ-03 for submit@debbugs.gnu.org; Thu, 15 Jun 2017 23:42:50 -0400 Received: from mail-it0-f41.google.com ([209.85.214.41]:38830) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dLi9o-0004ZF-8B for 24223@debbugs.gnu.org; Thu, 15 Jun 2017 23:42:48 -0400 Received: by mail-it0-f41.google.com with SMTP id b205so6512479itg.1 for <24223@debbugs.gnu.org>; Thu, 15 Jun 2017 20:42:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=i9lrHN2VKuPXYo22TfMLjM+Q80RPdhNqNkYT0XwBMD4=; b=lrVypPqiKgDoP87Dtb2I4yDk1y/5+oDcxqcrJ93T3kkOTn6USgQPZQvUp32+LlWCvI Y5+SUlaUl6LbZgpdpHr76n/CTdaETfA5g2jX6VHWsiS9v0y14KH08gGEOgPZXM7nLxRj Eh5boruY97i2l0a6jNVkIj7NMtC4gRPV85yRbfBrBZto/VIbzQuSIteAuLwiQuJq1Evw lhIeVswuixN1p4nLJ0/th3/fBfer1uB7ny8JFR9Pt04vo/LDydGG5173Bxd9qpaFgC8B 9IQAAK78Zgy7Z4N8qUlWYb7hy2u1uMMOq5ST2KloNKOOujlwhQ+162/q5+4pARwiRjMb aahA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=i9lrHN2VKuPXYo22TfMLjM+Q80RPdhNqNkYT0XwBMD4=; b=FBzL1S3FuhZMtfM9B2hC9m0xYLofNUWVTzj2WetOmrIcpilwhFVqYiUbiKlp1aiFrB CJoP/sq/N7XNXRtP7Fjvaewd+Ue10IVQq45tk4RYQ0JDX+z8h25Akia6rp7aaq1zTZkN GNPcirDd1QT0NykK/Gijg9UdHQMgXQuhnmDWkyoZlo5OFwhz/sULMXZ+Z8LuWzJP/quS zDvziMCCjTHC+ZeoSSRHrLC4nUI95VG4Oy1GGRy6iMxm1vyppVPNAXyVRWC6W3HSEJAL VT2rWTDNYrD23N0otY5YSICEjUHDI3QWDYouRtqmrlspQyfgpgES6R9FwEmzz9uhjEXB E3hg== X-Gm-Message-State: AKS2vOwe4J7/qe2JNueAVhGeymhEUw0gtk/HecilPxf233/SBgYH4v9i WIMi6ysfbm430A== X-Received: by 10.36.81.20 with SMTP id s20mr8232315ita.29.1497584562498; Thu, 15 Jun 2017 20:42:42 -0700 (PDT) Received: from zony ([45.2.7.65]) by smtp.googlemail.com with ESMTPSA id m129sm595775iom.27.2017.06.15.20.42.40 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 15 Jun 2017 20:42:40 -0700 (PDT) From: npostavs@users.sourceforge.net To: Ivan Andrus Subject: Re: bug#24223: 25.1; Error in ansi-color-filter-apply when control sequences are dropped References: <27FDE7BF-9477-4987-B62A-B492DEFD0597@gmail.com> Date: Thu, 15 Jun 2017 23:44:19 -0400 In-Reply-To: <27FDE7BF-9477-4987-B62A-B492DEFD0597@gmail.com> (Ivan Andrus's message of "Sat, 13 Aug 2016 23:43:20 -0600") Message-ID: <87k24csijw.fsf@users.sourceforge.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2.50 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 24223 Cc: Daniel Colascione , 24223@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) --=-=-= Content-Type: text/plain Ivan Andrus writes: > I merely swapped the order of the first two blocks mentioned and was > able to get past the error. But there are likely other places that need > to be fixed as well. > > I have commit access, and can make the change (as well as tracking down > other places where it might be necessary), but I would like some > feedback on whether this is the right way solve it. Presumably there > was a reason escape sequences were dropped after start was set up. I think this method of using 2 different regexps to match the escape sequences is an over complication, I propose to simplify: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=v1-0001-Fix-and-simplify-ansi-escape-detection-Bug-21381.patch Content-Description: patch >From 91b386f8da95c0e69095ea8d64eeb1af19daf3cc Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Thu, 15 Jun 2017 23:23:44 -0400 Subject: [PATCH v1] Fix and simplify ansi escape detection (Bug#21381) * lisp/ansi-color.el (ansi-color-regexp, ansi-color-drop-regexp): Remove. (ansi-color-control-seq-regexp): New constant, matches all escape sequences. (ansi-color-filter-apply, ansi-color-apply) (ansi-color-filter-region, ansi-color-apply-on-region): Use it instead of matching color sequences separately from ignored sequences. Differentiate color sequences simply by checking the last character. --- lisp/ansi-color.el | 115 ++++++++++++++++++++++------------------------------- 1 file changed, 48 insertions(+), 67 deletions(-) diff --git a/lisp/ansi-color.el b/lisp/ansi-color.el index 47437bb7c8..a1b4933175 100644 --- a/lisp/ansi-color.el +++ b/lisp/ansi-color.el @@ -150,17 +150,14 @@ (defcustom ansi-color-names-vector :version "24.4" ; default colors copied from `xterm-standard-colors' :group 'ansi-colors) -(defconst ansi-color-regexp "\033\\[\\([0-9;]*m\\)" - "Regexp that matches SGR control sequences.") - -(defconst ansi-color-drop-regexp - "\033\\[\\([ABCDsuK]\\|[12][JK]\\|=[0-9]+[hI]\\|[0-9;]*[Hf]\\|\\?[0-9]+[hl]\\)" - "Regexp that matches ANSI control sequences to silently drop.") +(defconst ansi-color-control-seq-regexp + ;; See ECMA 48, section 5.4 "Control Sequences". + "\e\\[[\x30-\x3F]*[\x20-\x2F]*[\x40-\x7E]" + "Regexp matching an ANSI control sequence.") (defconst ansi-color-parameter-regexp "\\([0-9]*\\)[m;]" "Regexp that matches SGR control sequence parameters.") - ;; Convenience functions for comint modes (eg. shell-mode) @@ -259,22 +256,20 @@ (defun ansi-color-filter-apply (string) (setq string (concat (cadr ansi-color-context) string) ansi-color-context nil)) ;; find the next escape sequence - (while (setq end (string-match ansi-color-regexp string start)) - (setq result (concat result (substring string start end)) - start (match-end 0))) - ;; eliminate unrecognized escape sequences - (while (string-match ansi-color-drop-regexp string) - (setq string - (replace-match "" nil nil string))) + (while (setq end (string-match ansi-color-control-seq-regexp string start)) + (push (substring string start end) result) + (setq start (match-end 0))) ;; save context, add the remainder of the string to the result (let (fragment) - (if (string-match "\033" string start) - (let ((pos (match-beginning 0))) - (setq fragment (substring string pos) - result (concat result (substring string start pos)))) - (setq result (concat result (substring string start)))) + (push (substring string start + (if (string-match "\033" string start) + (let ((pos (match-beginning 0))) + (setq fragment (substring string pos)) + pos) + nil)) + result) (setq ansi-color-context (if fragment (list nil fragment)))) - result)) + (apply #'concat (nreverse result)))) (defun ansi-color--find-face (codes) "Return the face corresponding to CODES." @@ -306,35 +301,29 @@ (defun ansi-color-apply (string) This function can be added to `comint-preoutput-filter-functions'." (let ((codes (car ansi-color-context)) - (start 0) end escape-sequence result - colorized-substring) + (start 0) end result) ;; If context was saved and is a string, prepend it. (if (cadr ansi-color-context) (setq string (concat (cadr ansi-color-context) string) ansi-color-context nil)) ;; Find the next escape sequence. - (while (setq end (string-match ansi-color-regexp string start)) - (setq escape-sequence (match-string 1 string)) - ;; Colorize the old block from start to end using old face. - (when codes - (put-text-property start end 'font-lock-face (ansi-color--find-face codes) string)) - (setq colorized-substring (substring string start end) - start (match-end 0)) - ;; Eliminate unrecognized ANSI sequences. - (while (string-match ansi-color-drop-regexp colorized-substring) - (setq colorized-substring - (replace-match "" nil nil colorized-substring))) - (push colorized-substring result) - ;; Create new face, by applying escape sequence parameters. - (setq codes (ansi-color-apply-sequence escape-sequence codes))) + (while (setq end (string-match ansi-color-control-seq-regexp string start)) + (let ((esc-end (match-end 0))) + ;; Colorize the old block from start to end using old face. + (when codes + (put-text-property start end 'font-lock-face + (ansi-color--find-face codes) string)) + (push (substring string start end) result) + (setq start (match-end 0)) + ;; If this is a color escape sequence, + (when (eq (aref string (1- esc-end)) ?m) + ;; create a new face from it. + (setq codes (ansi-color-apply-sequence + (substring string end esc-end) codes))))) ;; if the rest of the string should have a face, put it there (when codes (put-text-property start (length string) 'font-lock-face (ansi-color--find-face codes) string)) - ;; eliminate unrecognized escape sequences - (while (string-match ansi-color-drop-regexp string) - (setq string - (replace-match "" nil nil string))) ;; save context, add the remainder of the string to the result (let (fragment) (if (string-match "\033" string start) @@ -367,13 +356,9 @@ (defun ansi-color-filter-region (begin end) (start (or (cadr ansi-color-context-region) begin))) (save-excursion (goto-char start) - ;; Delete unrecognized escape sequences. - (while (re-search-forward ansi-color-drop-regexp end-marker t) - (replace-match "")) - (goto-char start) - ;; Delete SGR escape sequences. - (while (re-search-forward ansi-color-regexp end-marker t) - (replace-match "")) + ;; Delete escape sequences. + (while (re-search-forward ansi-color-control-seq-regexp end-marker t) + (delete-region (match-beginning 0) (match-end 0))) ;; save context, add the remainder of the string to the result (if (re-search-forward "\033" end-marker t) (setq ansi-color-context-region (list nil (match-beginning 0))) @@ -400,28 +385,24 @@ (defun ansi-color-apply-on-region (begin end) (let ((codes (car ansi-color-context-region)) (start-marker (or (cadr ansi-color-context-region) (copy-marker begin))) - (end-marker (copy-marker end)) - escape-sequence) - ;; First, eliminate unrecognized ANSI control sequences. - (save-excursion - (goto-char start-marker) - (while (re-search-forward ansi-color-drop-regexp end-marker t) - (replace-match ""))) + (end-marker (copy-marker end))) (save-excursion (goto-char start-marker) - ;; Find the next SGR sequence. - (while (re-search-forward ansi-color-regexp end-marker t) - ;; Colorize the old block from start to end using old face. - (funcall ansi-color-apply-face-function - start-marker (match-beginning 0) - (ansi-color--find-face codes)) - ;; store escape sequence and new start position - (setq escape-sequence (match-string 1) - start-marker (copy-marker (match-end 0))) - ;; delete the escape sequence - (replace-match "") - ;; Update the list of ansi codes. - (setq codes (ansi-color-apply-sequence escape-sequence codes))) + ;; Find the next escape sequence. + (while (re-search-forward ansi-color-control-seq-regexp end-marker t) + ;; Remove escape sequence. + (let ((esc-seq (delete-and-extract-region + (match-beginning 0) (point)))) + ;; Colorize the old block from start to end using old face. + (funcall ansi-color-apply-face-function + (prog1 (marker-position start-marker) + ;; Store new start position. + (set-marker start-marker (point))) + (match-beginning 0) (ansi-color--find-face codes)) + ;; If this is a color sequence, + (when (eq (aref esc-seq (1- (length esc-seq))) ?m) + ;; update the list of ansi codes. + (setq codes (ansi-color-apply-sequence esc-seq codes))))) ;; search for the possible start of a new escape sequence (if (re-search-forward "\033" end-marker t) (progn -- 2.11.1 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Mon Jul 03 10:10:20 2017 Received: (at 24223) by debbugs.gnu.org; 3 Jul 2017 14:10:20 +0000 Received: from localhost ([127.0.0.1]:50412 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dS23P-0003yQ-VF for submit@debbugs.gnu.org; Mon, 03 Jul 2017 10:10:20 -0400 Received: from mail-it0-f68.google.com ([209.85.214.68]:35516) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dS23O-0003y8-80; Mon, 03 Jul 2017 10:10:18 -0400 Received: by mail-it0-f68.google.com with SMTP id v193so9029920itc.2; Mon, 03 Jul 2017 07:10:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=LZAMX3hXKyJS1EILMRGVYFJJMwTvzbK+8nFlfzhjOfs=; b=SI8nteizfoS08PmRsAk56sgRw45w0eLmvptwFQSbsbXMzhbgIhR9wWk+v3B+ghy9br uiXPH7ffnHlhyHSbcbyn+QFGmu/N6Uy44PdPKpPxvyT+08joF5Eeu8kzBfVxid3y8Z9y 9ThNNIKQ3Za0ozqMkTcoKoEH/YGrMu4rvTVJIQWYdSZ9LTxn19E0u/WWp+tqa6OoUcH3 KvZpTnCFu7Qs7p/hSaCCuyqVDNmt1MG9ZdK+hl5c/zPKe3a60bsDtJb3dovtAipnlInM xf2FV3hrHYQ7k0fqTNBi3XyH+wg/K2atjDiyjCQ7Wr9Zd+c3gHqyRR6kpWE5Ii7oeaCn 1O1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=LZAMX3hXKyJS1EILMRGVYFJJMwTvzbK+8nFlfzhjOfs=; b=Q9cEIR7SsTrC0glUCGDh3utw3YroNO24FqdwuFTT4srxeJegl4ivkm50WF80diSUlJ mQryNvenEHdGDZFIv8noJCJp8xCior1J9PUVWl4S8mYioET85lT3go0YpZ6UghemijeN Cibxon9CBue8M4g551ekrUvTHTwBghxOeaPvBloLa30qIgg2ztQHwnUYD03lTOAwxAfP HklF8YPz2mJWX1PK0fmhPugT9Gq+7mxMCIj0u4PUP6+ToCCQUzBRHQURJlvFKFJcTDJB Xx9DHdmGUkVEniSIcSGKYtEiykJkE/TzaJ9zFMsUMvlZViCX7LupD3OlnIpNWmnzWRYw 2Pww== X-Gm-Message-State: AKS2vOxl8BhaWBndJKGTde+4v1mLK/a4tz0itMx3e155MOEM4rZTQxZB gpeCvXAmiZGP/E8V X-Received: by 10.36.110.23 with SMTP id w23mr30876763itc.24.1499091012438; Mon, 03 Jul 2017 07:10:12 -0700 (PDT) Received: from zony ([45.2.7.65]) by smtp.googlemail.com with ESMTPSA id s135sm10183964ita.2.2017.07.03.07.10.11 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 03 Jul 2017 07:10:11 -0700 (PDT) From: npostavs@users.sourceforge.net To: Ivan Andrus Subject: Re: bug#24223: 25.1; Error in ansi-color-filter-apply when control sequences are dropped References: <27FDE7BF-9477-4987-B62A-B492DEFD0597@gmail.com> <87k24csijw.fsf@users.sourceforge.net> Date: Mon, 03 Jul 2017 10:11:48 -0400 In-Reply-To: <87k24csijw.fsf@users.sourceforge.net> (npostavs@users.sourceforge.net's message of "Thu, 15 Jun 2017 23:44:19 -0400") Message-ID: <87bmp1k3tn.fsf@users.sourceforge.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: 24223 Cc: Daniel Colascione , 24223@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.2 (/) tags 24223 fixed close 24223 26.1 quit npostavs@users.sourceforge.net writes: > I think this method of using 2 different regexps to match the escape > sequences is an over complication, I propose to simplify: Pushed to master. [1: 35ed01dfb3]: 2017-07-03 10:09:40 -0400 Fix and simplify ansi escape detection (Bug#21381) http://git.savannah.gnu.org/cgit/emacs.git/commit/?id=35ed01dfb3f811a997e26d843e9971eb6b81b125 From debbugs-submit-bounces@debbugs.gnu.org Mon Jul 03 11:23:10 2017 Received: (at control) by debbugs.gnu.org; 3 Jul 2017 15:23:10 +0000 Received: from localhost ([127.0.0.1]:50506 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dS3Bu-0000tG-38 for submit@debbugs.gnu.org; Mon, 03 Jul 2017 11:23:10 -0400 Received: from mail-io0-f180.google.com ([209.85.223.180]:34919) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dS3Bs-0000sz-Gv; Mon, 03 Jul 2017 11:23:08 -0400 Received: by mail-io0-f180.google.com with SMTP id h134so58487312iof.2; Mon, 03 Jul 2017 08:23:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=JK48izfVujWAlAlHtd+PubBQm4gTJdLyOSH95APEILI=; b=rWEEWoqJqedZ5PAm2R0V1Km3ql7nli33NId8/SqRrLcnPKNYMhAP+eS5QTHrnwXC80 kMZStRAd8r93D/Xh/DFyV1W8uJcQHk+iLW8VbJV9iD4rr9Ois9iIUfKTARSj5/OXtTSk pPX2jZZC2h/NjSVzEMq1Z+2vC1kQTZAqgU2XhqD7EYyQPwLGDthJQctht873Xms+TbE+ tLkyXvz56Trr+h7FnWaPWFv12+UN5pJxnoc4toCyy8Rg6p7WVuJbQGAbEON8+uvNzVRm 2zk90e7XJUTslbQibsDPETWatpVa0JuYuzVLb60qjNzRv0CN8kJRs5BHJ1QU0azJUVvH VydQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=JK48izfVujWAlAlHtd+PubBQm4gTJdLyOSH95APEILI=; b=hkRHMcRxK48O8qMpE+ZIqR8A2/4HXqG9c5z6hlrWm5GckG1TF9fsG0c78GpAZlTWB2 CzjFX6tuSC0Zd4HK6I1KHWIUGpamQNpfFtfKiQGx0Tl5y58FzOxtm+P7KsYQDWi3XyK1 NYYHAlzJpMrEYCYaEHVWcTvQWEjp5qkfc7d8xWwmvYnCxjsUvZ4AMcA/+AutqzsWeWCu FbpALhYB4qiFGXqA88xI+AhjLN5q3wClWqPeWXKwzRXvFmPULzF8pMtj87m+ICsqUQoy zdbu4xKuLmhEqOyvsJ7+iP4/elxVCTcPGh9hmvZbVWnu3uKnOZkQPXRSRY47bTf8EgJT MNLA== X-Gm-Message-State: AIVw110bAE6/ynu/yR6RAHJ4dVoZyZU7k5deH72nOEBUNzmwPi+S1VQK /pZqKoJJ1M8u86xH X-Received: by 10.107.23.4 with SMTP id 4mr2569623iox.110.1499095382573; Mon, 03 Jul 2017 08:23:02 -0700 (PDT) Received: from zony ([45.2.7.65]) by smtp.googlemail.com with ESMTPSA id j21sm2925357itb.15.2017.07.03.08.23.01 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 03 Jul 2017 08:23:01 -0700 (PDT) From: npostavs@users.sourceforge.net To: "XP Chen" Subject: Re: bug#25306: emacs 25.1 cannot deal with the newer ipython (5.1.0) inferior ansi color References: <145c557a.d8.1595385e43e.Coremail.chxp_moon@163.com> Date: Mon, 03 Jul 2017 11:24:38 -0400 In-Reply-To: <145c557a.d8.1595385e43e.Coremail.chxp_moon@163.com> (XP Chen's message of "Sat, 31 Dec 2016 14:16:40 +0800 (CST)") Message-ID: <8737adk0g9.fsf@users.sourceforge.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.1 (--) X-Debbugs-Envelope-To: control Cc: 25306@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.1 (--) forcemerge 21381 25306 quit "XP Chen" writes: > > When send python script to the ipython inferior, it shows: > > Python 3.5.2 (default, Nov 7 2016, 11:31:36) > Type "copyright", "credits" or "license" for more information. > > IPython 5.1.0 -- An enhanced Interactive Python. > ? -> Introduction and overview of IPython's features. > %quickref -> Quick reference. > help -> Python's own help system. > object? -> Details about 'object', use 'object??' for extra details. > Using matplotlib backend: TkAgg > > [J--------------------------------------------------------------------------- > NameError Traceback (most recent call last) > in () > ----> 1 execfile(r'/tmp/py-shell-completion-setup-code.py') # PYTHON-MODE > > NameError: name 'execfile' is not defined > > [J--------------------------------------------------------------------------- > NameError Traceback (most recent call last) > in () > ----> 1 execfile(r'/tmp/ipython-1723HV1.py') # PYTHON-MODE > > NameError: name 'execfile' is not defined > > [J[6n[JIn [3]: > [8D[8C[8D[J[6n[JIn > [3]: > [8D[8C[8D[J[6n[JIn > [3]: > [8D[8C[8D[J[6n[JIn > [3]: > [8D[8C[8D[J[6n[JIn > [3]: > [8D[8C[8D[J[6n[JIn > [3]: > [8D[8C[8D[J[6n[JIn > [3]: > [8D[8C[8D[J[6n[JIn > [3]: [8D[8C > > The problem of NameError: name 'execfile' is not defined can ignored > it. However the ansi color of ipython cannot deal with the emacs25.1 As far as I can tell, this is the same as Bug#21381; the fix for that one solves this as well. From unknown Sat Aug 09 04:56:03 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 01 Aug 2017 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator