1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-14 01:50:22 -08:00
Commit graph

24 commits

Author SHA1 Message Date
Paul Eggert
0e963201d0 Update copyright year to 2016
Run admin/update-copyright.
2016-01-01 01:34:24 -08:00
Artur Malabarba
30f3432e95 * lisp/character-fold.el: Remove special case-folding support
(character-fold-to-regexp): Remove special code for
case-folding.  Char-fold search still respects the
`case-fold-search' variable (i.e., f matches F).  This only
removes the code that was added to ensure that f also matched
all chars that F matched.  For instance, after this commit, f
no longer matches 𝔽.

This was necessary because the logic created a regexp with
2^(length of the string) redundant paths.  So, when a very
long string "almost" matched, Emacs took a very long time to
figure out that it didn't.  This became particularly relevant
because isearch's lazy-highlight does a search bounded by (1-
match-end) (which, in most circumstances, is a search that
almost matches).  A recipe for this can be found in bug#22090.
2015-12-04 15:12:34 +00:00
Artur Malabarba
61a4b57f1d * lisp/character-fold.el: Add back multi-char matching
(character-fold-to-regexp): Uncomment recently commented code
and make the algorithm "dummer" by not checking every possible
combination.  This will miss some possible matches, but it
greatly reduces regexp size.

* test/automated/character-fold-tests.el
(character-fold--test-fold-to-regexp): Comment out test of
functionality no longer supported.
2015-12-01 13:55:45 +00:00
Artur Malabarba
0d576434a8 * lisp/character-fold.el: Comment out branching code
(character-fold-to-regexp): Comment out code that uses multi-char
table.  The branching caused by this induces absurdly long regexps,
up to 10k chars for as little as 25 input characters.
2015-11-30 15:05:58 +00:00
Artur Malabarba
285ed41605 * lisp/character-fold.el (character-fold-to-regexp): Be careful
not to return huge regexps.
2015-11-29 20:42:25 +00:00
Artur Malabarba
747f81861c * 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.
2015-11-28 19:57:14 +00:00
Artur Malabarba
19141a9be6 * lisp/character-fold.el: Also play nice with case-folding
(character-fold-to-regexp): Take `case-fold-search' into account.
2015-11-28 16:21:54 +00:00
Artur Malabarba
5c5997002b * lisp/character-fold.el: Add support for multi-char matches
(character-fold-table): Now has an extra-slot. This is a second
char-table that holds multi-character matches.  See docstring for
details.
(character-fold-to-regexp): Can build branching regexps when a
character's entry the extra slot of `character-fold-table' matches the
characters that succeed it.
2015-11-28 16:21:54 +00:00
Artur Malabarba
35c7dc06ed * lisp/character-fold.el: Code simplifications
(character-fold-table): Reduce the scope of a variable.
(character-fold-to-regexp): Change logic to work directly on the
input string.  It's a little easier to understand, probably
faster, and sets us up for implementing multi-char matches.

* test/automated/character-fold-tests.el
(character-fold--test-fold-to-regexp): New test.
2015-11-28 15:06:37 +00:00
Artur Malabarba
a5f2970207 * lisp/character-fold.el: Allow complex chars to match their decomposition
(character-fold-table): When a character's decomposition does not
involve a formatting tag (i.e., if it has an "exact" description via
other characters), then this character is allowed to match the
decomposition.
2015-11-27 12:01:12 +00:00
Artur Malabarba
19e90846c4 * lisp/character-fold.el: More descriptive variable names
(character-fold-table): Rename a lot of the lexical variables to
make the code easier to read.
2015-11-27 12:00:37 +00:00
Eli Zaretskii
a41cb8c4d3 Improve commentary in character-fold.el
* lisp/character-fold.el (character-fold-to-regexp): Move detailed
description from commit log message to comments.  (Bug#22019)
2015-11-27 09:54:27 +02:00
Juanma Barranquero
cadfceab1a * lisp/character-fold.el: Provide `character-fold' 2015-10-30 14:49:52 +01:00
Artur Malabarba
020e850557 * lisp/character-fold.el (character-fold-to-regexp): Fix case
where string ends in space
2015-10-28 15:50:17 +00:00
Artur Malabarba
4281f722dd * lisp/character-fold.el: Make compatible with lax-whitespace
(character-fold-to-regexp): Rework internals to play nice with
lax-whitespacing.

When the user types a space, we want to match the table entry for
?\s, which is generally a regexp like "[ ...]".  However, the
`search-spaces-regexp' variable doesn't "see" spaces inside these
regexp constructs, so we need to use "\\( \\|[ ...]\\)" instead (to
manually expose a space).

Furthermore, the lax search engine acts on a bunch of spaces, not
on individual spaces, so if the string contains sequential spaces
like "  ", we need to keep them grouped together like this:
"\\(  \\|[ ...][ ...]\\)".
2015-10-28 15:40:23 +00:00
Artur Malabarba
f5f18f95d4 * lisp/character-fold.el: Many improvements
(character-fold-search-forward, character-fold-search-backward):
New command
(character-fold-to-regexp): Remove lax-whitespace hack.
(character-fold-search): Remove variable.  Only isearch and
query-replace use char-folding, and they both have their own
variables to configure that.
2015-10-25 01:11:59 +00:00
Artur Malabarba
7eed739935 * isearch.el (isearch-search-fun-default): Revert a5bdb87
Remove usage of `isearch-lax-whitespace' inside the `iearch-word'
clause of `isearch-search-fun-default'. That lax variable does not
refer to lax-whitespacing.  Related to (bug#21777).
This reverts commit a5bdb872ed.

* character-fold.el (character-fold-search): Set to nil
Default to nil for now, until someone implements proper
lax-whitespacing with char-fold searching.
2015-08-19 11:45:49 +01:00
Artur Malabarba
437862c5c9 * lisp/character-fold.el: Fix lax whitespace
(character-fold-table): Don't make space match other whitespace chars.
(character-fold-to-regexp): Simplify lax behaviour.
2015-08-05 19:15:44 +01:00
Artur Malabarba
5516728eac * lisp/character-fold.el (character-fold-table):
Only fold decompositions if at least one character is non-spacing.
(Bug#20975)
2015-07-05 16:45:58 +01:00
Paul Eggert
cc7acdbd0e Spelling fixes 2015-06-30 19:47:29 -07:00
Artur Malabarba
671974ef79 * lisp/character-fold.el (character-fold-table): Reuse `table' 2015-06-25 18:55:24 +01:00
Artur Malabarba
80e46ac5e1 * lisp/character-fold.el (character-fold-table): Fix table generation 2015-06-25 02:52:35 +01:00
Glenn Morris
0a3c4eb741 ; Fix comment typos 2015-06-24 21:25:01 -04:00
Artur Malabarba
795c918916 * lisp/character-fold.el: New file (Bug#20887)
(character-fold-to-regexp): New function.

* lisp/replace.el (replace-search): Check value of
`character-fold-search'.

* lisp/isearch.el: Move character-folding code to
character-fold.el
(isearch-toggle-character-fold): New command.
(isearch-mode-map): Bind it to "\M-sf".
(isearch-mode): Check value of `character-fold-search'.
2015-06-24 23:02:01 +01:00