[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/auctex d0908cb 51/95: Fix auto selection of japanese Te
From: |
Tassilo Horn |
Subject: |
[elpa] externals/auctex d0908cb 51/95: Fix auto selection of japanese TeX engine |
Date: |
Sun, 16 Apr 2017 01:26:53 -0400 (EDT) |
branch: externals/auctex
commit d0908cb48082ff6e35496f41c97aee58e60bec7e
Author: Ikumi Keita <address@hidden>
Commit: Ikumi Keita <address@hidden>
Fix auto selection of japanese TeX engine
* tex-jp.el (japanese-latex-mode-initialization): Use
`LaTeX-match-class-option' to detect uplatex option given to
jsarticle, jsreport and jsbook class. (The root of this problem is
the same as Bug#25563)
(): Quit appending to `LaTeX-command-style' because this made the
user's intentional selection of `TeX-engine' ineffective with regard
to the selection of the executable names.
Fix copyright year.
; Add Ikumi Keita to maintainer of tex-jp.el.
* doc/auctex.texi (Japanese): Add description of Japanese TeX engine:
How to use, change and set the value of the engine.
Add description of the customize options related to the encoding of
Japanese TeX documents.
---
doc/auctex.texi | 122 +++++++++++++++++++++++++++++++++++++++++++++++---------
tex-jp.el | 24 ++++-------
2 files changed, 110 insertions(+), 36 deletions(-)
diff --git a/doc/auctex.texi b/doc/auctex.texi
index 6410004..ebd8512 100644
--- a/doc/auctex.texi
+++ b/doc/auctex.texi
@@ -4547,29 +4547,94 @@ If nil do it the other way round.
@cindex ASCII address@hidden
@cindex address@hidden
@cindex address@hidden
address@hidden address@hidden
address@hidden address@hidden
@cindex @file{tex-jp.el}
@vindex TeX-default-mode
address@hidden TeX-parse-self
address@hidden TeX-engine
address@hidden TeX-engine-alist
@vindex japanese-TeX-engine-default
@vindex japanese-LaTeX-default-style
-
-To write Japanese text with @AUCTeX{}, you need to have versions of
address@hidden and Emacs that support Japanese. There exist at least two
-variants of @TeX{} for Japanese text (NTT address@hidden and ASCII
address@hidden).
address@hidden can be used with @acronym{MULE, MULtilingual Enhancement to GNU
-Emacs} supported Emacsen.
-
-To use the Japanese @TeX{} variants, simply activate
address@hidden or @code{japanese-latex-mode} and
-everything should work. If not, send mail to Masayuki Ataka
address@hidden<ataka@@milk.freemail.ne.jp>}, who kindly donated the code for
-supporting Japanese in @AUCTeX{}. None of the primary @AUCTeX{}
address@hidden japanese-TeX-use-kanji-opt-flag
address@hidden TeX-japanese-process-input-coding-system
address@hidden TeX-japanese-process-output-coding-system
+
+To write Japanese text with @AUCTeX{}, you need the versions of
address@hidden and Emacs that support Japanese. @AUCTeX{} supports three
+Japanese @TeX{} engines by default: NTT address@hidden, ASCII address@hidden
and
address@hidden On XEmacs, @AUCTeX{} needs @acronym{MULE, MULtilingual
+Enhancement to GNU Emacs} feature to deal with Japanese text.
+
+To use the Japanese @TeX{} engines, activate
address@hidden or @code{japanese-latex-mode}. If it
+doesn't work, send mail to Masayuki Ataka
address@hidden<masayuki.ataka@@gmail.com>} or Ikumi Keita
address@hidden<ikumikeita@@jcom.home.ne.jp>}, who currently concern with
+stuff related to Japanese in @AUCTeX{}. None of the primary @AUCTeX{}
maintainers understand Japanese, so they cannot help you.
+It is recommended to enable @code{TeX-parse-self} for typical Japanese
address@hidden users. When enabled, @code{japanese-latex-mode} selects the
+suitable Japanese @TeX{} engine automatically based on the class file
+name (such as @code{jbook}, @code{jsarticle} and @code{tjreport}) and
+its option. @pxref{Parsing Files}
+
+It is important to select the suitable Japanese @TeX{} engine because
+the selected engine determines the command name such as @samp{platex}
+and @samp{uptex} to typeset the document. If you find that wrong
+command is used, check the value of @code{TeX-engine} on that buffer.
+If the value does not suit the current document, change the value by the
address@hidden Options} submenu below the @samp{Command} menu.
address@hidden Options}
+
+To make the selected engine to persist across Emacs sessions, there are
+two ways from which you can choose one according to your needs:
+
address@hidden
address@hidden
+If you use a specific engine (almost) exclusively, customize the option
address@hidden
+
address@hidden japanese-TeX-engine-default
+The default TeX engine in Japanese @TeX{} mode.
+
+The default value is @samp{ptex}.
address@hidden defopt
address@hidden
+If you want to set the engine on a per file basis, use the file local
+variables to set @code{TeX-engine}.
+
+Here is a sample code to set @code{TeX-engine} to @samp{uptex}:
+
address@hidden
+%%% Local Variables:
+%%% mode: japanese-latex
+%%% TeX-engine: uptex
+%%% End:
address@hidden example
address@hidden enumerate
+
+In the both cases above, the valid value is one of @samp{ptex},
address@hidden and @samp{uptex}.
+
+You can override the command names associated with the above three
+engines or define your own engine by customizing
address@hidden @xref{Processor Options}
+
+It is sometimes necessary to use an engine which differs from the one
address@hidden selects automatically. For example, even when you want to use
address@hidden document class deliberately with ASCII address@hidden,
address@hidden selects NTT address@hidden command if @code{TeX-parse-self} is
+enabled, because @code{j-article} originally belongs to NTT address@hidden
+In such cases, use the file local variable method above to select the
+engine you intend to use.
+
If you usually use @AUCTeX{} in Japanese, setting the following
variables is useful.
@defopt TeX-default-mode
-Mode to enter for a new file when it cannott be determined whether the
+Mode to enter for a new file when it cannot be determined whether the
file is plain @TeX{} or @LaTeX{} or what.
If you want to enter Japanese @LaTeX{} mode whenever this may happen,
@@ -4579,18 +4644,37 @@ set the variable like this:
@end lisp
@end defopt
address@hidden japanese-TeX-engine-default
-The default TeX engine in Japanese @TeX{} mode.
-
-The default value is @samp{ptex}.
address@hidden defopt
-
@defopt japanese-LaTeX-default-style
The default style/class when creating a new Japanese @LaTeX{} document.
The default value is @samp{"jarticle"}.
@end defopt
+It is recommended also for Japanese users to customize the option
address@hidden to @code{"Dvipdfmx"}. @xref{Processor Options}
+
+There are three customize options with regard to the encoding of
+Japanese text.
+
address@hidden japanese-TeX-use-kanji-opt-flag
+If non-nil, @AUCTeX{} adds @code{-kanji} option to the typesetting
+command when @code{TeX-engine} is @samp{ptex}.
address@hidden defopt
+
+Usually @AUCTeX{} guesses the right coding systems for input to and
+output from the Japanese @TeX{} process, but you can override them by
+the following two customize options.
+
address@hidden TeX-japanese-process-input-coding-system
+If non-nil, used for encoding input to Japanese @TeX{} process.
+When @code{nil}, @AUCTeX{} tries to choose suitable coding system.
address@hidden defopt
+
address@hidden TeX-japanese-process-output-coding-system
+If non-nil, used for decoding output from Japanese @TeX{} process.
+When @code{nil}, @AUCTeX{} tries to choose suitable coding system.
address@hidden defopt
+
The former customize options @code{japanese-TeX-command-default} and
@code{japanese-LaTeX-command-default} are obsolete. Use
@code{japanese-TeX-engine-default} instead. If you need to customize
diff --git a/tex-jp.el b/tex-jp.el
index a42cbe8..6cabd2f 100644
--- a/tex-jp.el
+++ b/tex-jp.el
@@ -1,10 +1,12 @@
;;; tex-jp.el --- Support for Japanese TeX. -*- coding: iso-2022-jp-unix; -*-
-;; Copyright (C) 1999, 2001-2007, 2012, 2016 Free Software Foundation, Inc.
+;; Copyright (C) 1999, 2001-2008, 2012-2013, 2016-2017
+;; Free Software Foundation, Inc.
;; Author: KOBAYASHI Shinji <address@hidden>,
;; Hidenobu Nabetani <address@hidden>
;; Maintainer: Masayuki Ataka <address@hidden>
+;; Ikumi Keita <address@hidden>
;; Keywords: tex
;; This file is part of AUCTeX.
@@ -261,16 +263,6 @@ For detail, see `TeX-command-list', to which this list is
appended."
"jlatex" '("/jtex/" "/jbibtex/bst/"))
'("/usr/share/texmf/jtex/" "/usr/share/texmf/jbibtex/bst/")))
-;; $B=gD4$K9T$1$PITMW$K$J$k!#(B
-(setq LaTeX-command-style
- (append '(("\\`u[jt]\\(article\\|report\\|book\\)\\'\\|\\`uplatex\\'"
- "%(PDF)uplatex %S%(PDFout)")
- ("\\`[jt]s?\\(article\\|report\\|book\\)\\'"
- "%(PDF)platex %(kanjiopt)%S%(PDFout)")
- ("\\`j-\\(article\\|report\\|book\\)\\'"
- "%(PDF)jlatex %S%(PDFout)"))
- LaTeX-command-style))
-
(defcustom japanese-TeX-error-messages t
"*If non-nil, explain TeX error messages in Japanese."
:group 'AUCTeX-jp
@@ -325,7 +317,7 @@ See also a user custom option
`TeX-japanese-process-input-coding-system'."
;; for upLaTeX
("ujarticle") ("ujreport") ("ujbook")
("utarticle") ("utreport") ("utbook"))
- "*List of Japanese document styles."
+ "*List of Japanese document classes."
:group 'AUCTeX-jp
:type '(repeat (group (string :format "%v"))))
@@ -524,14 +516,12 @@ Set `japanese-TeX-mode' to t, and enter `TeX-latex-mode'."
(when japanese-TeX-mode
; (setq TeX-command-default japanese-LaTeX-command-default)
(TeX-engine-set
- ;; class file $BL>address@hidden)(B
- ;; jLaTeX $B$K$b(B jarticle $B$O0l1~$"$k$7!"(BpLaTeX $B$G$b<+J,$G(B
j-article $B$r(B
- ;; $B%$%s%9%H!<%k$7$F;H$C$F$$$1$J$$K!$O$J$$!#(B
(cond
- ((TeX-match-style
"\\`u[jt]\\(article\\|report\\|book\\)\\'\\|\\`uplatex\\'")
+ ((TeX-match-style "\\`u[jt]\\(article\\|report\\|book\\)\\'")
'uptex)
((TeX-match-style "\\`[jt]s?\\(article\\|report\\|book\\)\\'")
- 'ptex)
+ (if (LaTeX-match-class-option "\\`uplatex\\'")
+ 'uptex 'ptex))
((TeX-match-style "\\`j-\\(article\\|report\\|book\\)\\'")
'jtex)
(t japanese-TeX-engine-default)))
- [elpa] externals/auctex 8fdc494 63/95: ; Provide fallback when no locale information is available, (continued)
- [elpa] externals/auctex 8fdc494 63/95: ; Provide fallback when no locale information is available, Tassilo Horn, 2017/04/16
- [elpa] externals/auctex 9d12a06 66/95: Use `TeX-replace-regexp-in-string' in style files, Tassilo Horn, 2017/04/16
- [elpa] externals/auctex a71a72d 74/95: Add support for Japanese font command, Tassilo Horn, 2017/04/16
- [elpa] externals/auctex 88a7563 81/95: Fix last improvement for skipping of inline verbatim macros, Tassilo Horn, 2017/04/16
- [elpa] externals/auctex 16f24dd 90/95: ; * style/minted.el (LaTeX-minted-add-syntactic-keywords-extra): Fix doc string., Tassilo Horn, 2017/04/16
- [elpa] externals/auctex a46c307 77/95: Improve fontification of verbatim macros in style/minted.el, Tassilo Horn, 2017/04/16
- [elpa] externals/auctex 83890d6 86/95: Update package options in style/amsmath.el, Tassilo Horn, 2017/04/16
- [elpa] externals/auctex 94b227d 89/95: * doc/auctex.texi (Selecting a Command): Document `TeX-ispell-verb-delimiters'., Tassilo Horn, 2017/04/16
- [elpa] externals/auctex 4225941 59/95: Modify `TeX-expand-list-builtin' instead of `TeX-expand-list', Tassilo Horn, 2017/04/16
- [elpa] externals/auctex 79361b5 58/95: Add new style/fvextra.el, Tassilo Horn, 2017/04/16
- [elpa] externals/auctex d0908cb 51/95: Fix auto selection of japanese TeX engine,
Tassilo Horn <=
- [elpa] externals/auctex aac8694 67/95: Use compat function `TeX-replace-regexp-in-string' in core files, Tassilo Horn, 2017/04/16
- [elpa] externals/auctex 5a84d95 88/95: Fix `paragraph-start' and `paragraph-separate', Tassilo Horn, 2017/04/16
- [elpa] externals/auctex 618bdf1 85/95: Append \b to regexp built from TeX control words, Tassilo Horn, 2017/04/16
- [elpa] externals/auctex 0cde29b 87/95: ; * tex-ispell.el (TeX-ispell-verb-delimiters): Remove `*'., Tassilo Horn, 2017/04/16
- [elpa] externals/auctex 07a2903 82/95: Don't alter standard value or saved value themselves of customize option, Tassilo Horn, 2017/04/16
- [elpa] externals/auctex 194a8f8 62/95: Add LaTeX inline math delimiters to Ispell skip list, Tassilo Horn, 2017/04/16
- [elpa] externals/auctex 7390999 61/95: ; Simplify insertion of a newline after label, Tassilo Horn, 2017/04/16
- [elpa] externals/auctex 6a298a8 47/95: Fix documents and add trivial improvements., Tassilo Horn, 2017/04/16
- [elpa] externals/auctex a286e8b 57/95: Improve parsing capabilities of style/fancyvrb.el, Tassilo Horn, 2017/04/16
- [elpa] externals/auctex 11e234b 55/95: Remove spurious entries of view settings., Tassilo Horn, 2017/04/16