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

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

Some mule-unicode-* characters are incorrectly displayed with fontset-ma


From: YAMAMOTO Mitsuharu
Subject: Some mule-unicode-* characters are incorrectly displayed with fontset-mac
Date: Sun, 12 Jan 2003 18:54:20 +0900 (JST)

This bug report will be sent to the Free Software Foundation,
not to your local site managers!
Please write in English if possible, because the Emacs maintainers
usually do not have translators to read other languages for them.

Your bug report will be posted to the address@hidden mailing list.

Please describe exactly what actions triggered the bug
and the precise symptoms of the bug:

In Carbon Emacs on Mac OS X, some characters within character sets
mule-unicode-* are incorrectly displayed as ASCII characters if we use
a predefined fontset "fontset-mac".  The problem can be reproduced by

    M-x set-frame-font RET fontset-mac RET
    M-x list-charset-chars RET mule-unicode-0100-24ff RET

The problem can be fixed by changing the definition of the fontset in
lisp/term/mac-win.el in either of the following ways:

1. exclude the case that the entry in the char-table has the value
   `nil'.

*** mac-win.el.~1.13.~  Mon Oct  7 19:45:20 2002
--- mac-win.el  Sun Jan 12 16:32:16 2003
***************
*** 204,210 ****
        (map-char-table
         (function
          (lambda (key val)
!           (or (generic-char-p key)
                (memq (char-charset key)
                      '(ascii eight-bit-control eight-bit-graphic))
                (set-fontset-font "fontset-mac" key monaco-font))))
--- 204,211 ----
        (map-char-table
         (function
          (lambda (key val)
!           (or (null val)
!               (generic-char-p key)
                (memq (char-charset key)
                      '(ascii eight-bit-control eight-bit-graphic))
                (set-fontset-font "fontset-mac" key monaco-font))))

2. use the char-table for decoding instead of that for encoding.

*** mac-win.el.~1.13.~  Mon Oct  7 19:45:20 2002
--- mac-win.el  Sat Jan 11 15:28:43 2003
***************
*** 205,214 ****
         (function
          (lambda (key val)
            (or (generic-char-p key)
!               (memq (char-charset key)
                      '(ascii eight-bit-control eight-bit-graphic))
!               (set-fontset-font "fontset-mac" key monaco-font))))
!        (get 'mac-roman-encoder 'translation-table)))))
  
  (if (eq system-type 'darwin)
      ;; On Darwin filenames are encoded in UTF-8
--- 205,214 ----
         (function
          (lambda (key val)
            (or (generic-char-p key)
!               (memq (char-charset val)
                      '(ascii eight-bit-control eight-bit-graphic))
!               (set-fontset-font "fontset-mac" val monaco-font))))
!        (get 'mac-roman-decoder 'translation-table)))))
  
  (if (eq system-type 'darwin)
      ;; On Darwin filenames are encoded in UTF-8


As for the fix 1 above, a similar problem can be found in
`optimize-char-coding-system-table' in lisp/international/mule.el.

(defun optimize-char-coding-system-table ()
  "Optimize `char-coding-system-table'.
Elements which compare `equal' are modified to share the same list."
  (let (cache)
    (map-char-table
     (lambda (k v)
       ;; This doesn't worry about elements which are permutations of
       ;; each other.  As it is, with utf-translate-cjk on and
       ;; code-pages loaded, the table has ~50k elements, which are
       ;; reduced to ~1k.  (`optimize-char-table' might win if
       ;; permutations were eliminated, but that's probably a small
       ;; effect and not easy to test.)
       (let ((existing (car (member v cache))))
         (if existing
             (aset char-coding-system-table k existing)
           (push v cache))))
     char-coding-system-table))
  (optimize-char-table char-coding-system-table))

If `v' is `nil', it is misinterpreted as a new element and pushed into
`cache'.  In my environment, where `utf-translate-cjk' is customized
to `t', the execution time of the above function is reduced by 10% if
we enclose the inner let-expression with `(if v ...)'.  With the
original definition, more than half of the elements in the list
`cache' were `nil's.

As far as I know, most of the uses of `char-map-table' essentially
operate only on entries having non-nil (or non-default?) values.  How
about adding some option to control the behavior of `char-map-table'
so that we can reduce the overhead of needless function calls?


In GNU Emacs 21.3.50.1 (powerpc-apple-darwin6.3)
 of 2003-01-06 on Macintosh.local.
configured using `configure '--with-carbon' '--without-x''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: ja_JP
  locale-coding-system: japanese-iso-8bit
  default-enable-multibyte-characters: t

Recent input:
M-x s e t - f r a m e - f o n t <return> f o n t s 
e t - m a c <return> M-x l i s t - c h a r s e t - 
c h a r s <return> e DEL m u l e - u n i TAB TAB 0 
TAB <return> M-x r e p o r t - e m TAB <return>

Recent messages:
Loading subst-gb2312...done
Loading subst-big5...done
Loading subst-jis...done
For information about the GNU Project and its goals, type C-h C-p.
Loading image...done
Loading mule-diag...
Loading codepage...done
Loading mule-diag...done
Making completion list...
Loading emacsbug...done




reply via email to

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