From: MORIOKA Tomohiko Date: Wed, 4 Feb 2009 01:13:23 +0000 (+0000) Subject: (chise-tex-encode-ucs-char-at-point): Add setting for U+0250, U+0254, X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=292c543b99bf7d3ab2b626c02ce291cb204e4433;p=chise%2Fuptex-chise.git (chise-tex-encode-ucs-char-at-point): Add setting for U+0250, U+0254, U+0264 and U+026F; use \textglotstop{} instead of \UCSjis{0294} for U+0294. (chise-tex-encode-region-for-utf-8-jis): Avoid to insert multiple \CyrillicScript{...} and \GreekScript{...}. --- diff --git a/elisp/chise-tex.el b/elisp/chise-tex.el index 260f78b..a56484b 100644 --- a/elisp/chise-tex.el +++ b/elisp/chise-tex.el @@ -153,13 +153,30 @@ (delete-char) (insert "{\\usefont{T1}{pxr}{m}{n}\\ng}") t) + ((eq chr ?\u0250) + (delete-char) + (insert "\\textturna{}") + t) + ((eq chr ?\u0254) + (delete-char) + (insert "\\textopeno{}") + t) + ((eq chr ?\u0264) + (delete-char) + (insert "\\textramshorns{}") + t) + ((eq chr ?\u026F) + (delete-char) + (insert "\\textturnm{}") + t) ((eq chr ?\u0282) (delete-char) (insert "{\\usefont{T1}{pxr}{m}{n}\\k{s}}") t) ((eq chr ?\u0294) (delete-char) - (insert "\\UCSjis{0294}") + ;; (insert "\\UCSjis{0294}") + (insert "\\textglotstop{}") t) ((eq chr ?\u2022) (delete-char) @@ -353,10 +370,15 @@ ;; (eq pos (match-end 0))) ;; (insert "\\fontencoding{T2A}\\selectfont{}") ;; ) - (insert "\\CyrillicScript{") - (forward-char) - (skip-chars-forward "---\u0400-\u04F9 ") - (insert "}") + (if (search-backward "\\CyrillicScript{" + (- pos (eval-when-compile + (length "\\CyrillicScript{"))) + t) + (search-forward "}" nil t) + (insert "\\CyrillicScript{") + (forward-char) + (skip-chars-forward "---\u0400-\u04F9 ") + (insert "}")) ;; (setq font-encoding 'T2A) ) ) @@ -372,10 +394,15 @@ ;; (eq pos (match-end 0))) ;; (insert "\\fontencoding{LGR}\\selectfont{}") ;; ) - (insert "\\GreekScript{") - (forward-char) - (skip-chars-forward "\u0374-\u03F3 ") - (insert "}") + (if (search-backward "\\GreekScript{" + (- pos (eval-when-compile + (length "\\GreekScript{"))) + t) + (search-forward "}" nil t) + (insert "\\GreekScript{") + (forward-char) + (skip-chars-forward "\u0374-\u03F3 ") + (insert "}")) ;; (setq font-encoding 'LGR) ) ;; (unless (eq font-encoding 'T1)