emacs-pretest-bug
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: emacs-unicode-2: `kinsoku processing' and `nospace-between-words' do


From: Zhang Wei
Subject: Re: emacs-unicode-2: `kinsoku processing' and `nospace-between-words' don't work
Date: Wed, 25 Oct 2006 05:16:58 +0800
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/23.0.0 (gnu/linux)

Kenichi Handa <address@hidden> writes:

> That makes too many unnecessary calls of `kinsoku'.  I've
> just installed a fix of the different way.  Could you please
> try with the latest code?

The `kinsoku' processing works great now, but `nospace-between-words'
still doesn't work for:

(set-language-environment "UTF-8") and,
(set-language-environment "Chinese-GB18030")

Should we do the same thing to the `nospace-between-words' property?

* local directory is at address@hidden/emacs--unicode--0--patch-122
* comparing to address@hidden/emacs--unicode--0--patch-122
A  lib-src/blessmail
A  patch.txt
M  lisp/textmodes/fill.el
M  lisp/international/characters.el

* modified files

--- orig/lisp/international/characters.el
+++ mod/lisp/international/characters.el
@@ -879,16 +879,20 @@
 (set-char-table-range auto-fill-chars '(#xFF00 . #xFF9F) t)
 (set-char-table-range auto-fill-chars '(#x20000 . #x2FFFF) t)
 
-(let ((l '(katakana-jisx0201
-          japanese-jisx0208 japanese-jisx0212
-          japanese-jisx0213-1 japanese-jisx0213-2
-          chinese-gb2312 chinese-gbk chinese-big5-1 chinese-big5-2
-          chinese-cns11643-1 chinese-cns11643-2 chinese-cns11643-3
-          chinese-cns11643-4 chinese-cns11643-5 chinese-cns11643-6
-          chinese-cns11643-7)))
-  (while l
-    (put-charset-property (car l) 'nospace-between-words t)
-    (setq l (cdr l))))
+(defvar nospace-between-words-chars-table
+  (let ((table (make-char-table nil)))
+    ;; Register `nospace-between-words' for scripts HAN, KANA,
+    ;; BOPOMPFO, and CJK-MISS.
+    (map-char-table #'(lambda (key val)
+                       (if (memq val '(han kana bopomofo cjk-misc))
+                           (set-char-table-range table key 
+                                                 'nospace-between-words)))
+                   char-script-table)
+    ;; Register `nospace-between-words' also for full width characters.
+    (set-char-table-range table '(#xFF01 . #xFF61) 'nospace-between-words)
+    (set-char-table-range table '(#xFFE0 . #xFFE6) 'nospace-between-words)
+    table)
+  "A char-table for characters with `nospace-between-words' property.")
 
 
 ;; CJK double width characters.


--- orig/lisp/textmodes/fill.el
+++ mod/lisp/textmodes/fill.el
@@ -452,7 +452,7 @@
   (if enable-multibyte-characters
       ;; Delete unnecessay newlines surrounded by words.  The
       ;; character category `|' means that we can break a line
-      ;; at the character.  And, charset property
+      ;; at the character.  And, character property
       ;; `nospace-between-words' tells how to concatenate
       ;; words.  If the value is non-nil, never put spaces
       ;; between words, thus delete a newline between them.
@@ -466,8 +466,7 @@
                (next (following-char)))
            (if (and (or (aref (char-category-set next) ?|)
                         (aref (char-category-set prev) ?|))
-                    (or (get-charset-property (char-charset prev)
-                                              'nospace-between-words)
+                    (or (aref nospace-between-words-chars-table prev)
                         (get-text-property (1- (match-beginning 0))
                                            'nospace-between-words)))
                (delete-char -1))))))



* added files

--- /dev/null
+++ 
/home/brep/emacs-source/emacs--unicode--0/,,address@hidden/new-files-archive/./lib-src/blessmail
@@ -0,0 +1,3 @@
+#!/bin/sh
+chgrp 8 $* && chmod g+s $*
+echo mail directory = /var/mail
--- /dev/null
+++ 
/home/brep/emacs-source/emacs--unicode--0/,,address@hidden/new-files-archive/./patch.txt
@@ -0,0 +1,2 @@
+* local directory is at address@hidden/emacs--unicode--0--patch-122
+* comparing to address@hidden/emacs--unicode--0--patch-122


reply via email to

[Prev in Thread] Current Thread [Next in Thread]