From 3b5d054e830f87ef86bc2336f6b95ee1dbf45c5e Mon Sep 17 00:00:00 2001 From: tomo Date: Thu, 5 Jan 2006 05:26:44 +0000 Subject: [PATCH] (chise-tex-encode-region-for-jis): Don't skip Latin-1 characters; try to convert composite characters to LaTeX macros. --- chise2otf/elisp/chise-tex.el | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/chise2otf/elisp/chise-tex.el b/chise2otf/elisp/chise-tex.el index 2a63476..9f8f4aa 100644 --- a/chise2otf/elisp/chise-tex.el +++ b/chise2otf/elisp/chise-tex.el @@ -92,8 +92,8 @@ (save-restriction (narrow-to-region start end) (goto-char start) - (let (chr ret rest spec) - (while (and (skip-chars-forward "\x00-\xFF") + (let (chr ret rest spec modifier) + (while (and (skip-chars-forward "\x00-\x7F") (not (eobp))) (setq chr (char-after)) (cond ((encode-char chr '=jis-x0208-1983) @@ -101,6 +101,21 @@ ;; ((setq ret (encode-char chr '=jis-x0208-1990)) ;; (delete-char) ;; (insert (decode-char '=jis-x0208-1983 ret))) + ((and (setq ret (char-feature chr '=decomposition)) + (setq modifier (assq (nth 1 ret) + '((?\u0300 . "`") + (?\u0301 . "'") + (?\u0302 . "^") + (?\u0303 . "~") + (?\u0304 . "=") + (?\u0307 . ".") + (?\u0308 . "\"") + (?\u030C . "v") + (?\u0323 . "d") + (?\u0327 . "c") + )))) + (delete-char) + (insert (format "\\%s{%c}" (cdr modifier) (car ret)))) ((and (or (encode-char chr '=jis-x0213-1-2000) (encode-char chr '=jis-x0213-2-2000)) (setq ret (or (encode-char chr '=ucs@jis/2000) -- 1.7.10.4