comparison lisp/quail/quail-tit.el @ 110:fe104dbd9147 r20-1b7

Import from CVS: tag r20-1b7
author cvs
date Mon, 13 Aug 2007 09:19:45 +0200
parents 131b0175ea99
children
comparison
equal deleted inserted replaced
109:e183fc049578 110:fe104dbd9147
71 (defun tit-to-quail (tit-file &optional dest-dir) 71 (defun tit-to-quail (tit-file &optional dest-dir)
72 (interactive "Ftit file: ") 72 (interactive "Ftit file: ")
73 (let ((buf (get-buffer-create "*tit-work*")) 73 (let ((buf (get-buffer-create "*tit-work*"))
74 pos 74 pos
75 ;; tit keywords and default values 75 ;; tit keywords and default values
76 (encode '*euc-china*) 76 (encode 'euc-china)
77 (multichoice t) 77 (multichoice t)
78 prompt 78 prompt
79 comment 79 comment
80 validinputkey 80 validinputkey
81 (selectkey '["1 " "2" "3" "4" "5" "6" "7" "8" "9" "0" 81 (selectkey '["1 " "2" "3" "4" "5" "6" "7" "8" "9" "0"
90 (save-excursion 90 (save-excursion
91 (set-buffer buf) 91 (set-buffer buf)
92 (erase-buffer) 92 (erase-buffer)
93 (if (null (string-match "\\.tit$" tit-file)) 93 (if (null (string-match "\\.tit$" tit-file))
94 (setq tit-file (concat tit-file ".tit"))) 94 (setq tit-file (concat tit-file ".tit")))
95 (let ((file-coding-system-for-read '*noconv*)) 95 (let ((coding-system-for-read 'no-conversion))
96 (insert-file-contents tit-file)) 96 (insert-file-contents tit-file))
97 97
98 (set-visited-file-name (tit-dest-file tit-file dest-dir)) 98 (set-visited-file-name (tit-dest-file tit-file dest-dir))
99 (set-file-coding-system '*junet*unix) 99 (set-buffer-file-coding-system 'junet-unix)
100 100
101 ;; convert GB or BIG5 to Mule's internal code 101 ;; convert GB or BIG5 to Mule's internal code
102 (save-excursion 102 (save-excursion
103 (if (re-search-forward "^ENCODE:" nil t) 103 (if (re-search-forward "^ENCODE:" nil t)
104 (progn 104 (progn
105 (skip-chars-forward " \t") 105 (skip-chars-forward " \t")
106 (if (looking-at "GB") 106 (if (looking-at "GB")
107 (setq encode '*euc-china*) 107 (setq encode 'euc-china)
108 (setq encode '*big5*))))) 108 (setq encode 'big5)))))
109 (tit-message "Converting %s to Mule's internal code..." encode) 109 (tit-message "Converting %s to Mule's internal code..." encode)
110 (code-convert 1 (point-max) encode '*internal*) 110 (decode-coding-region 1 (point-max) encode)
111 111
112 (goto-char 1) 112 (goto-char 1)
113 ;; setting headers 113 ;; setting headers
114 (insert "(require 'quail)\n") 114 (insert "(require 'quail)\n")
115 115