Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
285ed416
Commit
285ed416
authored
Nov 29, 2015
by
Artur Malabarba
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* lisp/character-fold.el (character-fold-to-regexp): Be careful
not to return huge regexps.
parent
4c6f368c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
+7
-4
lisp/character-fold.el
lisp/character-fold.el
+7
-4
No files found.
lisp/character-fold.el
View file @
285ed416
...
...
@@ -150,9 +150,8 @@ 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.
If the resulting regexp would be too long for Emacs to handle,
just return the result of calling `regexp-quote' on STRING.
FROM is for internal use. It specifies an index in the STRING
from which to start."
...
...
@@ -222,7 +221,11 @@ from which to start."
(
setq
i
(
1+
i
)))
(
when
(
>
spaces
0
)
(
push
(
character-fold--make-space-string
spaces
)
out
))
(
apply
#'
concat
(
nreverse
out
))))
(
let
((
regexp
(
apply
#'
concat
(
nreverse
out
))))
;; Limited by `MAX_BUF_SIZE' in `regex.c'.
(
if
(
>
(
length
regexp
)
32000
)
(
regexp-quote
string
)
regexp
))))
;;; Commands provided for completeness.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment