Commit 747f8186 authored by Artur Malabarba's avatar Artur Malabarba

* lisp/character-fold.el (character-fold-to-regexp)

Warn about using long strings.

* test/automated/character-fold-tests.el
(character-fold--test-consistency): Reduce string size for tests.
parent 70d68a9d
......@@ -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)
......@@ -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-+"))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment