bug-texinfo
[Top][All Lists]
Advanced

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

multibyte chars in @multitable.


From: 鯉江英隆
Subject: multibyte chars in @multitable.
Date: Mon, 20 Nov 2000 02:46:18 +0900

I'm using texinfo-4.0.

In @multitable, when @item FOO is multibyte char like Japanese,
texinfmt.el causes a wrong fitting, because
string-bytes() returns in bytes with leading character and
length() returns in chars in the language.
To get a real width of @item, use current-column().

texinfmt-version is "2.38 of 3 July 1998".

--- texinfmt.el.~1~     Thu Aug 24 00:21:20 2000
+++ texinfmt.el Thu Aug 24 11:51:44 2000
@@ -48,9 +48,6 @@ (defun texinfmt-version (&optional here)
           (message "%s" version-string)
         version-string))))
 
-(defun LENGTH (seq)
-  (string-bytes seq))
-
 
 ;;; Variable definitions
 
@@ -1953,7 +1950,9 @@ (defun texinfo-multitable-widths ()
                  ;; forward-sexp works with braces in Texinfo mode
                   (progn (forward-sexp 1) (1- (point)))))
             (setq texinfo-multitable-width-list
-                  (cons (- end-of-template start-of-template)
+                  (cons (-
+                         (progn (goto-char end-of-template) (current-column))
+                         (progn (goto-char start-of-template) 
(current-column)))
                         texinfo-multitable-width-list))
             ;; Remove carriage return from within a template, if any.
             ;; This helps those those who want to use more than
@@ -1975,7 +1974,7 @@ (defun texinfo-multitable-widths ()
     (let ((desired-columns
            (+
             ;; between column spaces
-            (LENGTH texinfo-multitable-width-list)
+            (length texinfo-multitable-width-list)
             ;; additional between column spaces, if any
             texinfo-extra-inter-column-width
             ;; sum of spaces for each entry
@@ -2031,7 +2030,7 @@ (defun texinfo-multitable-item ()
     (let ((tab-number 1))                       ; one @tab between two columns
       (while (search-forward "@tab" nil t)
         (setq tab-number (1+ tab-number)))
-      (if (/= tab-number (LENGTH table-widths))
+      (if (/= tab-number (length table-widths))
           (error "Wrong number of @tab's in a @multitable row.")))
     (goto-char (point-min))
 ;; 2. Format each cell, and copy to a rectangle
@@ -2075,9 +2074,8 @@ (defun texinfo-multitable-item ()
              (needed-whitespace
               (1+
                (- fill-column
-                  (-
-                   (progn (end-of-line) (point)) ; end of existing line
-                   beg)))))
+                  (progn (end-of-line) (current-column)) ; end of existing line
+                  ))))
         (insert (make-string
                  (if (> needed-whitespace 0) needed-whitespace 1)
                  ? )))
@@ -2095,7 +2093,7 @@ (defun texinfo-multitable-item ()
           here)
       (while (> table-column 0)
         (let ((this-rectangle (int-to-string table-column)))
-          (while (< (LENGTH this-rectangle) table-entry-height)
+          (while (< (length this-rectangle) table-entry-height)
             (setq this-rectangle (append this-rectangle '("")))))
         (setq table-column (1- table-column)))
 ;; 5. Insert formatted rectangles in original buffer
@@ -2822,7 +2820,7 @@ (defun texinfo-sort-startkeyfun ()
     (while (string-match "[ \t][ \t]+\\|[^a-z0-9 ]+" line)
       (setq line (concat (substring line 0 (match-beginning 0))
                          " "
-                         (substring line (match-end 0) (LENGTH line)))))
+                         (substring line (match-end 0) (length line)))))
     line))
 
 

--
KOIE Hidetaka <address@hidden>



reply via email to

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