/[emacs]/emacs/lisp/term/mac-win.el
ViewVC logotype

Diff of /emacs/lisp/term/mac-win.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.37 by mituharu, Tue Apr 12 09:01:36 2005 UTC revision 1.38 by mituharu, Tue Apr 12 10:27:29 2005 UTC
# Line 1085  XConsortium: rgb.txt,v 10.41 94/02/20 18 Line 1085  XConsortium: rgb.txt,v 10.41 94/02/20 18
1085  (put 'escape 'ascii-character ?\e)  (put 'escape 'ascii-character ?\e)
1086    
1087    
1088  ;;;; Keysyms  ;;;; Keyboard layout/language change events
1089    (defconst mac-script-code-coding-systems
1090  ;; Define constant values to be set to mac-keyboard-text-encoding    '((0 . mac-roman)                     ; smRoman
1091  (defconst kTextEncodingMacRoman 0)      (1 . japanese-shift-jis)            ; smJapanese
1092  (defconst kTextEncodingISOLatin1 513 "0x201")      (2 . chinese-big5)                  ; smTradChinese
1093  (defconst kTextEncodingISOLatin2 514 "0x202")      (3 . korean-iso-8bit)               ; smKorean
1094        (7 . mac-cyrillic)                  ; smCyrillic
1095        (25 . chinese-iso-8bit)             ; smSimpChinese
1096        (29 . mac-centraleurroman)          ; smCentralEuroRoman
1097        )
1098      "Alist of Mac script codes vs Emacs coding systems.")
1099    
1100    ;;;; Keyboard layout/language change events
1101    (defun mac-handle-language-change (event)
1102      (interactive "e")
1103      (let ((coding-system
1104             (cdr (assq (car (cadr event)) mac-script-code-coding-systems))))
1105        (set-keyboard-coding-system (or coding-system 'mac-roman))
1106        ;; MacJapanese maps reverse solidus to ?\x80.
1107        (if (eq coding-system 'japanese-shift-jis)
1108            (define-key key-translation-map [?\x80] "\\"))))
1109    
1110    (define-key special-event-map [language-change] 'mac-handle-language-change)
1111    
1112  ;;;; Selections and cut buffers  ;;;; Selections and cut buffers
1113    
# Line 1139  XConsortium: rgb.txt,v 10.41 94/02/20 18 Line 1155  XConsortium: rgb.txt,v 10.41 94/02/20 18
1155    
1156  (setq frame-creation-function 'x-create-frame-with-faces)  (setq frame-creation-function 'x-create-frame-with-faces)
1157    
1158  (define-ccl-program ccl-encode-mac-roman-font  (cp-make-coding-system
1159    `(0   mac-centraleurroman
1160      (if (r0 != ,(charset-id 'ascii))   (apply
1161          (if (r0 <= ?\x8f)    'vector
1162              (translate-character mac-roman-encoder r0 r1)    (mapcar
1163            ((r1 <<= 7)     (lambda (c) (decode-char 'ucs c))
1164             (r1 |= r2)     ;; mac-centraleurroman (128..255) -> UCS mapping
1165             (translate-character mac-roman-encoder r0 r1)))))     [    #x00C4  ;; 128:LATIN CAPITAL LETTER A WITH DIAERESIS
   "CCL program for Mac Roman font")  
   
 (let  
     ((encoding-vector (make-vector 256 nil))  
      (i 0)  
      (vec       ;; mac-centraleurroman (128..255) -> UCS mapping  
       [ #x00C4  ;; 128:LATIN CAPITAL LETTER A WITH DIAERESIS  
1166          #x0100  ;; 129:LATIN CAPITAL LETTER A WITH MACRON          #x0100  ;; 129:LATIN CAPITAL LETTER A WITH MACRON
1167          #x0101  ;; 130:LATIN SMALL LETTER A WITH MACRON          #x0101  ;; 130:LATIN SMALL LETTER A WITH MACRON
1168          #x00C9  ;; 131:LATIN CAPITAL LETTER E WITH ACUTE          #x00C9  ;; 131:LATIN CAPITAL LETTER E WITH ACUTE
# Line 1281  XConsortium: rgb.txt,v 10.41 94/02/20 18 Line 1290  XConsortium: rgb.txt,v 10.41 94/02/20 18
1290          #x017C  ;; 253:LATIN SMALL LETTER Z WITH DOT ABOVE          #x017C  ;; 253:LATIN SMALL LETTER Z WITH DOT ABOVE
1291          #x0122  ;; 254:LATIN CAPITAL LETTER G WITH CEDILLA          #x0122  ;; 254:LATIN CAPITAL LETTER G WITH CEDILLA
1292          #x02C7  ;; 255:CARON          #x02C7  ;; 255:CARON
1293          ])          ]))
1294       translation-table)   "Mac Central European Roman Encoding (MIME:x-mac-centraleurroman).")
1295    (while (< i 128)  (coding-system-put 'mac-centraleurroman 'mime-charset 'x-mac-centraleurroman)
1296      (aset encoding-vector i i)  
1297      (setq i (1+ i)))  (cp-make-coding-system
1298    (while (< i 256)   mac-cyrillic
1299      (aset encoding-vector i   (apply
1300            (decode-char 'ucs (aref vec (- i 128))))    'vector
1301      (setq i (1+ i)))    (mapcar
1302    (setq translation-table     (lambda (c) (decode-char 'ucs c))
1303          (make-translation-table-from-vector encoding-vector))     ;; mac-cyrillic (128..255) -> UCS mapping
1304  ;;  (define-translation-table 'mac-centraleurroman-decoder translation-table)     [    #x0410  ;; 128:CYRILLIC CAPITAL LETTER A
   (define-translation-table 'mac-centraleurroman-encoder  
     (char-table-extra-slot translation-table 0)))  
   
 (let  
     ((encoding-vector (make-vector 256 nil))  
      (i 0)  
      (vec       ;; mac-cyrillic (128..255) -> UCS mapping  
       [ #x0410  ;; 128:CYRILLIC CAPITAL LETTER A  
1305          #x0411  ;; 129:CYRILLIC CAPITAL LETTER BE          #x0411  ;; 129:CYRILLIC CAPITAL LETTER BE
1306          #x0412  ;; 130:CYRILLIC CAPITAL LETTER VE          #x0412  ;; 130:CYRILLIC CAPITAL LETTER VE
1307          #x0413  ;; 131:CYRILLIC CAPITAL LETTER GHE          #x0413  ;; 131:CYRILLIC CAPITAL LETTER GHE
# Line 1428  XConsortium: rgb.txt,v 10.41 94/02/20 18 Line 1429  XConsortium: rgb.txt,v 10.41 94/02/20 18
1429          #x044D  ;; 253:CYRILLIC SMALL LETTER E          #x044D  ;; 253:CYRILLIC SMALL LETTER E
1430          #x044E  ;; 254:CYRILLIC SMALL LETTER YU          #x044E  ;; 254:CYRILLIC SMALL LETTER YU
1431          #x20AC  ;; 255:EURO SIGN          #x20AC  ;; 255:EURO SIGN
1432          ])          ]))
1433       translation-table)   "Mac Cyrillic Encoding (MIME:x-mac-cyrillic).")
1434    (while (< i 128)  (coding-system-put 'mac-cyrillic 'mime-charset 'x-mac-cyrillic)
     (aset encoding-vector i i)  
     (setq i (1+ i)))  
   (while (< i 256)  
     (aset encoding-vector i  
           (decode-char 'ucs (aref vec (- i 128))))  
     (setq i (1+ i)))  
   (setq translation-table  
         (make-translation-table-from-vector encoding-vector))  
 ;;  (define-translation-table 'mac-cyrillic-decoder translation-table)  
   (define-translation-table 'mac-cyrillic-encoder  
     (char-table-extra-slot translation-table 0)))  
1435    
1436  (defvar mac-font-encoder-list  (defvar mac-font-encoder-list
1437    '(("mac-roman" mac-roman-encoder    '(("mac-roman" mac-roman-encoder
1438       ccl-encode-mac-roman-font "%s")       ccl-encode-mac-roman-font "%s")
1439      ("mac-centraleurroman" mac-centraleurroman-encoder      ("mac-centraleurroman" encode-mac-centraleurroman
1440       ccl-encode-mac-centraleurroman-font "%s ce")       ccl-encode-mac-centraleurroman-font "%s ce")
1441      ("mac-cyrillic" mac-cyrillic-encoder      ("mac-cyrillic" encode-mac-cyrillic
1442       ccl-encode-mac-cyrillic-font "%s cy")))       ccl-encode-mac-cyrillic-font "%s cy")))
1443    
1444  (let ((encoder-list  (let ((encoder-list
# Line 1468  XConsortium: rgb.txt,v 10.41 94/02/20 18 Line 1458  XConsortium: rgb.txt,v 10.41 94/02/20 18
1458              (if mac-encoded              (if mac-encoded
1459                  (aset table c mac-encoded))))))))                  (aset table c mac-encoded))))))))
1460    
1461    (define-ccl-program ccl-encode-mac-roman-font
1462      `(0
1463        (if (r0 != ,(charset-id 'ascii))
1464            (if (r0 <= ?\x8f)
1465                (translate-character mac-roman-encoder r0 r1)
1466              ((r1 <<= 7)
1467               (r1 |= r2)
1468               (translate-character mac-roman-encoder r0 r1)))))
1469      "CCL program for Mac Roman font")
1470    
1471  (define-ccl-program ccl-encode-mac-centraleurroman-font  (define-ccl-program ccl-encode-mac-centraleurroman-font
1472    `(0    `(0
1473      (if (r0 != ,(charset-id 'ascii))      (if (r0 != ,(charset-id 'ascii))
1474          (if (r0 <= ?\x8f)          (if (r0 <= ?\x8f)
1475              (translate-character mac-centraleurroman-encoder r0 r1)              (translate-character encode-mac-centraleurroman r0 r1)
1476            ((r1 <<= 7)            ((r1 <<= 7)
1477             (r1 |= r2)             (r1 |= r2)
1478             (translate-character mac-centraleurroman-encoder r0 r1)))))             (translate-character encode-mac-centraleurroman r0 r1)))))
1479    "CCL program for Mac Central European Roman font")    "CCL program for Mac Central European Roman font")
1480    
1481  (define-ccl-program ccl-encode-mac-cyrillic-font  (define-ccl-program ccl-encode-mac-cyrillic-font
1482    `(0    `(0
1483      (if (r0 != ,(charset-id 'ascii))      (if (r0 != ,(charset-id 'ascii))
1484          (if (r0 <= ?\x8f)          (if (r0 <= ?\x8f)
1485              (translate-character mac-cyrillic-encoder r0 r1)              (translate-character encode-mac-cyrillic r0 r1)
1486            ((r1 <<= 7)            ((r1 <<= 7)
1487             (r1 |= r2)             (r1 |= r2)
1488             (translate-character mac-cyrillic-encoder r0 r1)))))             (translate-character encode-mac-cyrillic r0 r1)))))
1489    "CCL program for Mac Cyrillic font")    "CCL program for Mac Cyrillic font")
1490    
1491    

Legend:
Removed from v.1.37  
changed lines
  Added in v.1.38

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26