From 747f81861c17b7d9471285d408118c9128282c93 Mon Sep 17 00:00:00 2001 From: Artur Malabarba Date: Sat, 28 Nov 2015 19:56:19 +0000 Subject: [PATCH] * 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 49d75bd24ee..c2b9a0729e6 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 3a288b9071c..cf195842d0a 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-+")) -- 2.39.5