]> git.eshelyaron.com Git - emacs.git/commitdiff
Improve commentary in character-fold.el
authorEli Zaretskii <eliz@gnu.org>
Fri, 27 Nov 2015 07:54:27 +0000 (09:54 +0200)
committerEli Zaretskii <eliz@gnu.org>
Fri, 27 Nov 2015 07:54:27 +0000 (09:54 +0200)
* lisp/character-fold.el (character-fold-to-regexp): Move detailed
description from commit log message to comments.  (Bug#22019)

lisp/character-fold.el

index 0e156c50ddefe3fc90808046ead9205d9891ea3f..0e063b07e72e4d157991ebcfa0444d67710e1bd8 100644 (file)
@@ -117,9 +117,14 @@ regexp) and other characters are `regexp-quote'd."
   (let* ((spaces 0)
          (chars (mapcar #'identity string))
          (out chars))
-    ;; When the user types a space, we want to match the table entry,
-    ;; but we also want the ?\s to be visible to `search-spaces-regexp'.
-    ;; See commit message for a longer description.
+    ;; 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: "\\(  \\|[ ...][ ...]\\)".
     (while chars
       (let ((c (car chars)))
         (setcar chars