From unknown Fri Aug 15 03:56:55 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#17699 <17699@debbugs.gnu.org> To: bug#17699 <17699@debbugs.gnu.org> Subject: Status: Various tildify.el improvements Reply-To: bug#17699 <17699@debbugs.gnu.org> Date: Fri, 15 Aug 2025 10:56:55 +0000 retitle 17699 Various tildify.el improvements reassign 17699 emacs submitter 17699 Michal Nazarewicz severity 17699 minor thanks From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 05 07:24:51 2014 Received: (at submit) by debbugs.gnu.org; 5 Jun 2014 11:24:52 +0000 Received: from localhost ([127.0.0.1]:44795 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WsVmt-0007cZ-82 for submit@debbugs.gnu.org; Thu, 05 Jun 2014 07:24:51 -0400 Received: from eggs.gnu.org ([208.118.235.92]:51723) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WsVmq-0007cM-WF for submit@debbugs.gnu.org; Thu, 05 Jun 2014 07:24:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WsVmh-0003rM-8J for submit@debbugs.gnu.org; Thu, 05 Jun 2014 07:24:43 -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 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:36874) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WsVmh-0003rI-5F for submit@debbugs.gnu.org; Thu, 05 Jun 2014 07:24:39 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53297) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WsVmb-00016m-8Q for bug-gnu-emacs@gnu.org; Thu, 05 Jun 2014 07:24:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WsVmW-0003oz-U2 for bug-gnu-emacs@gnu.org; Thu, 05 Jun 2014 07:24:33 -0400 Received: from mail-we0-f202.google.com ([74.125.82.202]:36689) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WsVmW-0003ol-OG for bug-gnu-emacs@gnu.org; Thu, 05 Jun 2014 07:24:28 -0400 Received: by mail-we0-f202.google.com with SMTP id p10so85539wes.1 for ; Thu, 05 Jun 2014 04:24:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-type:content-transfer-encoding; bh=28foePN1OGT01Msk4yq74Zaw8o3+FlrKTin6Q3J5B8k=; b=D2zj2tInLVb0glrhW7u7Gdz1iHW/keN7XlwCyS8BZqro6tN3UeLIWO6RaPt5+Y0oB2 XKfffP+0kSeBaaX8q7q0HglaP2a0NKsU1WxWXYuO8t3Yt02oxdhpr6sD7ZB7nbPjhHeK 3dMH9eYErwGTFtLgnesR0CREvUMh61mjNEfqNhYOQ8++ZUyLRCnqi8wpobcNF+5vcc74 VSQz0aswT5rTOYk6sv6PtuRZTAIJ43++ThZAJOn6kMF5gqNYZEsI7boparv1muc6ko+V 2iUWbq3cTsmf5N2+wgIU4vqdA9NkhiZkYva1LmBN0AZIJ4wkb48IVIivcuuMm0fWzm9g nzhg== X-Gm-Message-State: ALoCoQmoC+J/uE845bNgRoCyV3Y2ZIMgsV0knL3hIiK1ba3nVZdF2tUQnvrQZzdsULeTnC6hjaobNgT7Vu9G8UIdzjbBlFcqE2H/ECcLK8xz3krkPcWBotr5Do9ZZDLxh+8YV23wdRuJ X-Received: by 10.180.212.12 with SMTP id ng12mr2210812wic.7.1401967467440; Thu, 05 Jun 2014 04:24:27 -0700 (PDT) Received: from corp2gmr1-1.eem.corp.google.com (corp2gmr1-1.eem.corp.google.com [172.25.138.99]) by gmr-mx.google.com with ESMTPS id xk11si903721wib.0.2014.06.05.04.24.27 for (version=TLSv1.1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 05 Jun 2014 04:24:27 -0700 (PDT) Received: from hpgntag-ubiq62.eem.corp.google.com (hpgntag-ubiq62.eem.corp.google.com [172.25.135.103]) by corp2gmr1-1.eem.corp.google.com (Postfix) with ESMTP id 511EF1CA355 for ; Thu, 5 Jun 2014 04:24:27 -0700 (PDT) Received: by hpgntag-ubiq62.eem.corp.google.com (Postfix, from userid 126942) id 2C54B10B5A1; Thu, 5 Jun 2014 13:24:27 +0200 (CEST) From: Michal Nazarewicz To: bug-gnu-emacs@gnu.org Subject: Various tildify.el improvements Date: Thu, 5 Jun 2014 13:24:26 +0200 Message-Id: <1401967466-14607-1-git-send-email-mina86@mina86.com> X-Mailer: git-send-email 2.0.0.526.g5318336 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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 (----) Various patches to lisp/textmodes/tildify.el file. The changes do not introduce any significant functionality changes. I have one more patch addinc `auto-tildify-mode' but I'm currently testing it and not yet ready to submit. The changes do not contain `tildify-ignored-environments-alist' format changes discussed with Stefan[1]. Those are left for maybe a future patch. [1] http://lists.gnu.org/archive/html/emacs-devel/2014-06/msg00056.html The whole series, including the `auto-tildify-mode' patch, can also be seen at: https://github.com/mina86/emacs/tree/tildify git pull git://github.com/mina86/emacs tildify Michal Nazarewicz (7): tildify.el: Fix end-regex building in `tildify-find-env' tildify.el: Fix matched group indexes in end-regex building tildify.el: Improve defcustom's types. tildify.el: Better support for XML tildify.el: Optimise environments regexes tildify.el: Rewrite `tildify-region' and co., add foreach function. * tests/automated/tildify-tests.el (tildify-test--test): Optimise the test slightly by reusing the same temporary buffer across multiple test cases. lisp/ChangeLog | 105 +++++++++++++++++ lisp/textmodes/tildify.el | 245 ++++++++++++++++++++-------------------- test/ChangeLog | 25 ++++ test/automated/tildify-tests.el | 47 ++++++-- 4 files changed, 290 insertions(+), 132 deletions(-) -- 2.0.0.526.g5318336 From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 05 07:27:55 2014 Received: (at 17699) by debbugs.gnu.org; 5 Jun 2014 11:27:56 +0000 Received: from localhost ([127.0.0.1]:44804 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WsVpr-0007l6-5e for submit@debbugs.gnu.org; Thu, 05 Jun 2014 07:27:55 -0400 Received: from mail-we0-f202.google.com ([74.125.82.202]:39251) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WsVpo-0007kO-0v for 17699@debbugs.gnu.org; Thu, 05 Jun 2014 07:27:52 -0400 Received: by mail-we0-f202.google.com with SMTP id p10so85746wes.3 for <17699@debbugs.gnu.org>; Thu, 05 Jun 2014 04:27:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=ckREhIapeVOGnPWhZsYw8jFYJ8a8IkxEm8feyLPGNow=; b=OTttebpGE7QLRy6AQkGrGAng1gWECjm+qlea0QeHtMiB5m9Kw8jP4TQ4Qj93RGkvS7 K2YPeG/5J+VzuXhrVC51vEyBJfWKPGb9M24XioMgwOP2jGG/XnFzgRThwahuESc1uCuJ /eVwLN9YcR4BzE+Og+C0UwPbWVf8CqCOc0+dMc4TG5g79cebS5LE5pW1TuK+d5FNJ5V1 49Cel1cN+iavCZws4vZxBo9htIzwDpLOrexfi3vP/Am7SWY9a3mE6myWADEWtS6vpLGd fp2N+5T+3pQ8BLy1v0FdzhFUbROMz/FqMDuyCW/8JPicRe5SxCRWbWtM/RFr+52Iugdx NXbw== X-Gm-Message-State: ALoCoQmBfep9rbsOofTeR5EnRXhzVJ+lZEBZo0/DQpqhmt5sVkyjyiBBlLnQ+Qqg4wAOJ14D6jJ4j6568TAsamN4kXY240X1OwyKt6il5KfhCci3mdlTT6vzVFadnJRcKJ1gvOu2ywk+ X-Received: by 10.112.73.232 with SMTP id o8mr6593704lbv.0.1401967666190; Thu, 05 Jun 2014 04:27:46 -0700 (PDT) Received: from corp2gmr1-1.eem.corp.google.com (corp2gmr1-1.eem.corp.google.com [172.25.138.99]) by gmr-mx.google.com with ESMTPS id s1si901282wiw.3.2014.06.05.04.27.46 for <17699@debbugs.gnu.org> (version=TLSv1.1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 05 Jun 2014 04:27:46 -0700 (PDT) Received: from hpgntag-ubiq62.eem.corp.google.com (hpgntag-ubiq62.eem.corp.google.com [172.25.135.103]) by corp2gmr1-1.eem.corp.google.com (Postfix) with ESMTP id 10B191CA357 for <17699@debbugs.gnu.org>; Thu, 5 Jun 2014 04:27:46 -0700 (PDT) Received: by hpgntag-ubiq62.eem.corp.google.com (Postfix, from userid 126942) id DBB4B10B597; Thu, 5 Jun 2014 13:27:45 +0200 (CEST) From: Michal Nazarewicz To: 17699@debbugs.gnu.org Subject: [PATCH 7/7] * tests/automated/tildify-tests.el (tildify-test--test): Optimise the test slightly by reusing the same temporary buffer across multiple test cases. Date: Thu, 5 Jun 2014 13:27:36 +0200 Message-Id: <1401967656-16171-7-git-send-email-mina86@mina86.com> X-Mailer: git-send-email 2.0.0.526.g5318336 In-Reply-To: <1401967656-16171-1-git-send-email-mina86@mina86.com> References: <1401967656-16171-1-git-send-email-mina86@mina86.com> X-Spam-Score: -1.4 (-) X-Debbugs-Envelope-To: 17699 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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: -1.4 (-) --- test/ChangeLog | 4 ++++ test/automated/tildify-tests.el | 10 +++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/test/ChangeLog b/test/ChangeLog index 6248d6c..bb8ed89 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,5 +1,9 @@ 2014-06-05 Michal Nazarewicz + * automated/tildify-tests.el (tildify-test--test): Optimise the test + slightly by reusing the same temporary buffer across multiple test + cases. + * automated/tildify-tests.el (tildify-test-find-env-end-re-bug) (tildify-test-find-env-group-index-bug): Update to support new signature of the `tildify-foreach-region-outside-env' function. diff --git a/test/automated/tildify-tests.el b/test/automated/tildify-tests.el index cf18320..86c83d7 100644 --- a/test/automated/tildify-tests.el +++ b/test/automated/tildify-tests.el @@ -54,16 +54,16 @@ If IS-XML is non-nil,
 tag is not treated specially."
   "Test tildify running in MODES.
 INPUT is the initial content of the buffer and EXPECTED is expected result
 after `tildify-buffer' is run."
-  (dolist (mode modes)
-    (with-temp-buffer
+  (with-temp-buffer
+    (dolist (mode modes)
+      (erase-buffer)
       (funcall mode)
       (let ((header (concat "Testing `tildify-buffer' in "
                             (symbol-name mode) "\n")))
         (insert header input)
         (tildify-buffer t)
-        (should (string-equal (concat header expected) (buffer-string)))))
-    (with-temp-buffer
-      (funcall mode)
+        (should (string-equal (concat header expected) (buffer-string))))
+      (erase-buffer)
       (let ((header (concat "Testing `tildify-region' in "
                             (symbol-name mode) "\n")))
         (insert header input)
-- 
2.0.0.526.g5318336





From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 05 07:27:56 2014
Received: (at 17699) by debbugs.gnu.org; 5 Jun 2014 11:27:56 +0000
Received: from localhost ([127.0.0.1]:44806 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from )
	id 1WsVpr-0007lD-UZ
	for submit@debbugs.gnu.org; Thu, 05 Jun 2014 07:27:56 -0400
Received: from mail-we0-f201.google.com ([74.125.82.201]:36145)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from ) id 1WsVpo-0007kN-67
 for 17699@debbugs.gnu.org; Thu, 05 Jun 2014 07:27:53 -0400
Received: by mail-we0-f201.google.com with SMTP id w62so85909wes.2
 for <17699@debbugs.gnu.org>; Thu, 05 Jun 2014 04:27:46 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20130820;
 h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to
 :references;
 bh=wNJuFK3/RGPF+dxvXarRFUVUh0bQjw3n+XQS//nYpvs=;
 b=T6A/CJ+vf5ju2PdyUsL4IBbd1iBbGx0yBvkWNOreRdSZ1sSx8wLO27G05W6WyfrFV/
 H4PtuebN4haI7nkUAdOgFezM60xfEyBq9px7VFzyNFFajtxMbeD6HiVLY4sAS0NiYJlP
 VHMvQo4hRCQ/6xDDC6OfVaq7j/VCPOATBqH+HhC0tl7jsix6ytpCSFEtEV6gU1bi26ac
 LUJhQoy28tuNrfGXKvdQlRcSpWEJ0TPmr0D2Ccmc6ahNkjb1CW8cKUU8ht6Rdxlu+GZ8
 zjgw48O94BsGS9Fv5IWZ/pNPBoUPi8yhqWFbLf4P3hYr6yxpFbqAvmvSG7ZfxaOnXbX5
 HTMw==
X-Gm-Message-State: ALoCoQl60Jj4hMWWjOzV/TZ0ngVHWJCgzS4NPAHGYbTKBi9Ue6goGlgXvQAG3xDUXxlO6numYLRpn7pJaDK6vZWebObS7As7xpen1VmuAiHi/pVMCGamHExkKIpXNPiV+4M5zQroLc/x
X-Received: by 10.152.29.169 with SMTP id l9mr6528163lah.3.1401967666255;
 Thu, 05 Jun 2014 04:27:46 -0700 (PDT)
Received: from corp2gmr1-2.eem.corp.google.com
 (corp2gmr1-2.eem.corp.google.com [172.25.138.117])
 by gmr-mx.google.com with ESMTPS id ck3si212789wib.0.2014.06.05.04.27.46
 for <17699@debbugs.gnu.org>
 (version=TLSv1.1 cipher=ECDHE-RSA-AES128-SHA bits=128/128);
 Thu, 05 Jun 2014 04:27:46 -0700 (PDT)
Received: from hpgntag-ubiq62.eem.corp.google.com
 (hpgntag-ubiq62.eem.corp.google.com [172.25.135.103])
 by corp2gmr1-2.eem.corp.google.com (Postfix) with ESMTP id 12FC11E4312
 for <17699@debbugs.gnu.org>; Thu,  5 Jun 2014 04:27:46 -0700 (PDT)
Received: by hpgntag-ubiq62.eem.corp.google.com (Postfix, from userid 126942)
 id E6A7010B66B; Thu,  5 Jun 2014 13:27:45 +0200 (CEST)
From: Michal Nazarewicz 
To: 17699@debbugs.gnu.org
Subject: [PATCH 5/7] tildify.el: Optimise environments regexes
Date: Thu,  5 Jun 2014 13:27:34 +0200
Message-Id: <1401967656-16171-5-git-send-email-mina86@mina86.com>
X-Mailer: git-send-email 2.0.0.526.g5318336
In-Reply-To: <1401967656-16171-1-git-send-email-mina86@mina86.com>
References: <1401967656-16171-1-git-send-email-mina86@mina86.com>
X-Spam-Score: -1.4 (-)
X-Debbugs-Envelope-To: 17699
X-BeenThere: debbugs-submit@debbugs.gnu.org
X-Mailman-Version: 2.1.15
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: -1.4 (-)

* lisp/textmodes/tildify.el (tildify-ignored-environments-alist):
Each time beginning of an environment to ignore is found,
`tildify-find-env' needs to identify regexp for the ending
of the environment.  This is done by trying all the opening
regexes on matched text in a loop, so to speed that up, this
loop should have fewer things to match, which can be done by
using alternatives in the opening regexes.

Coincidentally, this should make matching of the opening
regexp faster as well thanks to the use of `regexp-opt' and
having common prefix pulled from many regexes.
---
 lisp/ChangeLog            | 14 ++++++++++++++
 lisp/textmodes/tildify.el | 37 +++++++++++++++----------------------
 2 files changed, 29 insertions(+), 22 deletions(-)

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index c662add..0351d54 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,19 @@
 2014-06-05  Michal Nazarewicz  
 
+	* textmodes/tildify.el (tildify-ignored-environments-alist):
+	Optimise environments regexes
+
+	Each time beginning of an environment to ignore is found,
+	`tildify-find-env' needs to identify regexp for the ending
+	of the environment.  This is done by trying all the opening
+	regexes on matched text in a loop, so to speed that up, this
+	loop should have fewer things to match, which can be done by
+	using alternatives in the opening regexes.
+
+	Coincidentally, this should make matching of the opening
+	regexp faster as well thanks to the use of `regexp-opt' and
+	having common prefix pulled from many regexes.
+
 	* textmodes/tildify.el (tildify-string-alist)
 	(tildify-ignored-environments-alist): Add `nxml-mode' to the list
 	of supported modes since `xml-mode' is no longer a thing but just
diff --git a/lisp/textmodes/tildify.el b/lisp/textmodes/tildify.el
index 6dd471d..39ccad7 100644
--- a/lisp/textmodes/tildify.el
+++ b/lisp/textmodes/tildify.el
@@ -119,42 +119,35 @@ mode, the item for the mode SYMBOL is looked up in the alist instead."
                                (symbol :tag "Like other")))))
 
 (defcustom tildify-ignored-environments-alist
-  '((latex-mode
+  `((latex-mode
      ("\\\\\\\\" . "")		; do not remove this
-     ("\\\\begin{verbatim}" . "\\\\end{verbatim}")
+     (,(eval-when-compile (concat
+                           "\\\\begin{\\("
+                           (regexp-opt '("verbatim" "math" "displaymath"
+                                         "equation" "eqnarray" "eqnarray*"))
+                           "\\)}"))
+      . ("\\\\end{" 1 "}"))
      ("\\\\verb\\*?\\(.\\)" . (1))
-     ("\\$\\$" . "\\$\\$")
-     ("\\$" . "\\$")
+     ("\\$\\$?" . (0))
      ("\\\\(" . "\\\\)")
      ("\\\\[[]" . "\\\\[]]")
-     ("\\\\begin{math}" . "\\\\end{math}")
-     ("\\\\begin{displaymath}" . "\\\\end{displaymath}")
-     ("\\\\begin{equation}" . "\\\\end{equation}")
-     ("\\\\begin{eqnarray\\*?}" . "\\\\end{eqnarray\\*?}")
      ("\\\\[a-zA-Z]+\\( +\\|{}\\)[a-zA-Z]*" . "")
      ("%" . "$"))
     (plain-tex-mode . latex-mode)
     (html-mode
-     ("]*>" . "
") - ("" . "") - ("" . "") - ("" . "") - ("" . "") - ("" . "") - ("]*>" . "") - ("" . "") - ("" . "") - ("" . "") - ("" . "") - ("" . "") + (,(eval-when-compile (concat + "<\\(" + (regexp-opt '("pre" "dfn" "code" "samp" "kbd" "var" + "PRE" "DFN" "CODE" "SAMP" "KBD" "VAR")) + "\\)\\>[^>]*>")) + . ("")) ("") ("<" . ">")) (sgml-mode . html-mode) (xml-mode ("") ("<" . ">")) - (nxml-mode . xml-mode) - (t nil)) + (nxml-mode . xml-mode)) "Alist specifying ignored structured text environments. Parts of text defined in this alist are skipped without performing hard space insertion on them. These setting allow skipping text parts like verbatim or -- 2.0.0.526.g5318336 From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 05 07:27:57 2014 Received: (at 17699) by debbugs.gnu.org; 5 Jun 2014 11:27:58 +0000 Received: from localhost ([127.0.0.1]:44808 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WsVps-0007lR-Ml for submit@debbugs.gnu.org; Thu, 05 Jun 2014 07:27:57 -0400 Received: from mail-wg0-f74.google.com ([74.125.82.74]:43260) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WsVpo-0007kR-33 for 17699@debbugs.gnu.org; Thu, 05 Jun 2014 07:27:53 -0400 Received: by mail-wg0-f74.google.com with SMTP id x12so86134wgg.5 for <17699@debbugs.gnu.org>; Thu, 05 Jun 2014 04:27:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-type:content-transfer-encoding; bh=e1je2C3XsVHRQr4YMy0Sk25+gm9uSXRCKI92HsVF7r4=; b=Gy0+lNnkXfJDiWGagVcA1G5rlJwkA60XnjVxrZjI50V+4JQrrfGW5jT6EErOF+1//q CCpNlNOPc2GMbLV9chQlHS4HwujnMq3On+i+pWmc0bcGM1D8Z2ScyHOneL5zn+0cZrBU iWVO5Wb5k93y09f215YkpT7Qx19Wr+V2I4pNVyz0yh2NBcpyDUl8LnID14NUS/4TuYrI jFF15Qgk72ouIOylX6FZbzUpnWWOzMSjtnRAR3uvqLRiM1t4stJYxvK6bp8h/mE+Y/Jh bjwmTqT3PxJYDK6zTjGvKMeLk8DWfpo7VPX1PsXPag63aK51uWm9xQV9Max1xjYWcAmp SYww== X-Gm-Message-State: ALoCoQmIoJUEruWSMonZIS64duYhd30UikCXlnt7SRDDDkb8JGacrBRXj8CXVoRH/IlpD+Gr8MGw2EDNDulwP2Z0M5PuFh8/90ke/YbGQBs4UxAvQbiH72TO7CPQQ6ISQ36qHHj9W7iQ X-Received: by 10.112.168.198 with SMTP id zy6mr3228123lbb.15.1401967666287; Thu, 05 Jun 2014 04:27:46 -0700 (PDT) Received: from corp2gmr1-1.eem.corp.google.com (corp2gmr1-1.eem.corp.google.com [172.25.138.99]) by gmr-mx.google.com with ESMTPS id xk11si905540wib.0.2014.06.05.04.27.46 for <17699@debbugs.gnu.org> (version=TLSv1.1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 05 Jun 2014 04:27:46 -0700 (PDT) Received: from hpgntag-ubiq62.eem.corp.google.com (hpgntag-ubiq62.eem.corp.google.com [172.25.135.103]) by corp2gmr1-1.eem.corp.google.com (Postfix) with ESMTP id 12AFA1CA358 for <17699@debbugs.gnu.org>; Thu, 5 Jun 2014 04:27:46 -0700 (PDT) Received: by hpgntag-ubiq62.eem.corp.google.com (Postfix, from userid 126942) id E5CDF10B5A1; Thu, 5 Jun 2014 13:27:45 +0200 (CEST) From: Michal Nazarewicz To: 17699@debbugs.gnu.org Subject: [PATCH 4/7] tildify.el: Better support for XML Date: Thu, 5 Jun 2014 13:27:33 +0200 Message-Id: <1401967656-16171-4-git-send-email-mina86@mina86.com> X-Mailer: git-send-email 2.0.0.526.g5318336 In-Reply-To: <1401967656-16171-1-git-send-email-mina86@mina86.com> References: <1401967656-16171-1-git-send-email-mina86@mina86.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -1.4 (-) X-Debbugs-Envelope-To: 17699 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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: -1.4 (-) * lisp/textmodes/tildify.el (tildify-string-alist) (tildify-ignored-environments-alist): Add `nxml-mode' to the list of supported modes since `xml-mode' is no longer a thing but just an alias to the former. Also include comments and insides of tags in `tildify-ignored-environments-alist' for XML modes. Finally, since XML does not define “ ”[1], use a numeric reference for a no-break space (namely “ ”) [1] XML specification defines only a handful of predefined entities. The list is at and includes only <, >, &, ' and " (meaning <, >, &, ' and " respectively). This is in contrast to HTML and even XHTML which defined a whole bunch of entities including “ ”. * automated/tildify-tests.el (tildify-test--example-html): Add support for generating XML code, so that… (tildify-test-xml) …test can be added to check handling of XML documents. --- lisp/ChangeLog | 14 ++++++++++++++ lisp/textmodes/tildify.el | 7 ++++++- test/ChangeLog | 5 +++++ test/automated/tildify-tests.el | 15 ++++++++++++--- 4 files changed, 37 insertions(+), 4 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 487e21c..c662add 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,19 @@ 2014-06-05 Michal Nazarewicz + * textmodes/tildify.el (tildify-string-alist) + (tildify-ignored-environments-alist): Add `nxml-mode' to the list + of supported modes since `xml-mode' is no longer a thing but just + an alias to the former. Also include comments and insides of tags + in `tildify-ignored-environments-alist' for XML modes. Finally, + since XML does not define “ ”[1], use a numeric reference for + a no-break space (namely “ ”) + + [1] XML specification defines only a handful of predefined entities. + The list is at + and includes only <, >, &, ' and " (meaning <, + >, &, ' and " respectively). This is in contrast to HTML and even + XHTML which defined a whole bunch of entities including “ ”. + * textmodes/tildify.el (tildify-pattern-alist) (tildify-string-alist, tildify-ignored-environments-alist): Improve defcustom's types by adding more tags explaining what each diff --git a/lisp/textmodes/tildify.el b/lisp/textmodes/tildify.el index d61998a..6dd471d 100644 --- a/lisp/textmodes/tildify.el +++ b/lisp/textmodes/tildify.el @@ -90,8 +90,9 @@ mode, the item for the mode SYMBOL is looked up in the alist instead." (tex-mode . latex-mode) (plain-tex-mode . latex-mode) (sgml-mode . " ") - (xml-mode . sgml-mode) (html-mode . sgml-mode) + (xml-mode . " ") ; XML does not define  , use numeric reference + (nxml-mode . xml-mode) (t . " ")) "Alist specifying what is a hard space in the current major mode. @@ -149,6 +150,10 @@ mode, the item for the mode SYMBOL is looked up in the alist instead." ("") ("<" . ">")) (sgml-mode . html-mode) + (xml-mode + ("") + ("<" . ">")) + (nxml-mode . xml-mode) (t nil)) "Alist specifying ignored structured text environments. Parts of text defined in this alist are skipped without performing hard space diff --git a/test/ChangeLog b/test/ChangeLog index 93ef098..38a4feb 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,5 +1,10 @@ 2014-06-05 Michal Nazarewicz + * automated/tildify-tests.el (tildify-test--example-html): Add support + for generating XML code, so that… + (tildify-test-xml) …test can be added to check handling of XML + documents. + * automated/tildify-tests.el (tildify-test-find-env-group-index-bug): New test checking end-regex building when multiple environment pairs use integers to refer to capture groups. diff --git a/test/automated/tildify-tests.el b/test/automated/tildify-tests.el index 6fee28b..dd404fc 100644 --- a/test/automated/tildify-tests.el +++ b/test/automated/tildify-tests.el @@ -36,14 +36,15 @@ "consectetur adipiscing elit.")) -(defun tildify-test--example-html (sentence &optional with-nbsp) +(defun tildify-test--example-html (sentence &optional with-nbsp is-xml) "Return an example HTML code. SENTENCE is placed where spaces should not be replaced with hard spaces, and WITH-NBSP is placed where spaces should be replaced with hard spaces. If the -latter is missing, SENTENCE will be used in all placeholder positions." +latter is missing, SENTENCE will be used in all placeholder positions. +If IS-XML is non-nil,
 tag is not treated specially."
   (let ((with-nbsp (or with-nbsp sentence)))
     (concat "

" with-nbsp "

\n" - "
" sentence "
\n" + "
" (if is-xml with-nbsp sentence) "
\n" "\n" "

" with-nbsp "

\n" "<" sentence ">\n"))) @@ -77,6 +78,14 @@ after `tildify-buffer' is run." (tildify-test--example-html sentence sentence) (tildify-test--example-html sentence with-nbsp)))) +(ert-deftest tildify-test-xml () + "Tests tildification in an XML document" + (let* ((sentence (tildify-test--example-sentence " ")) + (with-nbsp (tildify-test--example-sentence " "))) + (tildify-test--test '(nxml-mode) + (tildify-test--example-html sentence sentence t) + (tildify-test--example-html sentence with-nbsp t)))) + (defun tildify-test--example-tex (sentence &optional with-nbsp) "Return an example (La)Tex code. -- 2.0.0.526.g5318336 From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 05 07:28:01 2014 Received: (at 17699) by debbugs.gnu.org; 5 Jun 2014 11:28:01 +0000 Received: from localhost ([127.0.0.1]:44812 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WsVpv-0007lm-V2 for submit@debbugs.gnu.org; Thu, 05 Jun 2014 07:28:00 -0400 Received: from mail-lb0-f201.google.com ([209.85.217.201]:57700) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WsVpo-0007kP-B5 for 17699@debbugs.gnu.org; Thu, 05 Jun 2014 07:27:55 -0400 Received: by mail-lb0-f201.google.com with SMTP id s7so85791lbd.0 for <17699@debbugs.gnu.org>; Thu, 05 Jun 2014 04:27:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-type:content-transfer-encoding; bh=FOGW/gpJiMgFqaWkMNtJzR5ncXtrcbo4M2FK8BM9Ny4=; b=cGMKTSfPCkHtkyXVCRLZaZWbtIPz/2qSzfl+xye9tmjKgJC8yO+ocYX50rszBNynvd iopQX/pHWafZoHKICkcMBslstgjSbo7v8F7WMGhkTTgsGzAVqytsvBHvY1Fr7AlRgMsu kBZso50amltfEBm6RvHtS4GXSC1ap3SlnhCnE7wxCBDtvyf15Qc6lIhDY6ShogCutsW6 tIl+yRGwfNfEnlnex2IBfBucE3+npFfp8N7OWFA7MQMShsTF3BxJmTYqd+MSBH8oALdk nRE0q5nuee14NVdU0QtJCKtmZ3P2TQpeybMUhlrwwdEgBG+35xXgEJWdgxG1pAdQPfUP uyhw== X-Gm-Message-State: ALoCoQkDal2+gpENzOWjtjE4kufKhs2RIM9XKfl+dTPTav+yMhnjcZmnDEjGd6+jhhOJGLDYnu+JUHB1N0EMdIzKl0gvEgkL1PZZRwoto2IJw8Z8WzYCJq0OOo6kXLqCgPDyCRWft6rj X-Received: by 10.112.11.229 with SMTP id t5mr6646288lbb.10.1401967666110; Thu, 05 Jun 2014 04:27:46 -0700 (PDT) Received: from corp2gmr1-1.eem.corp.google.com (corp2gmr1-1.eem.corp.google.com [172.25.138.99]) by gmr-mx.google.com with ESMTPS id e12si1271305wiv.1.2014.06.05.04.27.46 for <17699@debbugs.gnu.org> (version=TLSv1.1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 05 Jun 2014 04:27:46 -0700 (PDT) Received: from hpgntag-ubiq62.eem.corp.google.com (hpgntag-ubiq62.eem.corp.google.com [172.25.135.103]) by corp2gmr1-1.eem.corp.google.com (Postfix) with ESMTP id EF20B1CA354 for <17699@debbugs.gnu.org>; Thu, 5 Jun 2014 04:27:45 -0700 (PDT) Received: by hpgntag-ubiq62.eem.corp.google.com (Postfix, from userid 126942) id CA33610B6B4; Thu, 5 Jun 2014 13:27:45 +0200 (CEST) From: Michal Nazarewicz To: 17699@debbugs.gnu.org Subject: [PATCH 1/7] tildify.el: Fix end-regex building in `tildify-find-env' Date: Thu, 5 Jun 2014 13:27:30 +0200 Message-Id: <1401967656-16171-1-git-send-email-mina86@mina86.com> X-Mailer: git-send-email 2.0.0.526.g5318336 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -1.4 (-) X-Debbugs-Envelope-To: 17699 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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: -1.4 (-) * lisp/textmodes/tildify.el (tildify-find-env): The `tildify-ignored-environments-alist' allows the end-regex to be provided not as a static string but mix of strings and indexes of groups matched the begin-regex. For example, the “\verb!…!” TeX-command (where “!” is an arbitrary character) is handled using: ("\\\\verb\\*?\\(.\\)" . (1)) In the same way, the following should be supported as well: ("open-\\(.\\)" . ("end-" 1)) However the tildify-find-env function fails at (concat result (if (stringp (setq aux (car expression))) expression ; BUG: expression is a list (regexp-quote (match-string aux)))) where the string part is handled incorrectly. The most trivial fix would be to replace `expression' in the true-part of the if-statement with `aux', but instead, this commit optimises `tildify-find-env' by changing it to use `mapconcat' rather than open-coded while-loop. * tests/automated/tildify-tests.el (tildify-test-find-env-end-re-bug): New test validating fix to the above bug. --- lisp/ChangeLog | 31 +++++++++++++++++++++++++++++++ lisp/textmodes/tildify.el | 40 ++++++++++++++++++---------------------- test/ChangeLog | 6 ++++++ test/automated/tildify-tests.el | 11 +++++++++++ 4 files changed, 66 insertions(+), 22 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index a6ae6f8..dc3c42a 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,34 @@ +2014-06-05 Michal Nazarewicz + + * textmodes/tildify.el (tildify-find-env): Fix end-regex building + in `tildify-find-env' + + The `tildify-ignored-environments-alist' allows the end-regex to + be provided not as a static string but mix of strings and indexes + of groups matched the begin-regex. For example, the “\verb!…!” + TeX-command (where “!” is an arbitrary character) is handled + using: + + ("\\\\verb\\*?\\(.\\)" . (1)) + + In the same way, the following should be supported as well: + + ("open-\\(.\\)" . ("end-" 1)) + + However the tildify-find-env function fails at + + (concat result + (if (stringp (setq aux (car expression))) + expression ; BUG: expression is a list + (regexp-quote (match-string aux)))) + + where the string part is handled incorrectly. + + The most trivial fix would be to replace `expression' in the + true-part of the if-statement with `aux', but instead, this commit + optimises `tildify-find-env' by changing it to use `mapconcat' + rather than open-coded while-loop. + 2014-06-03 Rüdiger Sonderfeld * register.el: Add link to Emacs manual in Commentary. diff --git a/lisp/textmodes/tildify.el b/lisp/textmodes/tildify.el index 339f900..7e4b39b 100644 --- a/lisp/textmodes/tildify.el +++ b/lisp/textmodes/tildify.el @@ -3,7 +3,7 @@ ;; Copyright (C) 1997-2014 Free Software Foundation, Inc. ;; Author: Milan Zamazal -;; Version: 4.5.1 +;; Version: 4.5.2 ;; Keywords: text, TeX, SGML, wp ;; This file is part of GNU Emacs. @@ -270,27 +270,23 @@ won't be prompted for confirmation of each substitution." Return regexp for the end of the environment or nil if no environment was found." ;; Find environment - (if (re-search-forward regexp nil t) - ;; Build end-env regexp - (let ((match (match-string 0)) - (alist (tildify-mode-alist tildify-ignored-environments-alist)) - expression) - (save-match-data - (while (not (eq (string-match (caar alist) match) 0)) - (setq alist (cdr alist)))) - (if (stringp (setq expression (cdar alist))) - expression - (let ((result "") - aux) - (while expression - (setq result (concat result - (if (stringp (setq aux (car expression))) - expression - (regexp-quote (match-string aux))))) - (setq expression (cdr expression))) - result))) - ;; Return nil if not found - nil)) + (when (re-search-forward regexp nil t) + ;; Build end-env regexp + (let ((match (match-string 0)) + (alist (tildify-mode-alist tildify-ignored-environments-alist))) + (save-match-data + (while (not (eq (string-match (caar alist) match) 0)) + (setq alist (cdr alist)))) + (let ((expression (cdar alist))) + (if (stringp expression) + expression + (mapconcat + (lambda (expr) + (if (stringp expr) + expr + (regexp-quote (match-string expr)))) + expression + "")))))) (defun tildify-tildify (beg end ask) "Add tilde characters in the region between BEG and END. diff --git a/test/ChangeLog b/test/ChangeLog index b6b3dd3..db32aae 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,9 @@ +2014-06-05 Michal Nazarewicz + + * automated/tildify-tests.el (tildify-test-find-env-end-re-bug): New + test checking end-regex building in `tildify-find-env' function when + integers (denoting capture groups) and strings are mixed together. + 2014-06-02 Michael Albinus * automated/tramp-tests.el (tramp-remote-process-environment): Declare. diff --git a/test/automated/tildify-tests.el b/test/automated/tildify-tests.el index 4223029..25e9f22 100644 --- a/test/automated/tildify-tests.el +++ b/test/automated/tildify-tests.el @@ -101,6 +101,17 @@ latter is missing, SENTENCE will be used in all placeholder positions." (tildify-test--example-tex sentence sentence) (tildify-test--example-tex sentence with-nbsp)))) + +(ert-deftest tildify-test-find-env-end-re-bug () + "Tests generation of end-regex using mix of indexes and strings" + (with-temp-buffer + (let ((tildify-ignored-environments-alist + `((,major-mode ("foo\\|bar" . ("end-" 0)))))) + (insert "foo whatever end-foo") + (goto-char (point-min)) + (should (string-equal "end-foo" (tildify-find-env "foo\\|bar")))))) + + (provide 'tildify-tests) ;;; tildify-tests.el ends here -- 2.0.0.526.g5318336 From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 05 07:28:02 2014 Received: (at 17699) by debbugs.gnu.org; 5 Jun 2014 11:28:02 +0000 Received: from localhost ([127.0.0.1]:44814 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WsVpx-0007lq-2Q for submit@debbugs.gnu.org; Thu, 05 Jun 2014 07:28:02 -0400 Received: from mail-we0-f201.google.com ([74.125.82.201]:53078) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WsVpt-0007kS-8t for 17699@debbugs.gnu.org; Thu, 05 Jun 2014 07:27:57 -0400 Received: by mail-we0-f201.google.com with SMTP id w62so85720wes.4 for <17699@debbugs.gnu.org>; Thu, 05 Jun 2014 04:27:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-type:content-transfer-encoding; bh=a3vfvz2Nz+LWJNiAF7nnpGYTq+6GWVWoCoTdW3HnjME=; b=iLRkQFyI1KdzoEydTTsbtC1J16geGLmdpe3MtnL140R1/x7rBB376geE7tlERL5Xtc wfag2SS3HNLtyxBW7Jy51t2LbN2N8+k22QYTvHPr5JRizNrlgRU9EBkvwDzymPeL5DjJ kniOZ21/sD7etFUyExj03fNeS9jaA+LObSSf2m/wLFA5Z6wSyX0FVPa51O3Fcs0EBoeW xWgiTpAw+pNJGfvg1mn0HJTVQB4rPsyKmpn2U402gdtdBKtcsHAG7rrNnzGLhZ1t2kIq b1c4k6So99gNJHqmdbPRasR46FZUrel/SnF33WBIxVke/9rzTui3lfo2Pi1bVDIRT+Jp +NIA== X-Gm-Message-State: ALoCoQn3ngOFPSGq6Le2GKKWnAuw0xECr3b7YKjyJvI7WISjF6L2j5k+7hc2DBf3ws6zFOv4CrmgwlCJkELEZGQCuBXzQJ1s4pBZ++UGFLM6YZsSlvWlGc1M4voRv/7J7Qfdu5CcY7bK X-Received: by 10.181.13.196 with SMTP id fa4mr2221607wid.6.1401967666353; Thu, 05 Jun 2014 04:27:46 -0700 (PDT) Received: from corp2gmr1-2.eem.corp.google.com (corp2gmr1-2.eem.corp.google.com [172.25.138.117]) by gmr-mx.google.com with ESMTPS id eh2si903080wib.2.2014.06.05.04.27.46 for <17699@debbugs.gnu.org> (version=TLSv1.1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 05 Jun 2014 04:27:46 -0700 (PDT) Received: from hpgntag-ubiq62.eem.corp.google.com (hpgntag-ubiq62.eem.corp.google.com [172.25.135.103]) by corp2gmr1-2.eem.corp.google.com (Postfix) with ESMTP id 339D31E4316 for <17699@debbugs.gnu.org>; Thu, 5 Jun 2014 04:27:46 -0700 (PDT) Received: by hpgntag-ubiq62.eem.corp.google.com (Postfix, from userid 126942) id E891310B6FA; Thu, 5 Jun 2014 13:27:45 +0200 (CEST) From: Michal Nazarewicz To: 17699@debbugs.gnu.org Subject: [PATCH 3/7] tildify.el: Improve defcustom's types Date: Thu, 5 Jun 2014 13:27:32 +0200 Message-Id: <1401967656-16171-3-git-send-email-mina86@mina86.com> X-Mailer: git-send-email 2.0.0.526.g5318336 In-Reply-To: <1401967656-16171-1-git-send-email-mina86@mina86.com> References: <1401967656-16171-1-git-send-email-mina86@mina86.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -1.4 (-) X-Debbugs-Envelope-To: 17699 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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: -1.4 (-) * lisp/textmodes/tildify.el (tildify-pattern-alist) (tildify-string-alist, tildify-ignored-environments-alist): Add more tags explaining what each value means and replace “sexp” used in `tildify-ignored-environments-alist' with a full type declaration. --- lisp/ChangeLog | 6 ++++++ lisp/textmodes/tildify.el | 32 +++++++++++++++++++++++++++++--- 2 files changed, 35 insertions(+), 3 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 523b2a9..487e21c 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,11 @@ 2014-06-05 Michal Nazarewicz + * textmodes/tildify.el (tildify-pattern-alist) + (tildify-string-alist, tildify-ignored-environments-alist): + Improve defcustom's types by adding more tags explaining what each + value means and replace “sexp” used in + `tildify-ignored-environments-alist' with a full type declaration. + * textmodes/tildify.el (tildify-find-env): Fix matched group indexes in end-regex building diff --git a/lisp/textmodes/tildify.el b/lisp/textmodes/tildify.el index 7aa338e..d61998a 100644 --- a/lisp/textmodes/tildify.el +++ b/lisp/textmodes/tildify.el @@ -77,7 +77,13 @@ by the hard space character. The form (MAJOR-MODE . SYMBOL) defines alias item for MAJOR-MODE. For this mode, the item for the mode SYMBOL is looked up in the alist instead." :group 'tildify - :type '(repeat (choice (list symbol regexp integer) (cons symbol symbol)))) + :type '(repeat (cons :tag "Entry for major mode" + (choice (const :tag "Default" t) + (symbol :tag "Major mode")) + (choice (list :tag "Regexp" + regexp + (integer :tag "Group ")) + (symbol :tag "Like other"))))) (defcustom tildify-string-alist '((latex-mode . "~") @@ -104,7 +110,12 @@ for SGML. The form (MAJOR-MODE . SYMBOL) defines alias item for MAJOR-MODE. For this mode, the item for the mode SYMBOL is looked up in the alist instead." :group 'tildify - :type '(repeat (cons symbol (choice string symbol)))) + :type '(repeat (cons :tag "Entry for major mode" + (choice (const :tag "Default" t) + (symbol :tag "Major mode")) + (choice (const :tag "No-break space (U+00A0)" "\u00A0") + (string :tag "String ") + (symbol :tag "Like other"))))) (defcustom tildify-ignored-environments-alist '((latex-mode @@ -160,7 +171,22 @@ END-REGEX defines end of the corresponding text part and can be either: subexpressions of BEG-REGEX (this is used to solve cases like \\\\verb in TeX)." :group 'tildify - :type '(repeat (cons symbol (choice symbol (repeat sexp))))) + :type '(repeat + (cons :tag "Entry for major mode" + (choice (const :tag "Default" t) + (symbol :tag "Major mode")) + (choice + (const :tag "None") + (repeat + :tag "Environments" + (cons :tag "Regexp pair" + (regexp :tag "Open ") + (choice :tag "Close" + (regexp :tag "Regexp") + (list :tag "Regexp and groups (concatenated)" + (choice (regexp :tag "Regexp") + (integer :tag "Group ")))))) + (symbol :tag "Like other"))))) ;;; *** Internal variables *** -- 2.0.0.526.g5318336 From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 05 07:28:05 2014 Received: (at 17699) by debbugs.gnu.org; 5 Jun 2014 11:28:05 +0000 Received: from localhost ([127.0.0.1]:44816 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WsVpz-0007md-M7 for submit@debbugs.gnu.org; Thu, 05 Jun 2014 07:28:04 -0400 Received: from mail-la0-f73.google.com ([209.85.215.73]:48588) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WsVpo-0007kT-FQ for 17699@debbugs.gnu.org; Thu, 05 Jun 2014 07:28:00 -0400 Received: by mail-la0-f73.google.com with SMTP id e16so85946lan.2 for <17699@debbugs.gnu.org>; Thu, 05 Jun 2014 04:27:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-type:content-transfer-encoding; bh=r3tKJ4wm9AjAvV5zMxl2sThwFXn4rrO2/FTpJMC+LHE=; b=mxSMnGfi4+raJN6J4wcrx+lQJauqkPHahFGE6Cwml5Dp/Sd4EHe698H3oi2GTBoU4s hBezF7IzQLNLEEJu3jCJcsme5UAjAu8ZBi6QFoDG1xTNlDoC5mGOpNUjxzn/ZqU+aD8v exJacEaCYCCZ1p8ool7fjLrO8qDKSOfAy9hPcxrdxsrdE52K1Oee1Kt85wnzrnOh0IQN 2cgGSfRkOCQpz21si1ffWKFHiT1Q0B5WGTtpZJMfBRMAP1dvdqkvTuWE4HwZgX3mQduo yR533de/BP11uH0oqUdiGfgprLXNxt7M/t9fRXYC7CXPyeld9TCV5iFVHUb+ZqFu6Syy MLaQ== X-Gm-Message-State: ALoCoQlUl3CAOBqYkgIt5bBfaoLDXjtP6d0XX6iz+6+tjdp7eCGQ6bbuqCEt8Qx2ejjAhYAp3u7AzIv7y+XAngE0nj7N7IKkZKZff9N8EdTCzK7OIDO492qdoZEl7zptr8hvYFDF8ByJ X-Received: by 10.15.35.134 with SMTP id g6mr3239295eev.3.1401967666362; Thu, 05 Jun 2014 04:27:46 -0700 (PDT) Received: from corp2gmr1-1.eem.corp.google.com (corp2gmr1-1.eem.corp.google.com [172.25.138.99]) by gmr-mx.google.com with ESMTPS id s1si901287wiw.3.2014.06.05.04.27.46 for <17699@debbugs.gnu.org> (version=TLSv1.1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 05 Jun 2014 04:27:46 -0700 (PDT) Received: from hpgntag-ubiq62.eem.corp.google.com (hpgntag-ubiq62.eem.corp.google.com [172.25.135.103]) by corp2gmr1-1.eem.corp.google.com (Postfix) with ESMTP id 14D021CA35C for <17699@debbugs.gnu.org>; Thu, 5 Jun 2014 04:27:46 -0700 (PDT) Received: by hpgntag-ubiq62.eem.corp.google.com (Postfix, from userid 126942) id E7B3A10B6E3; Thu, 5 Jun 2014 13:27:45 +0200 (CEST) From: Michal Nazarewicz To: 17699@debbugs.gnu.org Subject: [PATCH 6/7] tildify.el: Rewrite `tildify-region' and co., add foreach function. Date: Thu, 5 Jun 2014 13:27:35 +0200 Message-Id: <1401967656-16171-6-git-send-email-mina86@mina86.com> X-Mailer: git-send-email 2.0.0.526.g5318336 In-Reply-To: <1401967656-16171-1-git-send-email-mina86@mina86.com> References: <1401967656-16171-1-git-send-email-mina86@mina86.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -1.4 (-) X-Debbugs-Envelope-To: 17699 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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: -1.4 (-) * lisp/textmodes/tildify.el (tildify-foreach-region-outside-env): New function which calls a callback on portions of the buffer that are outside of ignored environments. (tildify-build-regexp): Remove function since it is now incorporated in `tildify-foreach-region-outside-env' where it is optimised and simplified by the use of `mapconcat'. (tildify-tildify): Return number of substitutions made so that… (tildify-count): …can be removed. (tildify-find-env): Accept a new PAIRS argument which was previously looked up in `tildify-ignored-environments-alist' each time the function was called. With this change, the lookup is performed only once in `tildify-foreach-region-outside-env'. (tildify-region): Greatly simplify the function since now most of the work is done by `tildify-foreach-region-outside-env'. (tildify-mode-alist): Simplify slightly by avoiding if and setq and instead using or. * tests/automated/tildify-tests.el (tildify-test-find-env-end-re-bug) (tildify-test-find-env-group-index-bug): Update to support new signature of the `tildify-foreach-region-outside-env' function. Namely, it now takes pairs as an argument instead of looking it up in `tildify-ignored-environments-alist'. --- lisp/ChangeLog | 17 +++++ lisp/textmodes/tildify.el | 145 +++++++++++++++++----------------------- test/ChangeLog | 6 ++ test/automated/tildify-tests.el | 17 +++-- 4 files changed, 92 insertions(+), 93 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 0351d54..075a424 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,22 @@ 2014-06-05 Michal Nazarewicz + * textmodes/tildify.el (tildify-foreach-region-outside-env): New + function which calls a callback on portions of the buffer that are + outside of ignored environments. + (tildify-build-regexp): Remove function since it is now + incorporated in `tildify-foreach-region-outside-env' where it is + optimised and simplified by the use of `mapconcat'. + (tildify-tildify): Return number of substitutions made so that… + (tildify-count): …can be removed. + (tildify-find-env): Accept a new PAIRS argument which was + previously looked up in `tildify-ignored-environments-alist' each + time the function was called. With this change, the lookup is + performed only once in `tildify-foreach-region-outside-env'. + (tildify-region): Greatly simplify the function since now most of + the work is done by `tildify-foreach-region-outside-env'. + (tildify-mode-alist): Simplify slightly by avoiding if and setq + and instead using or. + * textmodes/tildify.el (tildify-ignored-environments-alist): Optimise environments regexes diff --git a/lisp/textmodes/tildify.el b/lisp/textmodes/tildify.el index 39ccad7..50fee2f 100644 --- a/lisp/textmodes/tildify.el +++ b/lisp/textmodes/tildify.el @@ -3,7 +3,8 @@ ;; Copyright (C) 1997-2014 Free Software Foundation, Inc. ;; Author: Milan Zamazal -;; Version: 4.5.2 +;; Michal Nazarewicz +;; Version: 4.5.3 ;; Keywords: text, TeX, SGML, wp ;; This file is part of GNU Emacs. @@ -187,12 +188,6 @@ END-REGEX defines end of the corresponding text part and can be either: (symbol :tag "Like other"))))) -;;; *** Internal variables *** - -(defvar tildify-count nil - "Counter for replacements.") - - ;;; *** Interactive functions *** ;;;###autoload @@ -205,51 +200,16 @@ This function performs no refilling of the changed text. If DONT-ASK is set, or called interactively with prefix argument, user won't be prompted for confirmation of each substitution." (interactive "*rP") - (setq tildify-count 0) - (let (a - z - (marker-end (copy-marker end)) - end-env - finish - (ask (not dont-ask)) - (case-fold-search nil) - (regexp (tildify-build-regexp)) ; beginnings of environments - aux) - (if regexp - ;; Yes, ignored environments exist for the current major mode, - ;; tildify just texts outside them - (save-excursion - (save-restriction - (widen) - (goto-char (point-min)) - (while (not finish) - (setq a (point)) - (setq end-env (tildify-find-env regexp)) - (setq z (copy-marker (if end-env (1- (point)) (point-max)))) - (if (>= (marker-position z) beg) - (progn - (or (>= a beg) (setq a beg)) - (or (<= (marker-position z) (marker-position marker-end)) - (setq z marker-end)) - (setq aux (tildify-tildify a (marker-position z) ask)) - (if (eq aux 'force) - (setq ask nil) - (if (eq aux nil) - (setq finish t))))) - (if (>= (marker-position z) (marker-position marker-end)) - (setq finish t)) - (or (>= (point) (marker-position z)) - (goto-char (marker-position z))) - (if (not finish) - (if (re-search-forward end-env nil t) - (if (> (point) (marker-position marker-end)) - (setq finish t)) - (message - "End of environment not found: %s" end-env) - (setq finish t)))))) - ;; No ignored environments, tildify directly - (tildify-tildify beg end ask))) - (message "%d spaces replaced." tildify-count)) + (let (case-fold-search (count 0) (ask (not dont-ask))) + (tildify-foreach-region-outside-env beg end + (lambda (beg end) + (let ((aux (tildify-tildify beg end ask))) + (setq count (+ count (car aux))) + (if (not (eq (cdr aux) 'force)) + (cdr aux) + (setq ask nil) + t)))) + (message "%d spaces replaced." count))) ;;;###autoload (defun tildify-buffer (&optional dont-ask) @@ -266,42 +226,58 @@ won't be prompted for confirmation of each substitution." ;;; *** Auxiliary functions *** -(defun tildify-build-regexp () - "Build start of environment regexp." - (let ((alist (tildify-mode-alist tildify-ignored-environments-alist)) - regexp) - (when alist - (setq regexp (caar alist)) - (setq alist (cdr alist)) - (while alist - (setq regexp (concat regexp "\\|" (caar alist))) - (setq alist (cdr alist))) - regexp))) - (defun tildify-mode-alist (mode-alist &optional mode) "Return alist item for the MODE-ALIST in the current major MODE." - (if (null mode) - (setq mode major-mode)) - (let ((alist (cdr (or (assoc mode mode-alist) + (let ((alist (cdr (or (assoc (or mode major-mode) mode-alist) (assoc t mode-alist))))) (if (and alist (symbolp alist)) (tildify-mode-alist mode-alist alist) alist))) -(defun tildify-find-env (regexp) +(defun tildify-foreach-region-outside-env (beg end callback) + "Scan region from BEG to END calling CALLBACK on portions out of environments. +Call CALLBACK on each region outside of environment to ignore. +CALLBACK will only be called for regions which have intersection +with [BEG END]. It must be a function that takes two point +arguments specifying the region to operate on. Stop scanning the +region as soon as CALLBACK returns nil. Environments to ignore +are determined from `tildify-ignored-environments-alist'." + (declare (indent 2)) + (let ((pairs (tildify-mode-alist tildify-ignored-environments-alist))) + (if (not pairs) + (funcall callback beg end) + (let ((func (lambda (b e) + (let ((b (max b beg)) (e (min e end))) + (if (< b e) (funcall callback b e) t)))) + (beg-re (concat "\\(?:" + (mapconcat 'car pairs "\\)\\|\\(?:") + "\\)")) + p end-re) + (save-excursion + (save-restriction + (widen) + (goto-char (point-min)) + (while (and (< (setq p (point)) end) + (if (not (setq end-re + (tildify-find-env beg-re pairs))) + (progn (funcall func p end) nil) + (funcall func p (match-beginning 0)) + (when (< (point) end) + (setq p (point)) + (re-search-forward end-re nil t))))))))))) + +(defun tildify-find-env (regexp pairs) "Find environment using REGEXP. -Return regexp for the end of the environment or nil if no environment was -found." +Return regexp for the end of the environment found in PAIRS or nil if +no environment was found." ;; Find environment (when (re-search-forward regexp nil t) (save-match-data - ;; Build end-env regexp - (let ((match (match-string 0)) - (alist (tildify-mode-alist tildify-ignored-environments-alist))) - (while (not (eq (string-match (caar alist) match) 0)) - (setq alist (cdr alist))) - (let ((expression (cdar alist))) + (let ((match (match-string 0))) + (while (not (eq (string-match (caar pairs) match) 0)) + (setq pairs (cdr pairs))) + (let ((expression (cdar pairs))) (if (stringp expression) expression (mapconcat @@ -319,8 +295,9 @@ macros. If ASK is nil, perform replace without asking user for confirmation. -Returns one of symbols: t (all right), nil (quit), force (replace without -further questions)." +Returns (count . response) cons where count is number of string +replacements done and response is one of symbols: t (all right), nil +(quit), force (replace without further questions)." (save-excursion (goto-char beg) (let* ((alist (tildify-mode-alist tildify-pattern-alist)) @@ -332,7 +309,8 @@ further questions)." bad-answer replace quit - (message-log-max nil)) + (message-log-max nil) + (count 0)) (while (and (not quit) (re-search-forward regexp (marker-position end-marker) t)) (when (or (not ask) @@ -359,12 +337,11 @@ further questions)." (setq bad-answer t))) replace)) (replace-match tilde t t nil match-number) - (setq tildify-count (1+ tildify-count)))) + (setq count (1+ count)))) ;; Return value - (cond - (quit nil) - ((not ask) 'force) - (t t))))) + (cons count (cond (quit nil) + ((not ask) 'force) + (t t)))))) ;;; *** Announce *** diff --git a/test/ChangeLog b/test/ChangeLog index 38a4feb..6248d6c 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,5 +1,11 @@ 2014-06-05 Michal Nazarewicz + * automated/tildify-tests.el (tildify-test-find-env-end-re-bug) + (tildify-test-find-env-group-index-bug): Update to support new + signature of the `tildify-foreach-region-outside-env' function. + Namely, it now takes pairs as an argument instead of looking it up in + `tildify-ignored-environments-alist'. + * automated/tildify-tests.el (tildify-test--example-html): Add support for generating XML code, so that… (tildify-test-xml) …test can be added to check handling of XML diff --git a/test/automated/tildify-tests.el b/test/automated/tildify-tests.el index dd404fc..cf18320 100644 --- a/test/automated/tildify-tests.el +++ b/test/automated/tildify-tests.el @@ -114,23 +114,22 @@ latter is missing, SENTENCE will be used in all placeholder positions." (ert-deftest tildify-test-find-env-end-re-bug () "Tests generation of end-regex using mix of indexes and strings" (with-temp-buffer - (let ((tildify-ignored-environments-alist - `((,major-mode ("foo\\|bar" . ("end-" 0)))))) - (insert "foo whatever end-foo") - (goto-char (point-min)) - (should (string-equal "end-foo" (tildify-find-env "foo\\|bar")))))) + (insert "foo whatever end-foo") + (goto-char (point-min)) + (should (string-equal "end-foo" + (tildify-find-env "foo\\|bar" + '(("foo\\|bar" . ("end-" 0)))))))) (ert-deftest tildify-test-find-env-group-index-bug () "Tests generation of match-string indexes" (with-temp-buffer - (let ((tildify-ignored-environments-alist - `((,major-mode ("start-\\(foo\\|bar\\)" . ("end-" 1)) - ("open-\\(foo\\|bar\\)" . ("close-" 1))))) + (let ((pairs '(("start-\\(foo\\|bar\\)" . ("end-" 1)) + ("open-\\(foo\\|bar\\)" . ("close-" 1)))) (beg-re "start-\\(foo\\|bar\\)\\|open-\\(foo\\|bar\\)")) (insert "open-foo whatever close-foo") (goto-char (point-min)) - (should (string-equal "close-foo" (tildify-find-env beg-re)))))) + (should (string-equal "close-foo" (tildify-find-env beg-re pairs)))))) (provide 'tildify-tests) -- 2.0.0.526.g5318336 From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 05 07:28:08 2014 Received: (at 17699) by debbugs.gnu.org; 5 Jun 2014 11:28:08 +0000 Received: from localhost ([127.0.0.1]:44818 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WsVq3-0007nI-5P for submit@debbugs.gnu.org; Thu, 05 Jun 2014 07:28:07 -0400 Received: from mail-we0-f201.google.com ([74.125.82.201]:33516) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WsVpt-0007kQ-8s for 17699@debbugs.gnu.org; Thu, 05 Jun 2014 07:28:02 -0400 Received: by mail-we0-f201.google.com with SMTP id w62so86439wes.0 for <17699@debbugs.gnu.org>; Thu, 05 Jun 2014 04:27:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-type:content-transfer-encoding; bh=hpZHZ8rKcpIw8ChMtdrNXidLMdg7htApcIhLERWZ7L0=; b=HdIteoO1HTwtwjVKS5NBnvAcedn/W+CQMbhJXiGY4Wz0S4dUNEedGGnJxJAoAUrq9M a/vR1s/NQcH4e5yJ+nF5NBdiBiKcWbwpPDz2VpKL6bB5pnIaYDtYEAg540Vgd1xFh1xr WE1gTzuADtvyWdDgZPgIedf+dD4NkPxO7btE+8IN5Lxh3YPtEqM1aetiKdAxxfsULmpr /fjEqianP7toK0nawgRD6Dz3ZFJwFcJRqN8SCUNxCmUGcRko2lySOAvHbz7dnvt9GwDo Ke5U9t2qBOpFF3Yc1IQ4v+Oo6PJkpcVQ5O+N57T301TXpv3FSQEYdhYg/dBBCIpewKsS I75Q== X-Gm-Message-State: ALoCoQkDY1IznGMNrCiAX071QV1IFKBG3hOc+h8nBMrFUl0rWEGfr3yWaapAPZqHWLVMCYrACGADoiF8qKmO8qDdzj0Rq9ZnnK4O6fsP2utSGA6D0UvWn+E9QyTJUvo5KNeUop3vluzp X-Received: by 10.112.49.229 with SMTP id x5mr3277218lbn.14.1401967666195; Thu, 05 Jun 2014 04:27:46 -0700 (PDT) Received: from corp2gmr1-2.eem.corp.google.com (corp2gmr1-2.eem.corp.google.com [172.25.138.117]) by gmr-mx.google.com with ESMTPS id se3si1509278wic.3.2014.06.05.04.27.46 for <17699@debbugs.gnu.org> (version=TLSv1.1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 05 Jun 2014 04:27:46 -0700 (PDT) Received: from hpgntag-ubiq62.eem.corp.google.com (hpgntag-ubiq62.eem.corp.google.com [172.25.135.103]) by corp2gmr1-2.eem.corp.google.com (Postfix) with ESMTP id 10F131E42E1 for <17699@debbugs.gnu.org>; Thu, 5 Jun 2014 04:27:46 -0700 (PDT) Received: by hpgntag-ubiq62.eem.corp.google.com (Postfix, from userid 126942) id E1B0110B7E8; Thu, 5 Jun 2014 13:27:45 +0200 (CEST) From: Michal Nazarewicz To: 17699@debbugs.gnu.org Subject: [PATCH 2/7] tildify.el: Fix matched group indexes in end-regex building Date: Thu, 5 Jun 2014 13:27:31 +0200 Message-Id: <1401967656-16171-2-git-send-email-mina86@mina86.com> X-Mailer: git-send-email 2.0.0.526.g5318336 In-Reply-To: <1401967656-16171-1-git-send-email-mina86@mina86.com> References: <1401967656-16171-1-git-send-email-mina86@mina86.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -1.4 (-) X-Debbugs-Envelope-To: 17699 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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: -1.4 (-) * lisp/textmodes/tildifi.el (tildify-find-env): When looking for a start of an ignore-environment, the regex is built by concatenating regexes of all the environments configured in `tildify-ignored-environments-alist'. So for example, the following list could be used to match TeX's \verb and \verb* commands: (("\\\\verb\\(.\\)" . (1)) ("\\\\verb\\*\\(.\\)" . (1))) This would result in the following regex being used to find the start of any of the variants of the \verb command: \\\\verb\\(.\\)\\|\\\\verb\\*\\(.\\) But now, if “\\\\verb\\*\\(.\\)” matches, the first capture group won't match anything, and thus (match-string 1) will be nil, which will cause building of the end-matching regex to fail. Fix this by using capture groups from the time when the opening regexes are matched individually. * tests/automated/tildify-tests.el (tildify-test-find-env-group-index-bug): New test validating fix to the above bug. --- lisp/ChangeLog | 23 +++++++++++++++++++++++ lisp/textmodes/tildify.el | 30 +++++++++++++++--------------- test/ChangeLog | 4 ++++ test/automated/tildify-tests.el | 12 ++++++++++++ 4 files changed, 54 insertions(+), 15 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index dc3c42a..523b2a9 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,28 @@ 2014-06-05 Michal Nazarewicz + * textmodes/tildify.el (tildify-find-env): Fix matched group + indexes in end-regex building + + When looking for a start of an ignore-environment, the regex is built + by concatenating regexes of all the environments configured in + `tildify-ignored-environments-alist'. So for example, the following + list could be used to match TeX's \verb and \verb* commands: + + (("\\\\verb\\(.\\)" . (1)) + ("\\\\verb\\*\\(.\\)" . (1))) + + This would result in the following regex being used to find the start + of any of the variants of the \verb command: + + \\\\verb\\(.\\)\\|\\\\verb\\*\\(.\\) + + But now, if “\\\\verb\\*\\(.\\)” matches, the first capture group + won't match anything, and thus (match-string 1) will be nil, which + will cause building of the end-matching regex to fail. + + Fix this by using capture groups from the time when the opening + regexes are matched individually. + * textmodes/tildify.el (tildify-find-env): Fix end-regex building in `tildify-find-env' diff --git a/lisp/textmodes/tildify.el b/lisp/textmodes/tildify.el index 7e4b39b..7aa338e 100644 --- a/lisp/textmodes/tildify.el +++ b/lisp/textmodes/tildify.el @@ -271,22 +271,22 @@ Return regexp for the end of the environment or nil if no environment was found." ;; Find environment (when (re-search-forward regexp nil t) - ;; Build end-env regexp - (let ((match (match-string 0)) - (alist (tildify-mode-alist tildify-ignored-environments-alist))) - (save-match-data + (save-match-data + ;; Build end-env regexp + (let ((match (match-string 0)) + (alist (tildify-mode-alist tildify-ignored-environments-alist))) (while (not (eq (string-match (caar alist) match) 0)) - (setq alist (cdr alist)))) - (let ((expression (cdar alist))) - (if (stringp expression) - expression - (mapconcat - (lambda (expr) - (if (stringp expr) - expr - (regexp-quote (match-string expr)))) - expression - "")))))) + (setq alist (cdr alist))) + (let ((expression (cdar alist))) + (if (stringp expression) + expression + (mapconcat + (lambda (expr) + (if (stringp expr) + expr + (regexp-quote (match-string expr match)))) + expression + ""))))))) (defun tildify-tildify (beg end ask) "Add tilde characters in the region between BEG and END. diff --git a/test/ChangeLog b/test/ChangeLog index db32aae..93ef098 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,5 +1,9 @@ 2014-06-05 Michal Nazarewicz + * automated/tildify-tests.el (tildify-test-find-env-group-index-bug): + New test checking end-regex building when multiple environment pairs + use integers to refer to capture groups. + * automated/tildify-tests.el (tildify-test-find-env-end-re-bug): New test checking end-regex building in `tildify-find-env' function when integers (denoting capture groups) and strings are mixed together. diff --git a/test/automated/tildify-tests.el b/test/automated/tildify-tests.el index 25e9f22..6fee28b 100644 --- a/test/automated/tildify-tests.el +++ b/test/automated/tildify-tests.el @@ -112,6 +112,18 @@ latter is missing, SENTENCE will be used in all placeholder positions." (should (string-equal "end-foo" (tildify-find-env "foo\\|bar")))))) +(ert-deftest tildify-test-find-env-group-index-bug () + "Tests generation of match-string indexes" + (with-temp-buffer + (let ((tildify-ignored-environments-alist + `((,major-mode ("start-\\(foo\\|bar\\)" . ("end-" 1)) + ("open-\\(foo\\|bar\\)" . ("close-" 1))))) + (beg-re "start-\\(foo\\|bar\\)\\|open-\\(foo\\|bar\\)")) + (insert "open-foo whatever close-foo") + (goto-char (point-min)) + (should (string-equal "close-foo" (tildify-find-env beg-re)))))) + + (provide 'tildify-tests) ;;; tildify-tests.el ends here -- 2.0.0.526.g5318336 From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 05 09:55:11 2014 Received: (at 17699) by debbugs.gnu.org; 5 Jun 2014 13:55:11 +0000 Received: from localhost ([127.0.0.1]:44941 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WsY8H-0005fU-Pr for submit@debbugs.gnu.org; Thu, 05 Jun 2014 09:55:10 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.181]:58113) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WsY8A-0005ed-Re for 17699@debbugs.gnu.org; Thu, 05 Jun 2014 09:55:03 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArUGAIDvNVPO+IOj/2dsb2JhbABZgwaDSsA9gRcXdIIlAQEBAQIBViMFCwsOJhIUGA0kiAQI0hkXjnoHhDgEqRmBaoNMIQ X-IPAS-Result: ArUGAIDvNVPO+IOj/2dsb2JhbABZgwaDSsA9gRcXdIIlAQEBAQIBViMFCwsOJhIUGA0kiAQI0hkXjnoHhDgEqRmBaoNMIQ X-IronPort-AV: E=Sophos;i="4.97,753,1389762000"; d="scan'208";a="65886921" Received: from 206-248-131-163.dsl.teksavvy.com (HELO pastel.home) ([206.248.131.163]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 05 Jun 2014 09:54:52 -0400 Received: by pastel.home (Postfix, from userid 20848) id B8B2F601BB; Thu, 5 Jun 2014 09:54:52 -0400 (EDT) From: Stefan Monnier To: Michal Nazarewicz Subject: Re: bug#17699: Various tildify.el improvements Message-ID: References: <1401967466-14607-1-git-send-email-mina86@mina86.com> Date: Thu, 05 Jun 2014 09:54:52 -0400 In-Reply-To: <1401967466-14607-1-git-send-email-mina86@mina86.com> (Michal Nazarewicz's message of "Thu, 5 Jun 2014 13:24:26 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 17699 Cc: 17699@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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.3 (/) > Various patches to lisp/textmodes/tildify.el file. The changes do not > introduce any significant functionality changes. They look fine to me, feel free to install them into `trunk'. Stefan From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 05 10:47:57 2014 Received: (at 17699) by debbugs.gnu.org; 5 Jun 2014 14:47:57 +0000 Received: from localhost ([127.0.0.1]:45863 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WsYxN-0007iG-RO for submit@debbugs.gnu.org; Thu, 05 Jun 2014 10:47:57 -0400 Received: from mail-wi0-f177.google.com ([209.85.212.177]:51342) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WsYxH-0007hl-D5 for 17699@debbugs.gnu.org; Thu, 05 Jun 2014 10:47:51 -0400 Received: by mail-wi0-f177.google.com with SMTP id f8so3669484wiw.10 for <17699@debbugs.gnu.org>; Thu, 05 Jun 2014 07:47:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=sender:from:to:cc:subject:in-reply-to:organization:references :user-agent:face:date:message-id:mime-version:content-type :content-transfer-encoding; bh=m1XqmCuO0ZaCKzpNaA9eq0rIQfkDRMuT/jjJZVQ50XE=; b=YfX9nGAD8vfV+opqtvRlhegkbUW0+DsJngZ8yZX2HAC1oTZ6NmHt6CnQjVjl9UMWda /IUqAGD1mWiONU9/Oo/dniBHwc2cmvnL9KlJOKy4J3n09bML68ExePYilogy/YaQ/0bx sIvNz296C0RmHYbO7atxfPRId4O8T6fH9avAqQe2I/4bs1lUgVHabps23f3Nw+9msnib irLjPnod/4ekc1w9WPcpb859AmzloGYn0tDZqaua6S7xq66TuPRBN9i1UIWiwUntTwkm RXT5uyCiIsFMwJVidBUqKP+N/YQHsaEWjNUQU+E6uzgb8EDN+3NfnZMhT0EutbjzHIQ/ 51QA== 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:cc:subject:in-reply-to :organization:references:user-agent:face:date:message-id :mime-version:content-type:content-transfer-encoding; bh=m1XqmCuO0ZaCKzpNaA9eq0rIQfkDRMuT/jjJZVQ50XE=; b=X5mCc3BH3Aaeo2MquHkjqdPyOlDbD/30ioo07ahA8QQx6fI4Vs3PNRKX283x2NHPXw askB0+551CBvDP7ws16BRaf0/6i/wRDBEf3X07gTSxh/CudKeD2LYGG3vXSkwcRWBaJZ dPYeC0Jh1WrLecskIRcDzYW3/f3bxrNV0pNW9HcZlu7fEQPeesgZOFzPti05brbozxfC W+3VVfOGPv1FPcdrjOp1vcUcvy6S9byL2QOgVdFkWT3LG/i1dikI233pj6MlB2URw43Z de01MwjNZiXitpNmyxTS2n0cZxThbP2E/9DqKzBcUk4Wptr+ZLyQFm6qZz64xjTK8CWG wjUg== X-Gm-Message-State: ALoCoQnFwfHCeAlapUI0kRaPni1RsmXvC+sZXwXtnF2D7iVfenKIbIOCkFjYhQDdiarYD+TS1Kuf2mZRSgXSDa6zPHUr43NjbBPJVi+JhSMREmRsMheoyOB/8ZAnX6dOh0Ns93hBcVHw X-Received: by 10.14.176.68 with SMTP id a44mr692634eem.90.1401979659057; Thu, 05 Jun 2014 07:47:39 -0700 (PDT) Received: from mpn-glaptop.roam.corp.google.com ([172.28.91.161]) by mx.google.com with ESMTPSA id t2sm15041172eeo.18.2014.06.05.07.47.37 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 05 Jun 2014 07:47:37 -0700 (PDT) From: Michal Nazarewicz To: Stefan Monnier Subject: Re: bug#17699: Various tildify.el improvements In-Reply-To: Organization: http://mina86.com/ References: <1401967466-14607-1-git-send-email-mina86@mina86.com> User-Agent: Notmuch/0.17+15~gb65ca8e (http://notmuchmail.org) Emacs/24.4.50.1 (x86_64-unknown-linux-gnu) X-Face: PbkBB1w#)bOqd`iCe"Ds{e+!C7`pkC9a|f)Qo^BMQvy\q5x3?vDQJeN(DS?|-^$uMti[3D*#^_Ts"pU$jBQLq~Ud6iNwAw_r_o_4]|JO?]}P_}Nc&"p#D(ZgUb4uCNPe7~a[DbPG0T~!&c.y$Ur,=N4RT>]dNpd; KFrfMCylc}gc??'U2j,!8%xdD Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAJFBMVEWbfGlUPDDHgE57V0jUupKjgIObY0PLrom9mH4dFRK4gmjPs41MxjOgAAACQElEQVQ4jW3TMWvbQBQHcBk1xE6WyALX1069oZBMlq+ouUwpEQQ6uRjttkWP4CmBgGM0BQLBdPFZYPsyFUo6uEtKDQ7oy/U96XR2Ux8ehH/89Z6enqxBcS7Lg81jmSuujrfCZcLI/TYYvbGj+jbgFpHJ/bqQAUISj8iLyu4LuFHJTosxsucO4jSDNE0Hq3hwK/ceQ5sx97b8LcUDsILfk+ovHkOIsMbBfg43VuQ5Ln9YAGCkUdKJoXR9EclFBhixy3EGVz1K6eEkhxCAkeMMnqoAhAKwhoUJkDrCqvbecaYINlFKSRS1i12VKH1XpUd4qxL876EkMcDvHj3s5RBajHHMlA5iK32e0C7VgG0RlzFPvoYHZLRmAC0BmNcBruhkE0KsMsbEc62ZwUJDxWUdMsMhVqovoT96i/DnX/ASvz/6hbCabELLk/6FF/8PNpPCGqcZTGFcBhhAaZZDbQPaAB3+KrWWy2XgbYDNIinkdWAFcCpraDE/knwe5DBqGmgzESl1p2E4MWAz0VUPgYYzmfWb9yS4vCvgsxJriNTHoIBz5YteBvg+VGISQWUqhMiByPIPpygeDBE6elD973xWwKkEiHZAHKjhuPsFnBuArrzxtakRcISv+XMIPl4aGBUJm8Emk7qBYU8IlgNEIpiJhk/No24jHwkKTFHDWfPniR4iw5vJaw2nzSjfq2zffcE/GDjRC2dn0J0XwPAbDL84TvaFCJEU4Oml9pRyEUhR3Cl2t01AoEjRbs0sYugp14/4X5n4pU4EHHnMAAAAAElFTkSuQmCC X-PGP: 50751FF4 X-PGP-FP: AC1F 5F5C D418 88F8 CC84 5858 2060 4012 5075 1FF4 X-Hashcash: 1:20:140605:monnier@iro.umontreal.ca::Cg2Ahyn3kR8hxEMm:00000000000000000000000000000000000006xW1 X-Hashcash: 1:20:140605:17699@debbugs.gnu.org::hs5CSbyIp//MhAYs:0000000000000000000000000000000000000000DKef Date: Thu, 05 Jun 2014 16:47:35 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: 17699 Cc: 17699@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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: -1.3 (-) On Thu, Jun 05 2014, Stefan Monnier wrote: >> Various patches to lisp/textmodes/tildify.el file. The changes do not >> introduce any significant functionality changes. > > They look fine to me, feel free to install them into `trunk'. Pushed. --=20 Best regards, _ _ .o. | Liege of Serenely Enlightened Majesty of o' \,=3D./ `o ..o | Computer Science, Micha=C5=82 =E2=80=9Cmina86=E2=80=9D Nazarewicz = (o o) ooo +------ooO--(_)--Ooo-- From debbugs-submit-bounces@debbugs.gnu.org Fri Jun 06 13:35:40 2014 Received: (at 17699) by debbugs.gnu.org; 6 Jun 2014 17:35:40 +0000 Received: from localhost ([127.0.0.1]:39789 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Wsy3G-0003St-V0 for submit@debbugs.gnu.org; Fri, 06 Jun 2014 13:35:39 -0400 Received: from fencepost.gnu.org ([208.118.235.10]:38686 ident=Debian-exim) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Wsy3D-0003Si-9Z for 17699@debbugs.gnu.org; Fri, 06 Jun 2014 13:35:36 -0400 Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1Wsy3B-0004Gg-OL; Fri, 06 Jun 2014 13:35:33 -0400 From: Glenn Morris To: Michal Nazarewicz Subject: Re: bug#17699: Various tildify.el improvements References: <1401967466-14607-1-git-send-email-mina86@mina86.com> X-Spook: warfare JFK gamma data haven kibo Geraldton investigation X-Ran: 8LRG_SJ!Gi-RXChc_[jsz/) (Michal Nazarewicz's message of "Thu, 05 Jun 2014 16:47:35 +0200") 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: -5.7 (-----) X-Debbugs-Envelope-To: 17699 Cc: 17699@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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: -5.7 (-----) Please now close the bug report, by sending a mail to 17699-done@debbugs. (I like to put "Version: 24.5" in the first line of the message body, to indicate which Emacs version the fix is expected to appear in.) From debbugs-submit-bounces@debbugs.gnu.org Fri Jun 06 14:13:23 2014 Received: (at 17699-done) by debbugs.gnu.org; 6 Jun 2014 18:13:23 +0000 Received: from localhost ([127.0.0.1]:39835 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Wsydm-0004Z2-C6 for submit@debbugs.gnu.org; Fri, 06 Jun 2014 14:13:22 -0400 Received: from mail-we0-f178.google.com ([74.125.82.178]:52465) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Wsydk-0004Yg-7o for 17699-done@debbugs.gnu.org; Fri, 06 Jun 2014 14:13:20 -0400 Received: by mail-we0-f178.google.com with SMTP id p10so1192997wes.9 for <17699-done@debbugs.gnu.org>; Fri, 06 Jun 2014 11:13:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=sender:from:to:subject:in-reply-to:organization:references :user-agent:face:date:message-id:mime-version:content-type; bh=q3pkM08dSPGpekz48O0TvTMi95jJUvh8cBtEXTFWEO4=; b=PNMdVfxRcYYUElCLkcev8NUEMWfzLJwpt8TsXZgIyZnDfMtzeNMAas4pvPGy1Q7iyX 8DG08cgs/3odeipfHjW+auamPEEiZ706l2Vkf4U5Ud/CI0zN55dXCAC9frrGxuVKUwzj TvaV09cl/1NMCuTyAWuJat4DdGeE3GOl55x6bcVpDLo1fAFZhe48mCsoE4npXupyF+T7 FhrZJR6qP9QEYL+c6seC+NF+J3faXywDqCwLXRE52G7+EqhU+cax76Ba2fBkvLGbuv0K z9zK70Eo2kaN927t2d9JWGXQlA+LEnUoxNFp3gS6jdxNn8NWoPxtkC7rzQKGnvKCxHjp an3A== 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:in-reply-to:organization :references:user-agent:face:date:message-id:mime-version :content-type; bh=q3pkM08dSPGpekz48O0TvTMi95jJUvh8cBtEXTFWEO4=; b=Af4BZBvhLnFibMpreB+VFVaeKDl/QYcHesFEkSWQam8d4wFzjYpIQIBtTz/P4W9btP wQdDL0DstxO6jprv6RyRg+pUKMvuZ05nf2+WzCLiswL3xd77yUJZMMEn3wODZAGh/ZtH SpL1FUB2akymoFVcNiOEAMGF5I/2oxMFJsvVmvY8RQj3Erhd0G/rPOOmRNeAZV1lq8ic EYT7F9J6YKiOR6W1m5c+8eB+W9AlYjRg7NbL9UeYfbUzIa7tOGGr4EenZh9+0l0IJKWq Kj+RrZcGNvWY6HoXDoSI+DzPgSqKSVOq8WL3IAiMBa2jUSRVFRRWdEJO0xWGPZkR9TfO Ljmw== X-Gm-Message-State: ALoCoQnnkMTQ3CuJtOQ6VOd69iKpUIbyyfKfUx1Ox7UuVzCz3ep/hXvKvh+hhazGTW0Yo0UEHrhRywdKI9omtNSmXedAz2u/e+r1z7KwVM+F9OWm0RZiUotauLI38y9TBbj92F0PPRX+ X-Received: by 10.14.179.73 with SMTP id g49mr850251eem.18.1402078394354; Fri, 06 Jun 2014 11:13:14 -0700 (PDT) Received: from mpn-glaptop.roam.corp.google.com ([172.28.91.55]) by mx.google.com with ESMTPSA id b44sm5669371eem.45.2014.06.06.11.13.12 for <17699-done@debbugs.gnu.org> (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 06 Jun 2014 11:13:13 -0700 (PDT) From: Michal Nazarewicz To: 17699-done@debbugs.gnu.org Subject: Re: bug#17699: Various tildify.el improvements In-Reply-To: Organization: http://mina86.com/ References: <1401967466-14607-1-git-send-email-mina86@mina86.com> User-Agent: Notmuch/0.17+15~gb65ca8e (http://notmuchmail.org) Emacs/24.4.50.1 (x86_64-unknown-linux-gnu) X-Face: PbkBB1w#)bOqd`iCe"Ds{e+!C7`pkC9a|f)Qo^BMQvy\q5x3?vDQJeN(DS?|-^$uMti[3D*#^_Ts"pU$jBQLq~Ud6iNwAw_r_o_4]|JO?]}P_}Nc&"p#D(ZgUb4uCNPe7~a[DbPG0T~!&c.y$Ur,=N4RT>]dNpd; KFrfMCylc}gc??'U2j,!8%xdD Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAJFBMVEWbfGlUPDDHgE57V0jUupKjgIObY0PLrom9mH4dFRK4gmjPs41MxjOgAAACQElEQVQ4jW3TMWvbQBQHcBk1xE6WyALX1069oZBMlq+ouUwpEQQ6uRjttkWP4CmBgGM0BQLBdPFZYPsyFUo6uEtKDQ7oy/U96XR2Ux8ehH/89Z6enqxBcS7Lg81jmSuujrfCZcLI/TYYvbGj+jbgFpHJ/bqQAUISj8iLyu4LuFHJTosxsucO4jSDNE0Hq3hwK/ceQ5sx97b8LcUDsILfk+ovHkOIsMbBfg43VuQ5Ln9YAGCkUdKJoXR9EclFBhixy3EGVz1K6eEkhxCAkeMMnqoAhAKwhoUJkDrCqvbecaYINlFKSRS1i12VKH1XpUd4qxL876EkMcDvHj3s5RBajHHMlA5iK32e0C7VgG0RlzFPvoYHZLRmAC0BmNcBruhkE0KsMsbEc62ZwUJDxWUdMsMhVqovoT96i/DnX/ASvz/6hbCabELLk/6FF/8PNpPCGqcZTGFcBhhAaZZDbQPaAB3+KrWWy2XgbYDNIinkdWAFcCpraDE/knwe5DBqGmgzESl1p2E4MWAz0VUPgYYzmfWb9yS4vCvgsxJriNTHoIBz5YteBvg+VGISQWUqhMiByPIPpygeDBE6elD973xWwKkEiHZAHKjhuPsFnBuArrzxtakRcISv+XMIPl4aGBUJm8Emk7qBYU8IlgNEIpiJhk/No24jHwkKTFHDWfPniR4iw5vJaw2nzSjfq2zffcE/GDjRC2dn0J0XwPAbDL84TvaFCJEU4Oml9pRyEUhR3Cl2t01AoEjRbs0sYugp14/4X5n4pU4EHHnMAAAAAElFTkSuQmCC X-PGP: 50751FF4 X-PGP-FP: AC1F 5F5C D418 88F8 CC84 5858 2060 4012 5075 1FF4 Date: Fri, 06 Jun 2014 20:13:11 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: 17699-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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: -1.3 (-) Version: 24.5 From unknown Fri Aug 15 03:56:55 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 05 Jul 2014 11:24:05 +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 From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 04 12:35:32 2014 Received: (at control) by debbugs.gnu.org; 4 Oct 2014 16:35:32 +0000 Received: from localhost ([127.0.0.1]:33183 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XaSIt-0002m9-8U for submit@debbugs.gnu.org; Sat, 04 Oct 2014 12:35:31 -0400 Received: from fencepost.gnu.org ([208.118.235.10]:60039) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XaSIr-0002lz-Gi for control@debbugs.gnu.org; Sat, 04 Oct 2014 12:35:29 -0400 Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1XaSIq-0005r2-MO; Sat, 04 Oct 2014 12:35:28 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <21552.8656.554316.921175@gnu.org> Date: Sat, 4 Oct 2014 12:35:28 -0400 From: Glenn Morris To: GNU bug tracker automated control server Subject: Update Emacs archived fixed bugs for 24.5 version number change X-Debbugs-No-Ack: yes X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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: -5.0 (-----) unarchive 18304 fixed 18304 25.1 notfixed 18304 24.5 unarchive 12008 fixed 12008 25.1 notfixed 12008 24.5 unarchive 17110 fixed 17110 25.1 notfixed 17110 24.5 unarchive 17218 fixed 17218 25.1 notfixed 17218 24.5 unarchive 18222 fixed 18222 25.1 notfixed 18222 24.5 unarchive 18023 fixed 18023 25.1 notfixed 18023 24.5 unarchive 17225 fixed 17225 25.1 notfixed 17225 24.5 unarchive 16626 fixed 16626 25.1 notfixed 16626 24.5 unarchive 18326 fixed 18326 25.1 notfixed 18326 24.5 unarchive 18227 fixed 18227 25.1 notfixed 18227 24.5 unarchive 16328 fixed 16328 25.1 notfixed 16328 24.5 unarchive 17333 fixed 17333 25.1 notfixed 17333 24.5 unarchive 13837 fixed 13837 25.1 notfixed 13837 24.5 unarchive 17641 fixed 17641 25.1 notfixed 17641 24.5 unarchive 18341 fixed 18341 25.1 notfixed 18341 24.5 unarchive 18349 fixed 18349 25.1 notfixed 18349 24.5 unarchive 2151 fixed 2151 25.1 notfixed 2151 24.5 unarchive 5853 fixed 5853 25.1 notfixed 5853 24.5 unarchive 17857 fixed 17857 25.1 notfixed 17857 24.5 unarchive 17858 fixed 17858 25.1 notfixed 17858 24.5 unarchive 17859 fixed 17859 25.1 notfixed 17859 24.5 unarchive 17160 fixed 17160 25.1 notfixed 17160 24.5 unarchive 2263 fixed 2263 25.1 notfixed 2263 24.5 unarchive 18368 fixed 18368 25.1 notfixed 18368 24.5 unarchive 17772 fixed 17772 25.1 notfixed 17772 24.5 unarchive 17276 fixed 17276 25.1 notfixed 17276 24.5 unarchive 15991 fixed 15991 25.1 notfixed 15991 24.5 unarchive 17699 fixed 17699 25.1 notfixed 17699 24.5 From unknown Fri Aug 15 03:56:55 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 02 Nov 2014 12:24:09 +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