Hi Uwe and all,

> 21.5 might, I am not so sure about 21.4, and I do remember discussions
> about this issue on the xemacs beta list some time ago. I will come back
> to you soon.

Actually, I would like to settle things up soon because there are futher
shortcomings in tex-jp.el which I want to work on fixing.  So, I'm
planning to install the attached patches in the git repository in a few
days unless someone objects.

The patch #1 is revised a bit according to Arash's comment
http://lists.gnu.org/archive/html/auctex-devel/2017-02/msg00009.html
but is essentially the same as the former one.  The patch #2 is the same
as before.

Since the changes are confined within tex-jp.el only, I suppose those do
not cause problem to most of the users.  Of course, feel free to revert
them if it turns out to be false.

Regards,
Ikumi Keita

>From ik...@ikumi.que.jp Tue Feb 14 23:23:28 2017
Content-Type: text/plain; charset="iso-2022-jp"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: [PATCH] Fix setting of coding system for Japanese TeX
X-Mercurial-Node: e419d47482682f24658dc7761299150fc3b10703
X-Mercurial-Series-Index: 1
X-Mercurial-Series-Total: 1
Message-Id: <e419d47482682f24658d.1487082...@localhost.my.domain>
X-Mercurial-Series-Id: <e419d47482682f24658d.1487082...@localhost.my.domain>
User-Agent: Mercurial-patchbomb/4.0.1
Date: Tue, 14 Feb 2017 23:23:28 +0900
From: Ikumi Keita <ik...@ikumi.que.jp>
To: dummy

* tex-jp.el (japanese-TeX-set-process-coding-system): Cater for the
case that kanji option is requested by user but cannot be determined.
XEmacs doesn't have `locale-coding-system'.  Use
`get-coding-system-from-locale' and `current-locale' instead.
Cleanup indentation.
(japanese-TeX-coding-ejsu): Add entry for xemacs coding system of cp932.

diff --git a/tex-jp.el b/tex-jp.el
--- a/tex-jp.el
+++ b/tex-jp.el
@@ -358,7 +358,7 @@
 		   ((eq TeX-engine 'ptex)
 		    (cond ((eq system-type 'darwin)
 			   'utf-8)
-			  (japanese-TeX-use-kanji-opt-flag
+			  ((and japanese-TeX-use-kanji-opt-flag kanji)
 			   kanji)
 			  (t 'shift_jis)))
 		   ;; jtex なら sjis に固定する。
@@ -377,8 +377,23 @@
 		   ;; ただし、locale が日本語をサポートしない場合は
 		   ;; euc に固定する。
 		   (t
-		    (if (japanese-TeX-coding-ejsu locale-coding-system)
-			locale-coding-system 'euc-jp))))))
+		    (let ((lcs
+			   (cond
+			    ((boundp 'locale-coding-system)
+			     locale-coding-system)
+			    ;; XEmacs doesn't have `locale-coding-system'.
+			    ;; Instead xemacs 21.5 has
+			    ;; `get-coding-system-from-locale' and
+			    ;; `current-locale'.  They aren't available on
+			    ;; xemacs 21.4.
+			    ((and
+			      (featurep 'xemacs)
+			      (fboundp 'get-coding-system-from-locale)
+			      (fboundp 'current-locale))
+			     (get-coding-system-from-locale
+			      (current-locale))))))
+		      (if (and lcs (japanese-TeX-coding-ejsu lcs))
+			  lcs 'euc-jp)))))))
 
 	   ;; process に与える入力の文字コード。
 	   (enc (cond
@@ -397,9 +412,10 @@
 		 (t
 		  'utf-8))))
 	;; Customize 値があればそれを優先。
-	(set-process-coding-system process
-				   (or TeX-japanese-process-output-coding-system dec)
-				   (or TeX-japanese-process-input-coding-system enc))))))
+	(set-process-coding-system
+	 process
+	 (or TeX-japanese-process-output-coding-system dec)
+	 (or TeX-japanese-process-input-coding-system enc))))))
 (when (featurep 'mule)
   (setq TeX-after-start-process-function
         #'japanese-TeX-set-process-coding-system))
@@ -424,16 +440,16 @@
                 (mule-utf-8 . "utf8") ; for emacs 21, 22
                 ;; utf-8-auto や utf-8-emacs を入れる必要はあるのか?
 
-                ;; xemacs で jisx0213 は使えるのか?使えるとして、
-                ;; その coding system 名は?
+                ;; xemacs 21.5 with mule には、jisx0213 の charset は
+                ;; あるがそれ用の coding system はない。
                 (euc-jis-2004 . "euc")
                 (iso-2022-jp-2004 . "jis")
                 (japanese-shift-jis-2004 . "sjis")
 
-                ;; xemacs に cp932 系の coding system があるのか
-                ;; どうかもよくわからない。
                 (japanese-cp932 . "sjis")
-                (eucjp-ms . "euc"))))))
+                (eucjp-ms . "euc")
+                (windows-932 . "sjis") ; for xemacs 21.5 with mule
+		)))))
 
 (defun japanese-TeX-get-encoding-string ()
   "Return coding option string for Japanese pTeX family.


>From ik...@ikumi.que.jp Mon Feb 06 20:48:47 2017
Content-Type: text/plain; charset="iso-2022-jp"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: [PATCH] Make papersize predicate in tex-jp.el to work again
X-Mercurial-Node: 76406cd7ac7dba0efff66c64cc0166c88abb994b
X-Mercurial-Series-Index: 1
X-Mercurial-Series-Total: 1
Message-Id: <76406cd7ac7dba0efff6.1486381...@localhost.my.domain>
X-Mercurial-Series-Id: <76406cd7ac7dba0efff6.1486381...@localhost.my.domain>
User-Agent: Mercurial-patchbomb/4.0.1
Date: Mon, 06 Feb 2017 20:48:47 +0900
From: Ikumi Keita <ik...@ikumi.que.jp>
To: dummy

Problem parallel to bug#25563.

* tex-jp.el (): Use `LaTeX-match-class-option' to examine paper size
option of document class.

diff --git a/tex-jp.el b/tex-jp.el
--- a/tex-jp.el
+++ b/tex-jp.el
@@ -183,24 +183,31 @@
 (unless (get 'TeX-view-predicate-list 'saved-value)
   (setq TeX-view-predicate-list
        '((paper-a4
-          (TeX-match-style
-           "\\`\\(a4j\\|a4paper\\|a4dutch\\|a4wide\\|sem-a4\\)\\'"))
+	  (let ((regex "\\`\\(?:a4j\\|a4paper\\|a4dutch\\|a4wide\\|sem-a4\\)\\'"))
+	    (or (TeX-match-style regex)
+		(and (fboundp 'LaTeX-match-class-option)
+		     (LaTeX-match-class-option regex)))))
          (paper-a5
-          (TeX-match-style
-           "\\`\\(a5j\\|a5paper\\|a5comb\\)\\'"))
+	  (let ((regex "\\`\\(?:a5j\\|a5paper\\|a5comb\\)\\'"))
+	    (or (TeX-match-style regex)
+		(and (fboundp 'LaTeX-match-class-option)
+		     (LaTeX-match-class-option regex)))))
          ;; jarticle などだと b4paper, b5paper は JIS B 系列。
          ;; j-article などの方には a4j, b5j といったオプションはない。
          (paper-b5    ; ISO B5
-          (and (TeX-match-style "\\`b5paper\\'")
-               (not (memq TeX-engine '(ptex uptex)))))
+          (and (fboundp 'LaTeX-match-class-option)
+	       (LaTeX-match-class-option "\\`b5paper\\'")
+               (not (TeX-match-style "\\`u?[jt]s?\\(?:article\\|report\\|book\\)\\'"))))
          (paper-b5jis ; JIS B5
-          (or (TeX-match-style "\\`b5j\\'")
-              (and (TeX-match-style "\\`b5paper\\'")
-                   (memq TeX-engine '(ptex uptex)))))
+	  (and (fboundp 'LaTeX-match-class-option)
+	       (or (LaTeX-match-class-option "\\`b5j\\'")
+		   (and (LaTeX-match-class-option "\\`b5paper\\'")
+			(TeX-match-style "\\`u?[jt]s?\\(?:article\\|report\\|book\\)\\'")))))
          ;; article などには b4paper というオプションはない。
          ;; b4paper というオプションがあったら JIS B4 と見なす。
          (paper-b4jis
-          (TeX-match-style "\\`\\(b4j\\|b4paper\\)\\'")))))
+	  (and (fboundp 'LaTeX-match-class-option)
+	       (LaTeX-match-class-option "\\`\\(?:b4j\\|b4paper\\)\\'"))))))
 ;; jsarticle だと他にももっと判型のオプションがあるが、
 ;; 全部面倒見てるとキリがないので、これくらいでいいだろう。
 ;; jsarticle.el や jsbook.el で追加分の処理を仕込めばいいのかも知れない。


_______________________________________________
auctex-devel mailing list
auctex-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/auctex-devel

Reply via email to