emacs-elpa-diffs
[Top][All Lists]
Advanced

[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)))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]