* 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: "\\( \\|[ ...][ ...]\\)".
Showing with 26 additions and 4 deletions