]> code.delx.au - gnu-emacs/commitdiff
* lisp/character-fold.el (character-fold-to-regexp)
authorArtur Malabarba <bruce.connor.am@gmail.com>
Sat, 28 Nov 2015 19:56:19 +0000 (19:56 +0000)
committerArtur Malabarba <bruce.connor.am@gmail.com>
Sat, 28 Nov 2015 19:57:14 +0000 (19:57 +0000)
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
test/automated/character-fold-tests.el

index 49d75bd24eef387c626d127b672fc06ef819c1fa..c2b9a0729e65a22274e4a5d4e8d99cf5732ca914 100644 (file)
@@ -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)
index 3a288b9071cd7c713899a80bfefee07165efbb13..cf195842d0a8c8027be210e7d4389332fed8b670 100644 (file)
 
 \f
 (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-+"))