]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix syntax of space characters
authorEli Zaretskii <eliz@gnu.org>
Fri, 8 Jan 2021 11:53:28 +0000 (13:53 +0200)
committerEli Zaretskii <eliz@gnu.org>
Fri, 8 Jan 2021 11:53:28 +0000 (13:53 +0200)
* lisp/international/characters.el (tbl): Give all the space
characters whose Unicode General Category is Zs the 'space'
syntax.  (Bug#45660)

lisp/international/characters.el

index 87e8589e6fdeab2b1b07173f55b1f69d1c5184dc..9bce419b489a851bc4c4514c83fe95e3f85682b3 100644 (file)
@@ -526,9 +526,6 @@ with L, LRE, or LRO Unicode bidi character type.")
   ;; FIXME: We should probably just use the Unicode properties to set
   ;; up the syntax table.
 
-  ;; NBSP isn't semantically interchangeable with other whitespace chars,
-  ;; so it's more like punctuation.
-  (set-case-syntax ?  "." tbl)
   (set-case-syntax ?¡ "." tbl)
   (set-case-syntax ?¦ "_" tbl)
   (set-case-syntax ?§ "." tbl)
@@ -602,11 +599,17 @@ with L, LRE, or LRO Unicode bidi character type.")
   ;; Cyrillic Extended-C
   (modify-category-entry '(#x1C80 . #x1C8F) ?y)
 
-  ;; general punctuation
+  ;; space characters (see section 6.2 in the Unicode Standard)
+  (set-case-syntax ?  " " tbl)
   (setq c #x2000)
   (while (<= c #x200b)
     (set-case-syntax c " " tbl)
     (setq c (1+ c)))
+  (let ((chars '(#x202F #x205F #x3000)))
+    (while chars
+      (set-case-syntax (car chars) " " tbl)
+      (setq chars (cdr chars))))
+  ;; general punctuation
   (while (<= c #x200F)
     (set-case-syntax c "." tbl)
     (setq c (1+ c)))