emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs-25 747f818: * lisp/character-fold.el (character-fold


From: Artur Malabarba
Subject: [Emacs-diffs] emacs-25 747f818: * lisp/character-fold.el (character-fold-to-regexp)
Date: Sat, 28 Nov 2015 19:57:22 +0000

branch: emacs-25
commit 747f81861c17b7d9471285d408118c9128282c93
Author: Artur Malabarba <address@hidden>
Commit: Artur Malabarba <address@hidden>

    * lisp/character-fold.el (character-fold-to-regexp)
    
    Warn about using long strings.
    
    * test/automated/character-fold-tests.el
    (character-fold--test-lax-whitespace)
    (character-fold--test-consistency): Reduce string size for tests.
---
 lisp/character-fold.el                 |    4 ++++
 test/automated/character-fold-tests.el |    4 ++--
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/lisp/character-fold.el b/lisp/character-fold.el
index 49d75bd..c2b9a07 100644
--- a/lisp/character-fold.el
+++ b/lisp/character-fold.el
@@ -150,6 +150,10 @@ Any character in STRING that has an entry in
 `character-fold-table' is replaced with that entry (which is a
 regexp) and other characters are `regexp-quote'd.
 
+Note that this function can potentially return regexps too long
+for Emacs to handle.  If STRING is longer than 30 characters,
+consider not using this function.
+
 FROM is for internal use.  It specifies an index in the STRING
 from which to start."
   (let* ((spaces 0)
diff --git a/test/automated/character-fold-tests.el 
b/test/automated/character-fold-tests.el
index 3a288b9..cf19584 100644
--- a/test/automated/character-fold-tests.el
+++ b/test/automated/character-fold-tests.el
@@ -37,13 +37,13 @@
 
 
 (ert-deftest character-fold--test-consistency ()
-  (dotimes (n 50)
+  (dotimes (n 30)
     (let ((w (character-fold--random-word n)))
       ;; A folded string should always match the original string.
       (character-fold--test-search-with-contents w w))))
 
 (ert-deftest character-fold--test-lax-whitespace ()
-  (dotimes (n 50)
+  (dotimes (n 40)
     (let ((w1 (character-fold--random-word n))
           (w2 (character-fold--random-word n))
           (search-spaces-regexp "\\s-+"))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]