]> code.delx.au - gnu-emacs/commit
* lisp/character-fold.el: Make compatible with lax-whitespace
authorArtur Malabarba <bruce.connor.am@gmail.com>
Wed, 28 Oct 2015 15:03:47 +0000 (15:03 +0000)
committerArtur Malabarba <bruce.connor.am@gmail.com>
Wed, 28 Oct 2015 15:40:23 +0000 (15:40 +0000)
commit4281f722dd782d91f4b2bbd03834cbd1d944db5c
tree280599df8bf6d01f77debaf922e39e581be8ae78
parentfaace42f8a4c8f53f629419ba89a5196d62ee006
* 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:
"\\(  \\|[ ...][ ...]\\)".
lisp/character-fold.el