yatex

changeset 503:d675f6d06481 dev

Format string `%k' in tex-command replaced to kanji-coding mnemonic. Thus, (setq tex-command "platex -kanji=%k") is acceptable.
author HIROSE Yuuji <yuuji@gentei.org>
date Tue, 02 Jan 2018 21:22:04 +0900
parents db7a90bd4621
children 4b5055c54331
files yatex.el yatexlib.el yatexprc.el
diffstat 3 files changed, 31 insertions(+), 6 deletions(-) [+]
line diff
     1.1 --- a/yatex.el	Sun Dec 10 22:01:03 2017 +0900
     1.2 +++ b/yatex.el	Tue Jan 02 21:22:04 2018 +0900
     1.3 @@ -1,6 +1,6 @@
     1.4  ;;; yatex.el --- Yet Another tex-mode for emacs //–ì’¹// -*- coding: sjis -*-
     1.5  ;;; (c)1991-2017 by HIROSE Yuuji.[yuuji@yatex.org]
     1.6 -;;; Last modified Sun Sep 17 10:22:43 2017 on firestorm
     1.7 +;;; Last modified Tue Jan  2 19:26:15 2018 on firestorm
     1.8  ;;; $Id$
     1.9  ;;; The latest version of this software is always available at;
    1.10  ;;; https://www.yatex.org/
    1.11 @@ -49,11 +49,16 @@
    1.12  
    1.13  (defvar tex-command
    1.14    (cond
    1.15 -   (YaTeX-use-LaTeX2e "platex")
    1.16 +   (YaTeX-use-LaTeX2e "platex -kanji=%k")
    1.17     (YaTeX-japan "jlatex")
    1.18     (t "latex"))
    1.19    "*Default command for typesetting LaTeX text.
    1.20 -Overridden with `%#! CommandLine...' in the buffer.")
    1.21 +Overridden with `%#! CommandLine...' in the buffer.
    1.22 +`%'s followed by a character are replaced as follows:
    1.23 +%f -> Parent(main) document file name
    1.24 +%r -> %f without extension
    1.25 +%k -> One of Kanji code mnemonic: euc, jis, sjis, utf8
    1.26 +")
    1.27  
    1.28  (defvar bibtex-command (if YaTeX-japan "jbibtex" "bibtex")
    1.29    "*Default command of BibTeX.
     2.1 --- a/yatexlib.el	Sun Dec 10 22:01:03 2017 +0900
     2.2 +++ b/yatexlib.el	Tue Jan 02 21:22:04 2018 +0900
     2.3 @@ -1,7 +1,7 @@
     2.4  ;;; yatexlib.el --- YaTeX and yahtml common libraries -*- coding: sjis -*-
     2.5  ;;; 
     2.6  ;;; (c)1994-2017 by HIROSE Yuuji.[yuuji@yatex.org]
     2.7 -;;; Last modified Sun Sep 17 10:23:31 2017 on firestorm
     2.8 +;;; Last modified Tue Jan  2 17:50:03 2018 on firestorm
     2.9  ;;; $Id$
    2.10  
    2.11  ;;; Code:
    2.12 @@ -121,6 +121,25 @@
    2.13  
    2.14  ;---------- Define default key bindings on YaTeX mode map ----------
    2.15  ;;;###autoload
    2.16 +(defun YaTeX-kanji-ptex-mnemonic ()
    2.17 +  "Return the kanji-mnemonic of pTeX from current buffer's coding-system."
    2.18 +  (if (boundp 'NEMACS)
    2.19 +      (or (cdr-safe (assq kanji-fileio-code
    2.20 +			  '((1 . "sjis") (2 . "jis") (3 . "euc"))))
    2.21 +	  "")
    2.22 +    (let ((coding
    2.23 +	   (cond
    2.24 +	    ((boundp 'buffer-file-coding-system)
    2.25 +	     (symbol-name buffer-file-coding-system))
    2.26 +	    ((boundp 'file-coding-system) (symbol-name file-coding-system))))
    2.27 +	  (case-fold-search t))
    2.28 +      (cond ((string-match "utf-8\\>" coding)			"utf-8")
    2.29 +	    ((string-match "shift.jis\\|cp932\\>" coding)	"sjis")
    2.30 +	    ((string-match "junet\\|iso.2022" coding)		"jis")
    2.31 +	    ((string-match "euc.jp\\|ja.*iso.8bit" coding)	"euc")
    2.32 +	    (t "")))))
    2.33 +
    2.34 +;;;###autoload
    2.35  (defun YaTeX-define-key (key binding &optional map)
    2.36    "Define key on YaTeX-prefix-map."
    2.37    (if YaTeX-inhibit-prefix-letter
     3.1 --- a/yatexprc.el	Sun Dec 10 22:01:03 2017 +0900
     3.2 +++ b/yatexprc.el	Tue Jan 02 21:22:04 2018 +0900
     3.3 @@ -1,7 +1,7 @@
     3.4  ;;; yatexprc.el --- YaTeX process handler -*- coding: sjis -*-
     3.5  ;;; 
     3.6  ;;; (c)1993-2017 by HIROSE Yuuji.[yuuji@yatex.org]
     3.7 -;;; Last modified Mon Oct 30 21:00:21 2017 on firestorm
     3.8 +;;; Last modified Tue Jan  2 17:50:40 2018 on firestorm
     3.9  ;;; $Id$
    3.10  
    3.11  ;;; Code:
    3.12 @@ -1351,7 +1351,8 @@
    3.13  	(t (concat (substring magic 0 (string-match "\\s [^-]\\S *$" magic)) " "))))
    3.14        (t (concat tex-command " " (if switch parent))))
    3.15       (list (cons "f" tparent)
    3.16 -	   (cons "r" (substring tparent 0 (rindex tparent ?.)))))))
    3.17 +	   (cons "r" (substring tparent 0 (rindex tparent ?.)))
    3.18 +	   (cons "k" (YaTeX-kanji-ptex-mnemonic))))))
    3.19  
    3.20  (defvar YaTeX-lpr-command-history nil
    3.21    "Holds command line history of YaTeX-lpr.")