yatex

changeset 13:eafae54794a0

Show message at comment-region on begin/end mode. Greek letters completion in yatexmth. YaTeX-mark environment and YaTeX-%-menu added. Erase cursor at the execution of dviout(DOS). Enable recursive completion at section-type completion.
author yuuji
date Sat, 29 Jan 1994 07:59:59 +0000
parents a7f397790cdc
children b7b023a74293
files docs/yatex.ref yahtml.el yatex.el yatex.new yatex.prj yatexadd.el yatexgen.el yatexm-o.el yatexmth.el yatexprc.el
diffstat 10 files changed, 476 insertions(+), 128 deletions(-) [+]
line diff
     1.1 --- a/docs/yatex.ref	Mon Oct 25 14:35:00 1993 +0000
     1.2 +++ b/docs/yatex.ref	Sat Jan 29 07:59:59 1994 +0000
     1.3 @@ -112,6 +112,8 @@
     1.4  
     1.5  	  新規作成/更新モード、数式モードの切り替えメニューが出ます。
     1.6  
     1.7 +	◆%# 記法の編集			[prefix] %
     1.8 +
     1.9  								   広瀬雄二
    1.10  							yuuji@ae.keio.ac.jp
    1.11  							pcs39334(ASCII-NET)
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/yahtml.el	Sat Jan 29 07:59:59 1994 +0000
     2.3 @@ -0,0 +1,42 @@
     2.4 +;;; -*- Emacs-Lisp -*-
     2.5 +;;; (c ) 1994 by HIROSE Yuuji [yuuji@ae.keio.ac.jp, pcs39334@ascii-net]
     2.6 +;;; Last modified Sat Jan 29 16:58:00 1994 on gloria
     2.7 +;;; This is sample hack definition for HTML.
     2.8 +;;;
     2.9 +;;; [Purely tentative version]
    2.10 +;;; $Id$
    2.11 +
    2.12 +(require 'yatex)
    2.13 +(defvar yahtml-prefix-map (copy-keymap YaTeX-prefix-map))
    2.14 +(defvar yahtml-mode-map nil
    2.15 +  "Keymap used in yahtml-mode.")
    2.16 +(if yahtml-mode-map nil
    2.17 +  (setq yahtml-mode-map (make-sparse-keymap))
    2.18 +  (define-key yahtml-mode-map YaTeX-prefix yahtml-prefix-map))
    2.19 +
    2.20 +(defun yahtml-mode ()
    2.21 +  (interactive)
    2.22 +  (yatex-mode)
    2.23 +  (setq major-mode 'yahtml-mode
    2.24 +	mode-name "yahtml")
    2.25 +  (make-local-variable 'YaTeX-ec)
    2.26 +  (setq YaTeX-ec "")
    2.27 +  (make-local-variable 'YaTeX-struct-begin)
    2.28 +  (setq YaTeX-struct-begin "<%1>")
    2.29 +  (make-local-variable 'YaTeX-struct-end)
    2.30 +  (setq YaTeX-struct-end "</%1>")
    2.31 +  (make-local-variable 'env-table)
    2.32 +  (setq env-table
    2.33 +	'(("HTML") ("HEAD") ("TITLE") ("BODY") ("H1") ("H2") ("H3") ("DL")))
    2.34 +  (make-local-variable 'YaTeX-prefix-map)
    2.35 +  (setq YaTeX-prefix-map yahtml-prefix-map)
    2.36 +  (use-local-map yahtml-mode-map)
    2.37 +  (YaTeX-define-begend-key "bh" "HTML")
    2.38 +  (YaTeX-define-begend-key "bH" "HEAD")
    2.39 +  (YaTeX-define-begend-key "bt" "TITLE")
    2.40 +  (YaTeX-define-begend-key "bb" "BODY")
    2.41 +  (YaTeX-define-begend-key "bd" "DL")
    2.42 +  (YaTeX-define-begend-key "b1" "H1")
    2.43 +  (YaTeX-define-begend-key "b2" "H2")
    2.44 +  (YaTeX-define-begend-key "b3" "H3")
    2.45 +)
     3.1 Binary file yatex.el has changed
     4.1 --- a/yatex.new	Mon Oct 25 14:35:00 1993 +0000
     4.2 +++ b/yatex.new	Sat Jan 29 07:59:59 1994 +0000
     4.3 @@ -2,6 +2,16 @@
     4.4  	Yet Another tex-mode for Emacs
     4.5  	yatex.el 各バージョンの変更点について。
     4.6  
     4.7 +1.45:	comment-region を begin/end 行で起動した時にメッセージを出す。
     4.8 +	yatexmth:イメージ補完で複数の補完テーブルが使えるようにし、
     4.9 +	/で始まるギリシャ文字補完を追加。
    4.10 +	YaTeX-mark-evrironment を追加。
    4.11 +	[prefix] % の %#記法編集メニューを追加。
    4.12 +	dviout起動時(DOS)にカーソルを消すようにした。
    4.13 +	section型コマンドの引数入力時に section/large/maketitle 型補完を
    4.14 +	再帰的に利用できるようにした。
    4.15 +	yatexaddの引数型付加関数に第二引数以後の処理が行かないバグを修正。
    4.16 +
    4.17  1.44:	タイプセットプログラムの起動処理を高速化。
    4.18  	エラージャンプのウィンドウ利用の最適化。
    4.19  	数式モード/修正モードのモードライン表示修正。
     5.1 --- a/yatex.prj	Mon Oct 25 14:35:00 1993 +0000
     5.2 +++ b/yatex.prj	Sat Jan 29 07:59:59 1994 +0000
     5.3 @@ -1,11 +1,22 @@
     5.4  //今後の拡張予定//
     5.5  
     5.6 -【section型補完の引数の候補】
     5.7 +【section型補完の引数の候補】			○
     5.8  
     5.9  	(setq section-table
    5.10  	      '(("part" 0) ;...段落コマンドなど...
    5.11  		("documentstyle" 1 YaTeX:documentstyle)	;候補シンボル
    5.12  		("setlength" 2 )))
    5.13 +***↑これは候補テーブルではなく、アドイン関数として対処するようにした。
    5.14 +
    5.15 +【[prefix] > のbegin/end上でのコメントの警告】	○
    5.16 +【mark begin to end】				○
    5.17 +【Demacs: dviout起動時前後にカーソル on/off】	○
    5.18 +【\ref,\labelの対応の不整合はどうする?】
    5.19 +【\ref,\label ジャンプがまだ隠し機能】
    5.20 +【\ref補完で後から\label作るモード】
    5.21 +【\[を入れた時に\]を入れて自動インデントなど】
    5.22 +【オンラインヘルプ】
    5.23 +
    5.24  
    5.25  
    5.26  Local Variables:
     6.1 --- a/yatexadd.el	Mon Oct 25 14:35:00 1993 +0000
     6.2 +++ b/yatexadd.el	Sat Jan 29 07:59:59 1994 +0000
     6.3 @@ -1,8 +1,8 @@
     6.4  ;;; -*- Emacs-Lisp -*-
     6.5  ;;; YaTeX add-in functions.
     6.6 -;;; yatexadd.el rev.5
     6.7 -;;; (c)1991-1993 by HIROSE Yuuji.[yuuji@ae.keio.ac.jp]
     6.8 -;;; Last modified Wed Oct  6 03:40:30 1993 on 98fa
     6.9 +;;; yatexadd.el rev.6
    6.10 +;;; (c )1991-1993 by HIROSE Yuuji.[yuuji@ae.keio.ac.jp]
    6.11 +;;; Last modified Sat Jan 29 16:55:09 1994 on gloria
    6.12  ;;; $Id$
    6.13  
    6.14  (provide 'yatexadd)
    6.15 @@ -166,6 +166,10 @@
    6.16  ;; take an argument ARGP that specify the argument position.
    6.17  ;; If argument position is out of range, nil should be returned,
    6.18  ;; else nil should NOT be returned.
    6.19 +
    6.20 +;;
    6.21 +; Label selection
    6.22 +;;
    6.23  (defvar YaTeX-label-menu-other
    6.24    (if YaTeX-japan "':他のバッファのラベル\n" "':LABEL IN OTHER BUFFER.\n"))
    6.25  (defvar YaTeX-label-menu-any
    6.26 @@ -317,6 +321,35 @@
    6.27      )
    6.28  )
    6.29  
    6.30 +;;
    6.31 +; completion for the arguments of \newcommand
    6.32 +;;
    6.33 +(defun YaTeX::newcommand (&optional argp)
    6.34 +  (cond
    6.35 +   ((= argp 1)
    6.36 +    (let ((command (read-string "Define newcommand: " "\\")))
    6.37 +      (put 'YaTeX::newcommand 'command (substring command 1))
    6.38 +      command))
    6.39 +   ((= argp 2)
    6.40 +    (let ((argc
    6.41 +	   (string-to-int (read-string "Number of arguments(Default 0): ")))
    6.42 +	  (def (read-string "Definition: "))
    6.43 +	  (command (get 'YaTeX::newcommand 'command)))
    6.44 +      ;;!!! It's illegal to insert string in the add-in function !!!
    6.45 +      (if (> argc 0) (insert (format "[%d]" argc)))
    6.46 +      (if (and (stringp command)
    6.47 +	       (string< "" command)
    6.48 +	       (y-or-n-p "Update user completion table?"))
    6.49 +	  (YaTeX-update-table
    6.50 +	   (if (> argc 1) (list command argc) (list command))
    6.51 +	   'section-table 'user-section-table 'tmp-section-table))
    6.52 +      (message "")
    6.53 +      def				;return command name
    6.54 +      ))
    6.55 +   (t ""))
    6.56 +)
    6.57 +
    6.58 +
    6.59  ;;;
    6.60  ;; global subroutines
    6.61  ;;;
     7.1 --- a/yatexgen.el	Mon Oct 25 14:35:00 1993 +0000
     7.2 +++ b/yatexgen.el	Sat Jan 29 07:59:59 1994 +0000
     7.3 @@ -1,8 +1,8 @@
     7.4  ;;; -*- Emacs-Lisp -*-
     7.5  ;;; Generate add-in functions for YaTeX.
     7.6  ;;; yatexgen.el rev.1(beta2)
     7.7 -;;; (c)1991-1993 by HIROSE Yuuji.[yuuji@ae.keio.ac.jp]
     7.8 -;;; Last modified Mon Sep 20 17:55:13 1993 on gloria
     7.9 +;;; (c )1991-1993 by HIROSE Yuuji.[yuuji@ae.keio.ac.jp]
    7.10 +;;; Last modified Sat Jan 29 16:55:07 1994 on gloria
    7.11  ;;; $Id$
    7.12  
    7.13  (require 'yatex)
     8.1 --- a/yatexm-o.el	Mon Oct 25 14:35:00 1993 +0000
     8.2 +++ b/yatexm-o.el	Sat Jan 29 07:59:59 1994 +0000
     8.3 @@ -1,7 +1,7 @@
     8.4  ;;; -*- Emacs-Lisp -*-
     8.5  ;;; Sample startup file to invoke yatex-mode with outline-minor mode.
     8.6 -;;; (C)1993 by HIROSE Yuuji [yuuji@ae.keio.ac.jp]
     8.7 -;;; Last modified Wed Apr 28 04:25:16 1993 on 98fa
     8.8 +;;; (c )1993 by HIROSE Yuuji [yuuji@ae.keio.ac.jp]
     8.9 +;;; Last modified Sat Jan 29 16:55:05 1994 on gloria
    8.10  
    8.11  ;;;
    8.12  ;; outline-minor-mode(使用しない場合は不要です)
     9.1 --- a/yatexmth.el	Mon Oct 25 14:35:00 1993 +0000
     9.2 +++ b/yatexmth.el	Sat Jan 29 07:59:59 1994 +0000
     9.3 @@ -1,22 +1,124 @@
     9.4  ;;; -*- Emacs-Lisp -*-
     9.5  ;;; YaTeX interface for math-mode.
     9.6 -;;; yatexmth.el rev.0
     9.7 -;;; (C)1993 by HIROSE Yuuji [yuuji@ae.keio.ac.jp]
     9.8 -;;; Last modified Tue Aug  3 23:37:07 1993 on 98fa
     9.9 +;;; yatexmth.el rev.2
    9.10 +;;; (c )1993 by HIROSE Yuuji [yuuji@ae.keio.ac.jp]
    9.11 +;;; Last modified Sat Jan 29 16:55:03 1994 on gloria
    9.12  ;;; $Id$
    9.13  
    9.14 +;;; [Customization guide]
    9.15 +;;;
    9.16 +;;;	  By default,  you can use two  completion  groups in YaTeX math
    9.17 +;;;	mode, `,' for mathematical signs and `/' for greek letters.  But
    9.18 +;;;	you  can add other completion groups   by defining the  alist of
    9.19 +;;;	`prefix  key'    vs   `completion   list'    into  the  variable
    9.20 +;;;	YaTeX-math-key-list-private.  If  you wish  to    accomplish the
    9.21 +;;;	completion as follows(prefix key is `;'):
    9.22 +;;;
    9.23 +;;;		KEY		COMPLETION
    9.24 +;;;		s		\sin
    9.25 +;;;		S		\arcsin
    9.26 +;;;		c		\cos
    9.27 +;;;		C		\arccos
    9.28 +;;;			:
    9.29 +;;;		T		\arctan
    9.30 +;;;		l		\log
    9.31 +;;;		hs		\sinh
    9.32 +;;;
    9.33 +;;;	Typing `s' after `;' makes `\sin', `hs' after `;' makes `\sinh'
    9.34 +;;;	and so on.  First, you have to define list of key-completion
    9.35 +;;;	pairs.  Variable name(YaTeX-math-funcs-list) is arbitrary.
    9.36 +;;;
    9.37 +;;;		(setq YaTeX-math-funcs-list
    9.38 +;;;		      '(("s"	"sin")
    9.39 +;;;			("S"	"arcsin")
    9.40 +;;;				:
    9.41 +;;;			("hs"	"sinh")))
    9.42 +;;;
    9.43 +;;;	Next, define the list of prefix-key vs completion list(defined
    9.44 +;;;	above) into the variable YaTeX-math-key-list-private.
    9.45 +;;;
    9.46 +;;;		(setq YaTeX-math-key-list-private
    9.47 +;;;		      '((";" . YaTeX-math-funcs-list)
    9.48 +;;;			("'" . Other-List-if-any)))
    9.49 +;;;
    9.50 +;;;	  Put these expressions into your ~/.emacs, and you can use this
    9.51 +;;;	completion in the YaTeX-math-mode.
    9.52 +;;;
    9.53 +;;;	  And you can add your favorite completion sequences to the
    9.54 +;;;	default completion list invoked with `,', by defining those lists
    9.55 +;;;	into variable YaTeX-math-sign-alist-private.
    9.56 +
    9.57 +;;; 【イメージ補完の追加方法】
    9.58 +;;;
    9.59 +;;;	  標準のイメージ補完では、「,」で始まる数式記号補完と、「/」で始
    9.60 +;;;	まるギリシャ文字補完が使用可能ですが、これ以外の文字で始まる補完
    9.61 +;;;	シリーズも定義することができます。例えば、「;」で始まる次のよう
    9.62 +;;;	な補完シリーズを定義する場合を考えてみます。
    9.63 +;;;
    9.64 +;;;		補完キー	補完結果
    9.65 +;;;		s		\sin
    9.66 +;;;		S		\arcsin
    9.67 +;;;		c		\cos
    9.68 +;;;		C		\arccos
    9.69 +;;;			:
    9.70 +;;;		T		\arctan
    9.71 +;;;		l		\log
    9.72 +;;;		hs		\sinh
    9.73 +;;;
    9.74 +;;;	「;」のあとに s を押すと \sin が、hs を押すと \sinh が入力されま
    9.75 +;;;	す。このような補完リストの登録は以下のようにします(変数名は任意)。
    9.76 +;;;
    9.77 +;;;		(setq YaTeX-math-funcs-list
    9.78 +;;;		      '(("s"	"sin")
    9.79 +;;;			("S"	"arcsin")
    9.80 +;;;				:
    9.81 +;;;			("hs"	"sinh")))
    9.82 +;;;
    9.83 +;;;	さらに、「;」を押した時にイメージ補完が始まるよう次の変数に、起動キー
    9.84 +;;;	と上で定義した補完用変数の登録を行ないます。
    9.85 +;;;
    9.86 +;;;		(setq YaTeX-math-key-list-private
    9.87 +;;;		      '((";" . YaTeX-math-funcs-list)
    9.88 +;;;			("'" . ほかに定義したいシリーズがあれば…)))
    9.89 +;;;
    9.90 +;;;	これらを ~/.emacs に書いておけば、野鳥の math-mode で自分専用の
    9.91 +;;;	イメージ補完が利用できます。
    9.92 +
    9.93 +(defvar YaTeX-jisold
    9.94 +  (and (boundp 'dos-machine-type)
    9.95 +       (eq dos-machine-type 'pc98)))
    9.96 +
    9.97 +(defmacro YaTeX-setq-math-sym (sym old new)
    9.98 +  (list 'setq sym (list 'if 'YaTeX-jisold old new)))
    9.99 +
   9.100 +(YaTeX-setq-math-sym YaTeX-image-in		"E"    		"∈")
   9.101 +(YaTeX-setq-math-sym YaTeX-image-ni		"ヨ"		"∋")
   9.102 +(YaTeX-setq-math-sym YaTeX-image-subset		" _\n(\n ~"	"⊂")
   9.103 +(YaTeX-setq-math-sym YaTeX-image-subseteq	" _\n(_\n ~"	"⊆")
   9.104 +(YaTeX-setq-math-sym YaTeX-image-supset		"_\n )\n~"	"⊃")
   9.105 +(YaTeX-setq-math-sym YaTeX-image-supseteq	"_\n_)\n~" 	"⊇")
   9.106 +(YaTeX-setq-math-sym YaTeX-image-nabla		"___\n\\\\/"	"∇")
   9.107 +(YaTeX-setq-math-sym YaTeX-image-partial	" -+\n+-+\n+-+" "∂")
   9.108 +(YaTeX-setq-math-sym YaTeX-image-dagger		"+\n|"		"†")
   9.109 +(YaTeX-setq-math-sym YaTeX-image-ddagger	"+\n+\n|"	"‡")
   9.110 +(YaTeX-setq-math-sym YaTeX-image-equiv		"=\n ̄"	"≡")
   9.111 +(YaTeX-setq-math-sym YaTeX-image-int		" /\\\n \\\n\\/" "∫")
   9.112 +(YaTeX-setq-math-sym YaTeX-image-bot		"|\n ̄"	"⊥")
   9.113 +(YaTeX-setq-math-sym YaTeX-image-neg		"イ"		"¬")
   9.114 +(YaTeX-setq-math-sym YaTeX-image-flat		"b"		"♭")
   9.115 +
   9.116  (setq
   9.117 - YaTeX-math-key-alist-default
   9.118 + YaTeX-math-sign-alist-default
   9.119   '(
   9.120     ;frequently used
   9.121     ("||"	"|"		("||"		"‖"))
   9.122     ("sum"	"sum"		("\\-+\n >\n/-+" "Σ"))
   9.123     ("sigma"	"sum"		("\\-+\n >\n/-+" "Σ"))
   9.124 -   ("integral"	"int"		" /\\\n \\\n\\/")
   9.125 +   ("integral"	"int"		(" /\\\n \\\n\\/" YaTeX-image-int))
   9.126     ("ointegral"	"oint"		" /\\\n(\\)\n\\/")
   9.127     ("A"		"forall"	"|_|\nV")
   9.128     ("E"		"exists"	"-+\n-+\n-+")
   9.129 -   ("!"		"neg"		"--+\n  |")
   9.130 +   ("!"		"neg"		("--+\n  |" YaTeX-image-neg))
   9.131     ("oo"	"infty"		("oo"		"∞"))
   9.132     ("\\"	"backslash"	("\\"		"\"))
   9.133  
   9.134 @@ -54,26 +156,26 @@
   9.135     ("o/"	"oslash"	" _\n(/)\n ~")
   9.136     ("o."	"odot"		"(.)")
   9.137     ("O"		"bigcirc"	"O")
   9.138 -   ("t"		"dagger"	"+\n|")
   9.139 -   ("tt"	"ddagger"	"+\n+\n|")
   9.140 +   ("t"		"dagger"	("+\n|" YaTeX-image-dagger))
   9.141 +   ("tt"	"ddagger"	("+\n+\n|" YaTeX-image-ddagger))
   9.142     ("II"	"amalg"		"II")
   9.143     ;	:
   9.144     ;;relational operators
   9.145     ("<"		"leq"		("<\n-"		"≦"))
   9.146     (">"		"geq"		(">\n-"		"≧"))
   9.147 -   ("-="	"equiv"		"=\n-")
   9.148 -   ("=-"	"equiv"		"=\n-")
   9.149 -   ("---"	"equiv"		"=\n-")
   9.150 -   ("("		"subset"	" _\n(\n ~")
   9.151 -   ("(-"	"subseteq"	" _\n(_\n~")
   9.152 -   (")"		"supset"	"_\n )\n~")
   9.153 -   (")-"	"supseteq"	"_\n_)\n~")
   9.154 +   ("-="	"equiv"		("=\n-"		YaTeX-image-equiv))
   9.155 +   ("=-"	"equiv"		("=\n-"		YaTeX-image-equiv))
   9.156 +   ("---"	"equiv"		("=\n-"		YaTeX-image-equiv))
   9.157 +   ("("		"subset"	(" _\n(\n ~"	YaTeX-image-subset))
   9.158 +   ("(-"	"subseteq"	(" _\n(_\n ~"	YaTeX-image-subseteq))
   9.159 +   (")"		"supset"	("_\n )\n~"	YaTeX-image-supset))
   9.160 +   (")-"	"supseteq"	("_\n_)\n~"	YaTeX-image-supseteq))
   9.161     ("["		"sqsubset"	"[")
   9.162     ("[-"	"sqsubseteq"	"[\n~")
   9.163     ("]"		"sqsupset"	"]")
   9.164     ("]-"	"sqsupseteq"	"]\n~")
   9.165 -   ("{"		"in"		"(-")
   9.166 -   ("}"		"ni"		"-)")
   9.167 +   ("{"		"in"		("(-" YaTeX-image-in))
   9.168 +   ("}"		"ni"		("-)" YaTeX-image-ni))
   9.169     ("|-"	"vdash"		"|-")
   9.170     ("-|"	"dashv"		"-|")
   9.171     ("~"		"sim"		"~(tild)")
   9.172 @@ -98,10 +200,12 @@
   9.173     ;	:
   9.174     ;;arrows
   9.175     ("<-"	"leftarrow"	("<-"		"←"))
   9.176 -   ("<--"	"longleftarrow"	("<-"		"←--"))
   9.177 +   ("\C-b"	"leftarrow"	("<-"		"←"))
   9.178 +   ("<--"	"longleftarrow"	("<--"		"←--"))
   9.179     ("<="	"Leftarrow"	"<=")
   9.180     ("<=="	"Longleftarrow"	"<==")
   9.181     ("->"	"rightarrow"	("->"		"→"))
   9.182 +   ("\C-f"	"rightarrow"	("->"		"→"))
   9.183     ("-->"	"longrightarrow" ("-->"		"--→"))
   9.184     ("==>"	"Longrightarrow" "==>")
   9.185     ("<->"	"leftrightarrow" ("<->"		"←→"))
   9.186 @@ -109,9 +213,11 @@
   9.187     ("<=>"	"leftrightarrow" "<=>")
   9.188     ("<==>"	"Longleftrightarrow" "<==>")
   9.189     ("^|"	"uparrow"	("^\n|" "↑"))
   9.190 +   ("\C-p"	"uparrow"	("^\n|" "↑"))
   9.191     ("^||"	"Uparrow"	"/\\\n||")
   9.192     ("\C-n"	"downarrow"	("|\nv" "↓"))
   9.193 -   ("^|"	"uparrow"	("^\n|" "↑"))
   9.194 +   ("v|"	"downarrow"	("|\nv" "↓"))
   9.195 +   ("v||"	"Downarrow"	"||\n\\/")
   9.196     ("|->"	"mapsto"	("|->"		"|→"))
   9.197     ("<-)"	"hookleftarrow"	("   ,\n<--+"	"   ヽ\n<--/"))
   9.198     ("/-"	"leftharpoonup"	"/\n~~~")
   9.199 @@ -131,16 +237,16 @@
   9.200     ("mho"	"mho"		"~|_|~")
   9.201     ("'"		"prime"		"'")
   9.202     ("0"		"emptyset"	"0")
   9.203 -   ("nabla"	"nabla"		"___\n\\\\/")
   9.204 +   ("nabla"	"nabla"		("___\n\\\\/" YaTeX-image-nabla))
   9.205     ("\\/"	"surd"		"-\\/")
   9.206     ("surd"	"surd"		"-\\/")
   9.207     ("top"	"top"		"T")
   9.208 -   ("bot"	"bot"		"_|_")
   9.209 -   ("b"		"flat"		"b")
   9.210 +   ("bot"	"bot"		("_|_"		YaTeX-image-bot))
   9.211 +   ("b"		"flat"		("b"		YaTeX-image-flat))
   9.212     ("LT"	"natural"	"|\nLT\n |")
   9.213 -   ("6"		"partial"	" -+\n+-+\n+-+")
   9.214 -   ("partial"	"partial"	" -+\n+-+\n+-+")
   9.215 -   ("round"	"partial"	" -+\n+-+\n+-+")
   9.216 +   ("6"		"partial"	(" -+\n+-+\n+-+" YaTeX-image-partial))
   9.217 +   ("partial"	"partial"	(" -+\n+-+\n+-+" YaTeX-image-partial))
   9.218 +   ("round"	"partial"	(" -+\n+-+\n+-+" YaTeX-image-partial))
   9.219     ("[]"	"box"		"[]")
   9.220     ("Diamond"	"Diamond"	"/\\\n\\/")
   9.221     ("3"		"triangle"	"/\\\n~~")
   9.222 @@ -151,23 +257,82 @@
   9.223  
   9.224     ))
   9.225  
   9.226 -(defvar YaTeX-math-key-alist-private nil
   9.227 +(defvar YaTeX-math-sign-alist-private nil
   9.228    "*User definable key vs LaTeX-math-command alist.")
   9.229  
   9.230  (defvar YaTeX-math-quit-with-strict-match nil
   9.231    "*T for quitting completion as soon as strict-match is found.")
   9.232 -(setq YaTeX-math-key-alist
   9.233 -      (append YaTeX-math-key-alist-private YaTeX-math-key-alist-default))
   9.234 +(setq YaTeX-math-sign-alist
   9.235 +      (append YaTeX-math-sign-alist-private YaTeX-math-sign-alist-default))
   9.236  
   9.237 -(setq YaTeX-math-key-array
   9.238 -  (let ((array (make-vector (length YaTeX-math-key-alist) ""))
   9.239 -	(list YaTeX-math-key-alist) (i 0))
   9.240 -    (while list
   9.241 -      (aset array i (car (car list)))
   9.242 -      (setq i (1+ i) list (cdr list)))
   9.243 -    array))
   9.244 +;;(defun YaTeX-math-alist2array (alist array)
   9.245 +;;  (set array
   9.246 +;;       (let ((array (make-vector (length alist) "")) (list alist) (i 0))
   9.247 +;;	 (while list
   9.248 +;;	   (aset array i (car (car list)))
   9.249 +;;	   (setq i (1+ i) list (cdr list)))
   9.250 +;;	 array))
   9.251 +;;)
   9.252  
   9.253 -(defvar YaTeX-ec "\\" "Escape character of mark-up language.")
   9.254 +(setq YaTeX-greek-key-alist-default
   9.255 +  '(
   9.256 +    ("a"	"alpha"		("a" "α"))
   9.257 +    ("b"	"beta"		("|>\n|>\n|" "β"))
   9.258 +    ("g"	"gamma"		("~r" "γ"))
   9.259 +    ("G"	"Gamma"		("|~" "Γ"))
   9.260 +    ("d"	"delta"		("<~\n<>" "δ"))
   9.261 +    ("D"	"Delta"		("/\\\n~~" "Δ"))
   9.262 +    ("e"	"epsilon"	"<\n<~")
   9.263 +    ("e-"	"varepsilon"	("(\n(~" "ε"))
   9.264 +    ("z"	"zeta"		("(~\n >" "ζ"))
   9.265 +    ("et"	"eta"		("n\n/" "η"))
   9.266 +    ("th"	"theta"		("8" "θ"))
   9.267 +    ("Th"	"Theta"		("(8)" "Θ"))
   9.268 +    ("th-"	"vartheta"	("-8" "-θ"))
   9.269 +    ("i"	"iota"		("i\n\\_/" "ι"))
   9.270 +    ("k"	"kappa"		("k" "κ"))
   9.271 +    ("l"	"lambda"	("\\n/\\" "λ"))
   9.272 +    ("L"	"Lambda"	("/\\" "Λ"))
   9.273 +    ("m"	"mu"		(" u_\n/" "μ"))
   9.274 +    ("n"	"nu"		("|/" "ν"))
   9.275 +    ("x"	"xi"		("E\n >" "ξ"))
   9.276 +    ("X"	"Xi"		("---\n -\n---" "Ξ"))
   9.277 +    ("p"	"pi"		("__\n)(" "π"))
   9.278 +    ("P"	"Pi"		("__\n||" "Π"))
   9.279 +    ("p-"	"varpi"		("_\nw" "__\nω"))
   9.280 +    ("r"	"rho"		("/O" "ρ"))
   9.281 +    ("r-"	"varrho"	("/O\n~~" "ρ\n~~"))
   9.282 +    ("s"	"sigma"		("o~" "σ"))
   9.283 +    ("S"	"Sigma"		("\\-+\n >\n/-+" "Σ"))
   9.284 +    ("s-"	"varsigma"	"(~~ \n>")
   9.285 +    ("t"	"tau"		("__\n(" "τ"))
   9.286 +    ("u"	"upsilon"	("~v" "υ"))
   9.287 +    ("y"	"upsilon"	("~v" "υ"))
   9.288 +    ("U"	"Upsilon"	("~Y~" "Υ"))
   9.289 +    ("Y"	"Upsilon"	("~Y~" "Υ"))
   9.290 +    ("ph"	"phi"		("  /\n(/)\n/" "φ"))
   9.291 +    ("Ph"	"Phi"		(" _\n(|)\n ~" "Φ"))
   9.292 +    ("ph-"	"varphi"	"\\O\n|")
   9.293 +    ("c"	"chi"		("x" "χ"))
   9.294 +    ("ps"	"psi"		("\\|/\\n |" "ψ"))
   9.295 +    ("Ps"	"Psi"		(" ~\n\\|/\\n |" "Ψ"))
   9.296 +    ("o"	"omega"		("w" "ω"))
   9.297 +    ("w"	"omega"		("w" "ω"))
   9.298 +    ("O"	"Omega"		("(~)\n~ ~" "Ω"))
   9.299 +    ("W"	"Omega"		("(~)\n~ ~" "Ω"))
   9.300 +    ("f" "foo")
   9.301 +    )
   9.302 +)
   9.303 +
   9.304 +(defvar YaTeX-greek-key-alist-private nil
   9.305 +  "*User definable key vs LaTeX-math-command alist.")
   9.306 +
   9.307 +(setq YaTeX-greek-key-alist
   9.308 +      (append YaTeX-greek-key-alist-private YaTeX-greek-key-alist-default))
   9.309 +
   9.310 +;;(mapcar (function (lambda (x) (YaTeX-math-alist2array x)))
   9.311 +;;	YaTeX-math-key-list)
   9.312 +
   9.313  (setq YaTeX-math-indicator
   9.314    "KEY\tLaTeX sequence\t\tsign")
   9.315  
   9.316 @@ -201,11 +366,69 @@
   9.317    (define-key YaTeX-math-menu-map "\^m"	'exit-recursive-edit)
   9.318    (define-key YaTeX-math-menu-map "q"	'abort-recursive-edit))
   9.319  
   9.320 +(defvar YaTeX-math-key-list-default
   9.321 +  '(("," . YaTeX-math-sign-alist)
   9.322 +    ("/" . YaTeX-greek-key-alist))
   9.323 +  "Default key sequence to invoke math-mode's image completion."
   9.324 +)
   9.325 +(defvar YaTeX-math-key-list-private nil
   9.326 +  "*User defined alist, math-mode-prefix vs completion alist"
   9.327 +)
   9.328 +(defvar YaTeX-math-key-list
   9.329 +  (append YaTeX-math-key-list-private YaTeX-math-key-list-default)
   9.330 +  "Key sequence to invoke math-mode's image completion."
   9.331 +)
   9.332 +(defvar YaTeX-math-exit-key "\e"
   9.333 +  "*Key sequence after prefix key of YaTeX-math-mode to exit from math-mode."
   9.334 +)
   9.335 +
   9.336  (defmacro YaTeX-math-japanese-sign (list)
   9.337    (list 'nth 1 list))
   9.338  
   9.339  (defvar YaTeX-math-cmd-regexp (concat (regexp-quote YaTeX-ec) "[A-z]"))
   9.340  
   9.341 +;;;
   9.342 +;;YaTeX math-mode functions
   9.343 +;;;
   9.344 +;##autoload from yatex.el
   9.345 +(defun YaTeX-toggle-math-mode (&optional arg)
   9.346 +  (interactive "P")
   9.347 +  (require 'yatexmth)
   9.348 +  (or (memq 'YaTeX-math-mode mode-line-format) nil
   9.349 +      (setq mode-line-format
   9.350 +	    (append (list "" 'YaTeX-math-mode) mode-line-format)))
   9.351 +  (if (or arg (null YaTeX-math-mode))
   9.352 +      (let ((keys ""))
   9.353 +	(setq YaTeX-math-mode "math:")
   9.354 +	(mapcar
   9.355 +	 (function (lambda (x)
   9.356 +		     (let ((key (car x)) (list (cdr x)))
   9.357 +		       (setq keys (concat keys " " key))
   9.358 +		       (put 'YaTeX-math-key-list list (key-binding key))
   9.359 +		       (define-key YaTeX-mode-map key
   9.360 +			 'YaTeX-math-insert-sequence))))
   9.361 +	 YaTeX-math-key-list)
   9.362 +	(message "Turn on math mode. Prefix keys are %s" keys)
   9.363 +	(sit-for 3)
   9.364 +	(message
   9.365 +	 (concat "To exit from math-mode, type `ESC' after prefix, "
   9.366 +		 "or type `"
   9.367 +		 (key-description
   9.368 +		  (car
   9.369 +		   (where-is-internal 'YaTeX-switch-mode-menu YaTeX-mode-map)))
   9.370 +		 " $'")))
   9.371 +    (setq YaTeX-math-mode nil)
   9.372 +    (mapcar
   9.373 +     (function (lambda (x)
   9.374 +		 (let ((key (car x)) (list (cdr x)))
   9.375 +		   (define-key YaTeX-mode-map key
   9.376 +		     (get 'YaTeX-math-key-list list)))))
   9.377 +     YaTeX-math-key-list)
   9.378 +    (setq YaTeX-math-mode nil)
   9.379 +    (message "Exit from math mode."))
   9.380 +  (set-buffer-modified-p (buffer-modified-p))
   9.381 +)
   9.382 +
   9.383  (defun YaTeX-math-forward (arg)
   9.384    (interactive "p")
   9.385    (re-search-forward YaTeX-math-cmd-regexp nil t arg))
   9.386 @@ -214,13 +437,22 @@
   9.387    (interactive "p")
   9.388    (re-search-backward YaTeX-math-cmd-regexp nil t arg))
   9.389  
   9.390 +(defun YaTeX-math-gets (sign)
   9.391 +  (cond
   9.392 +   ((null sign) nil)
   9.393 +   ((listp sign)
   9.394 +    (setq sign
   9.395 +	  (cond
   9.396 +	   (YaTeX-japan (YaTeX-math-japanese-sign sign))
   9.397 +	   (t (car sign))))
   9.398 +    (YaTeX-math-gets sign))
   9.399 +   ((symbolp sign)
   9.400 +    (YaTeX-math-gets (symbol-value sign)))
   9.401 +   (t sign))
   9.402 +)
   9.403 +
   9.404  (defun YaTeX-math-get-sign (list)
   9.405 -  (let ((sign (car (cdr (cdr list)))))
   9.406 -    (if (listp sign)
   9.407 -	(setq sign (cond
   9.408 -		    (YaTeX-japan (YaTeX-math-japanese-sign sign))
   9.409 -		    (t (car sign)))))
   9.410 -    sign)
   9.411 +  (YaTeX-math-gets (car (cdr-safe (cdr-safe list))))
   9.412  )
   9.413  
   9.414  (defun YaTeX-math-display-list (list cols)
   9.415 @@ -236,7 +468,7 @@
   9.416      (insert "\\" (car (cdr list)))
   9.417      (setq indent (+ indent YaTeX-math-max-seq))
   9.418      (setq sign (YaTeX-math-get-sign list))
   9.419 -    (while (not (string= "" sign))
   9.420 +    (while (and sign (not (string= "" sign)))
   9.421        (setq to (string-match "\n" sign)
   9.422  	    str (if to (substring sign 0 to) sign))
   9.423        (end-of-line)
   9.424 @@ -253,8 +485,10 @@
   9.425      (pop-to-buffer YaTeX-math-menu-buffer)
   9.426      (let ((maxcols (max 1 (/ (screen-width) YaTeX-math-sign-width)))
   9.427  	  (case-fold-search nil)
   9.428 -	  (cols 0) (list YaTeX-math-key-alist) command)
   9.429 +	  (cols 0) (list alist) command)
   9.430        (erase-buffer)
   9.431 +      (insert 
   9.432 +       "Candidates of sign. [n:next p:prev f:forw b:back q:quit RET:select]\n")
   9.433        (insert YaTeX-math-indicator "\t")
   9.434        (insert YaTeX-math-indicator)
   9.435        (newline 1)
   9.436 @@ -265,7 +499,7 @@
   9.437  	    (progn (YaTeX-math-display-list (car list) cols)
   9.438  		   (setq cols (% (1+ cols) maxcols))))
   9.439  	(setq list (cdr list)))
   9.440 -      (goto-char (point-min))
   9.441 +      (goto-line 4)
   9.442        (use-local-map YaTeX-math-menu-map)
   9.443        (unwind-protect
   9.444  	  (recursive-edit)
   9.445 @@ -286,67 +520,85 @@
   9.446  erase it on the next keystroke.  The window is recentered if necessary
   9.447  to make the whole string visible.  If the window isn't large enough,
   9.448  at least you get to read the beginning."
   9.449 -  (let ((buffer-read-only nil)
   9.450 -	(modified (buffer-modified-p))
   9.451 -	(name buffer-file-name)
   9.452 -	insert-start
   9.453 -	insert-end)
   9.454 -    (unwind-protect
   9.455 -	(progn
   9.456 -	  (save-excursion
   9.457 -	    ;; defeat file locking... don't try this at home, kids!
   9.458 -	    (setq buffer-file-name nil)
   9.459 -	    (forward-line 1)
   9.460 -	    (setq insert-start (point))
   9.461 -	    (if (eobp) (newline))
   9.462 -	    (insert image)
   9.463 -	    (setq insert-end (point)))
   9.464 -	  ; make sure the whole string is visible
   9.465 -	  (if (not (pos-visible-in-window-p insert-end))
   9.466 -	      (recenter (max 0
   9.467 -			     (- (window-height)
   9.468 -				(count-lines insert-start insert-end)
   9.469 -				2))))
   9.470 -	  (let ((char (read-char)))
   9.471 -	    (or (eq char exit-char)
   9.472 -		(setq unread-command-char char))))
   9.473 -      (if insert-end
   9.474 -	  (save-excursion
   9.475 -	    (delete-region insert-start insert-end)))
   9.476 -      (setq buffer-file-name name)
   9.477 -      (set-buffer-modified-p modified))))
   9.478 +  (if (and image (not (string= image "")))
   9.479 +      (let ((buffer-read-only nil)
   9.480 +	    (modified (buffer-modified-p))
   9.481 +	    (name buffer-file-name)
   9.482 +	    insert-start
   9.483 +	    insert-end)
   9.484 +	(unwind-protect
   9.485 +	    (progn
   9.486 +	      (save-excursion
   9.487 +		;; defeat file locking... don't try this at home, kids!
   9.488 +		(setq buffer-file-name nil)
   9.489 +		(forward-line 1)
   9.490 +		(setq insert-start (point))
   9.491 +		(if (eobp) (newline))
   9.492 +		(insert image)
   9.493 +		(setq insert-end (point)))
   9.494 +					; make sure the whole string is visible
   9.495 +	      (if (not (pos-visible-in-window-p insert-end))
   9.496 +		  (recenter (max 0
   9.497 +				 (- (window-height)
   9.498 +				    (count-lines insert-start insert-end)
   9.499 +				    2))))
   9.500 +	      (let ((char (read-char)))
   9.501 +		(or (eq char exit-char)
   9.502 +		    (setq unread-command-char char))))
   9.503 +	  (if insert-end
   9.504 +	      (save-excursion
   9.505 +		(delete-region insert-start insert-end)))
   9.506 +	  (setq buffer-file-name name)
   9.507 +	  (set-buffer-modified-p modified)))))
   9.508  
   9.509  (defun YaTeX-math-insert-sequence ()
   9.510    (interactive)
   9.511 -  (let ((key "") regkey str  last-char list i
   9.512 -	(case-fold-search nil) match
   9.513 -	(n (length YaTeX-math-key-array)) (beg (point)) result)
   9.514 +  (let*((key "") regkey str  last-char list i
   9.515 +	(case-fold-search nil) match sign
   9.516 +	(this-key (char-to-string last-command-char))
   9.517 +	(alist (symbol-value (cdr (assoc this-key YaTeX-math-key-list))))
   9.518 +	(n (length alist)) (beg (point)) result)
   9.519      (setq result
   9.520  	  (catch 'complete
   9.521  	    (while t
   9.522 +	      (message "Sequence: %s" key)
   9.523  	      (setq last-char (read-char)
   9.524  		    key (concat key (char-to-string last-char))
   9.525 -		    regkey (concat "^" (regexp-quote key)) i 0)
   9.526 +		    i 0)
   9.527  	      (cond
   9.528 -	       ((string= key YaTeX-math-invoke-key)	;;invoke key itself
   9.529 +	       ((string= key this-key)	;;invoke key itself
   9.530  		(throw 'complete 'escape))
   9.531 +	       ((string= key YaTeX-math-exit-key)	;;exit from math-mode
   9.532 +		(throw 'complete 'exit))
   9.533  	       ((string-match "[\C-g\C-c]" key) (throw 'complete 'abort))
   9.534 -	       ((string-match "[\n\r]" key) (throw 'complete 'menu)))
   9.535 +	       ((string-match "[\n\r]" key) (throw 'complete 'menu))
   9.536 +	       ((string-match "[\C-h\C-?]" key)
   9.537 +		(if (string= key "") (throw 'complete 'abort))
   9.538 +		(setq key (substring key 0 -2))))
   9.539 +	      
   9.540 +	      (setq regkey (concat "^" (regexp-quote key)))
   9.541 +	      (message "Sequence: %s" key)
   9.542  	      (if
   9.543  		  (catch 'found
   9.544  		    ;;(1)input string strictly matches with alist
   9.545  		    (setq single-command (car (cdr match))
   9.546  			  ;;remember previous match
   9.547 -			  match (assoc key YaTeX-math-key-alist))
   9.548 +			  match (assoc key alist))
   9.549  		    ;;(2)search partial match into alist
   9.550 +		    (setq list alist)
   9.551  		    (while (< i n)
   9.552  		      (if (string-match
   9.553 -			   regkey (aref YaTeX-math-key-array i))
   9.554 +			   regkey
   9.555 +			   ;;(aref array i)
   9.556 +			   ;;(car (nth i alist))
   9.557 +			   (car (car list))
   9.558 +			   )
   9.559  			  (progn
   9.560  			    (or match
   9.561 -				(setq match (nth i YaTeX-math-key-alist)))
   9.562 +				;;(setq match (nth i alist))
   9.563 +				(setq match (car list)))
   9.564  			    (throw 'found t)))
   9.565 -		      (setq i (1+ i)))) 		;catch 'found
   9.566 +		      (setq i (1+ i) list (cdr list))))	;catch 'found
   9.567  		  nil ;;if any match, continue reading
   9.568  		;;else reading of sequence has been done.
   9.569  		(message "complete.")
   9.570 @@ -355,9 +607,9 @@
   9.571  	      (if match
   9.572  		  (progn (delete-region beg (point))
   9.573  			 (insert YaTeX-ec (car (cdr match)))
   9.574 -			 (if YaTeX-math-need-image
   9.575 -			     (YaTeX-math-show-image
   9.576 -			      (concat (YaTeX-math-get-sign match) "\n")))
   9.577 +			 (if (and YaTeX-math-need-image
   9.578 +				  (setq sign (YaTeX-math-get-sign match)))
   9.579 +			     (YaTeX-math-show-image (concat sign "\n")))
   9.580  			 )
   9.581  		nil)
   9.582  	      )))
   9.583 @@ -370,7 +622,7 @@
   9.584  	;;(recursive-edit)
   9.585  	(insert YaTeX-ec single-command)
   9.586  	)
   9.587 -      (sit-for 1)
   9.588 +      ;;;(sit-for 1)
   9.589        (setq unread-command-char last-char)
   9.590        (insert (YaTeX-addin single-command)))
   9.591       ((eq result 'abort)
   9.592 @@ -378,7 +630,10 @@
   9.593        (message "Abort."))
   9.594       ((eq result 'escape)
   9.595        (delete-region beg (point))
   9.596 -      (insert YaTeX-math-invoke-key))
   9.597 +      (insert this-key))
   9.598 +     ((eq result 'exit)
   9.599 +      (delete-region beg (point))
   9.600 +      (YaTeX-toggle-math-mode))
   9.601       ((eq result 'menu)
   9.602        (delete-region beg (point))
   9.603        (setq key (concat "^" (regexp-quote (substring key 0 -1))))
   9.604 @@ -386,3 +641,9 @@
   9.605  )
   9.606  ;;
   9.607  (provide 'yatexmth)
   9.608 +
   9.609 +; Local variables: 
   9.610 +; fill-prefix: ";;;	" 
   9.611 +; paragraph-start: "^$\\|\\|;;;$" 
   9.612 +; paragraph-separate: "^$\\|\\|;;;$" 
   9.613 +; End: 
    10.1 --- a/yatexprc.el	Mon Oct 25 14:35:00 1993 +0000
    10.2 +++ b/yatexprc.el	Sat Jan 29 07:59:59 1994 +0000
    10.3 @@ -1,8 +1,8 @@
    10.4  ;;; -*- Emacs-Lisp -*-
    10.5  ;;; YaTeX process handler.
    10.6 -;;; yatexprc.el rev.1.44
    10.7 -;;; (c)1993 by HIROSE Yuuji.[yuuji@ae.keio.ac.jp]
    10.8 -;;; Last modified Mon Oct 25 17:48:39 1993 on figaro
    10.9 +;;; yatexprc.el
   10.10 +;;; (c )1993 by HIROSE Yuuji.[yuuji@ae.keio.ac.jp]
   10.11 +;;; Last modified Sat Jan 29 16:54:54 1994 on gloria
   10.12  ;;; $Id$
   10.13  
   10.14  (require 'yatex)
   10.15 @@ -35,11 +35,11 @@
   10.16  	(YaTeX-kill-typeset-process YaTeX-typeset-process))
   10.17      (YaTeX-visit-main t);;execution directory
   10.18      ;;Select under-most window if there are more than 2 windows and
   10.19 -    ;;typeset buffer isn't seen.
   10.20 +    ;;typeset buffer not seen.
   10.21      (YaTeX-showup-buffer
   10.22       buffer (function (lambda (x) (nth 3 (window-edges x)))))
   10.23      (with-output-to-temp-buffer buffer
   10.24 -      (if (eq system-type 'ms-dos)	;if MS-DOS
   10.25 +      (if YaTeX-dos			;if MS-DOS
   10.26  	  (progn
   10.27  	    (message (concat "Typesetting " (buffer-name) "..."))
   10.28  	    (YaTeX-put-nonstopmode)
   10.29 @@ -63,7 +63,7 @@
   10.30  	       (set-kanji-process-code YaTeX-latex-message-code))))
   10.31      (message "Type SPC to continue.")
   10.32      (goto-char (point-max))
   10.33 -    (if (eq system-type 'ms-dos) (message "Done.")
   10.34 +    (if YaTeX-dos (message "Done.")
   10.35        (insert (message " "))
   10.36        (set-marker (process-mark YaTeX-typeset-process) (1- (point))))
   10.37      (if (bolp) (forward-line -1))
   10.38 @@ -95,7 +95,7 @@
   10.39                         (concat ": "
   10.40                                 (symbol-name (process-status proc))))
   10.41  		 (message "latex typesetting done.")
   10.42 -                 ;; If buffer and mode line will show that the process
   10.43 +                 ;; If buffer and mode line shows that the process
   10.44                   ;; is dead, we can delete it now.  Otherwise it
   10.45                   ;; will stay around until M-x list-processes.
   10.46                   (delete-process proc)
   10.47 @@ -173,7 +173,7 @@
   10.48    "Typeset whole buffer.  If %#! usage says other buffer is main text,
   10.49  visit main buffer to confirm if its includeonly list contains current
   10.50  buffer's file.  And if it doesn't contain editing text, ask user which
   10.51 -action want to be done, A:Add list, R:Replace list, %:comment-out list."
   10.52 +action wants to be done, A:Add list, R:Replace list, %:comment-out list."
   10.53    (interactive)
   10.54    (YaTeX-save-buffers)
   10.55    (let*((me (substring (buffer-name) 0 (rindex (buffer-name) ?.)))
   10.56 @@ -242,7 +242,7 @@
   10.57    "Kill process PROC after sending signal to PROC.
   10.58  PROC should be process identifier."
   10.59    (cond
   10.60 -   ((eq system-type 'ms-dos)
   10.61 +   (YaTeX-dos
   10.62      (error "MS-DOS can't have concurrent process."))
   10.63     ((or (null proc) (not (eq (process-status proc) 'run)))
   10.64      (error "No typesetting process."))
   10.65 @@ -254,16 +254,16 @@
   10.66    "Execute some command on buffer.  Not a official function."
   10.67    (save-excursion
   10.68      (with-output-to-temp-buffer buffer
   10.69 -      (if (eq system-type 'ms-dos)
   10.70 +      (if YaTeX-dos
   10.71  	  (call-process shell-file-name nil buffer nil "/c " command)
   10.72 -	(start-process "system" buffer shell-file-name "-c " command))))
   10.73 +	(start-process "system" buffer shell-file-name "-c" command))))
   10.74  )
   10.75  
   10.76  (defun YaTeX-preview (preview-command preview-file)
   10.77    "Execute xdvi (or other) to tex-preview."
   10.78    (interactive
   10.79     (list (read-string "Preview command: " dvi2-command)
   10.80 -	 (read-string "Prefiew file[.dvi]: "
   10.81 +	 (read-string "Preview file[.dvi]: "
   10.82  		      ;;(substring (buffer-name) 0 -4)
   10.83  		      (if (get 'dvi2-command 'region)
   10.84  			  (substring YaTeX-texput-file
   10.85 @@ -274,10 +274,11 @@
   10.86    (save-excursion
   10.87      (YaTeX-visit-main t)
   10.88      (with-output-to-temp-buffer "*dvi-preview*"
   10.89 -      (if (eq system-type 'ms-dos)
   10.90 -	  (progn (send-string-to-terminal "\e[2J")	;if MS-DOS
   10.91 +      (if YaTeX-dos			;if MS-DOS
   10.92 +	  (progn (send-string-to-terminal "\e[2J\e[>5h") ;CLS & hide cursor
   10.93  		 (call-process shell-file-name "con" "*dvi-preview*" nil
   10.94  			       "/c " dvi2-command preview-file)
   10.95 +		 (send-string-to-terminal "\e[>5l") ;show cursor
   10.96  		 (redraw-display))
   10.97  	(start-process "preview" "*dvi-preview*" shell-file-name "-c"
   10.98  		       (concat dvi2-command " " preview-file)) ;if UNIX
   10.99 @@ -287,7 +288,7 @@
  10.100  
  10.101  (defun YaTeX-prev-error ()
  10.102    "Visit previous error.  The reason why not NEXT-error is to
  10.103 -avoid make confliction of line numbers by editing."
  10.104 +avoid making confliction of line numbers by editing."
  10.105    (interactive)
  10.106    (let ((cur-buf (buffer-name)) (cur-win (selected-window))
  10.107  	YaTeX-error-line typeset-win error-buffer error-win)
  10.108 @@ -295,7 +296,7 @@
  10.109  	(message "There is no output buffer of typesetting.")
  10.110        (YaTeX-pop-to-buffer YaTeX-typeset-buffer)
  10.111        (setq typeset-win (selected-window))
  10.112 -      (if (eq system-type 'ms-dos)
  10.113 +      (if YaTeX-dos
  10.114  	  (if (search-backward latex-dos-emergency-message nil t)
  10.115  	      (progn (goto-char (point-max))
  10.116  		     (setq error-regexp latex-error-regexp))
  10.117 @@ -317,7 +318,7 @@
  10.118  			 (skip-chars-forward "^0-9")
  10.119  			 (point))
  10.120  		  (progn (skip-chars-forward "0-9") (point)))))
  10.121 -	(message "No more error on %s" cur-buf)
  10.122 +	(message "No more errors on %s" cur-buf)
  10.123  	(ding))
  10.124        (setq error-buffer (YaTeX-get-error-file cur-buf)); arg. is default buf.
  10.125        (setq error-win (get-buffer-window error-buffer))
  10.126 @@ -342,7 +343,7 @@
  10.127  )
  10.128  
  10.129  (defun YaTeX-jump-error-line ()
  10.130 -  "Jump corresponding line on latex command's error message."
  10.131 +  "Jump to corresponding line on latex command's error message."
  10.132    (interactive)
  10.133    (let ((p (point))
  10.134  	(end (progn (end-of-line) (point)))
  10.135 @@ -497,18 +498,6 @@
  10.136  	))))
  10.137  )
  10.138  
  10.139 -(defun YaTeX-replace-format (string format repl)
  10.140 -  "In STRING, replace first appearance of FORMAT to REPL as if
  10.141 -function `format' does.  FORMAT does not contain `%'"
  10.142 -  (let ((beg (or (string-match (concat "^\\(%" format "\\)") string)
  10.143 -		 (string-match (concat "[^%]\\(%" format "\\)") string)))
  10.144 -	(len (length format)))
  10.145 -    (if (null beg) string ;no conversion
  10.146 -      (concat
  10.147 -       (substring string 0 (match-beginning 1)) repl
  10.148 -       (substring string (match-end 1)))))
  10.149 -)
  10.150 -
  10.151  (defun YaTeX-lpr (arg)
  10.152    "Print out.  If prefix arg ARG is non nil, call print driver without
  10.153  page range description."
  10.154 @@ -542,7 +531,7 @@
  10.155      (save-excursion
  10.156        (YaTeX-visit-main t) ;;change execution directory
  10.157        (with-output-to-temp-buffer "*dvi-printing*"
  10.158 -	(if (eq system-type 'ms-dos)
  10.159 +	(if YaTeX-dos
  10.160  	    (call-process shell-file-name "con" "*dvi-printing*" nil
  10.161  			  "/c " cmd)
  10.162  	  (start-process "print" "*dvi-printing*" shell-file-name "-c" cmd)