yatex

changeset 52:5d94deabb9f9

Set YaTeX-indent-line to 'indent-line-function. Revise fill features.
author yuuji
date Sun, 22 Jan 1995 14:20:46 +0000
parents b0371b6ed799
children 5f4b18da14b3
files docs/yatex.ref docs/yatexadd.doc docs/yatexe.tex docs/yatexj.tex help/YATEXHLP.eng help/YATEXHLP.jp yatex.el yatex.new yatex19.el yatexadd.el yatexgen.el yatexhie.el yatexlib.el yatexmth.el yatexprc.el
diffstat 15 files changed, 798 insertions(+), 160 deletions(-) [+]
line diff
     1.1 --- a/docs/yatex.ref	Tue Dec 20 21:00:21 1994 +0000
     1.2 +++ b/docs/yatex.ref	Sun Jan 22 14:20:46 1995 +0000
     1.3 @@ -8,11 +8,12 @@
     1.4  
     1.5  	  野鳥では、prefix キーをカスタマイズできるため(標準ではC-c)これを
     1.6  	[prefix] と表記します。C-c のまま変更していない場合、[prefix] a は
     1.7 -	C-c a を表わします。begin型コマンドとは \begin〜\endの形式のコマ
     1.8 -	ンド、section型コマンドとは \section{題}のように引数を取るコマン
     1.9 -	ド、large型コマンドとは {\tt } のような中括弧で囲まれたフォント/
    1.10 -	サイズ指定子、maketitle型コマンドとは \maketitle のように引数を
    1.11 -	伴わないコマンドを指します。
    1.12 +	C-c a を表わします。
    1.13 +	  begin型コマンドとは \begin〜\endの形式のコマンド、section型コ
    1.14 +	マンドとは \section{題}のように引数を取るコマンド、large型コマン
    1.15 +	ドとは {\tt } のような中括弧で囲まれたフォント/サイズ指定子、
    1.16 +	maketitle型コマンドとは \maketitle のように引数を伴わないコマン
    1.17 +	ドを指します。
    1.18  
    1.19  
    1.20  【補完】
    1.21 @@ -30,25 +31,27 @@
    1.22  	◆section型補完(領域指定)	[prefix] S
    1.23  	◆随時補完			[prefix] SPC
    1.24  
    1.25 -	  即時begin型補完の、環境名の頭文字の対応については、yatex.doc を
    1.26 -	ご覧ください。領域指定モードでは、マークした位置とポイントの間を
    1.27 -	\begin{center}…\end{center} や {\large } などで括ります。
    1.28 +	  即時begin型補完の、環境名の頭文字の対応については、Info マニュ
    1.29 +	アルをご覧ください。領域指定モードでは、マークした位置とポイント
    1.30 +	の間を\begin{center}…\end{center} や {\large } などで括ります。
    1.31  
    1.32  	◆数式記号イメージ補完		;
    1.33 -	◆ギリシャ文字イメージ補完	/
    1.34 +	◆ギリシャ文字イメージ補完	:
    1.35  
    1.36  	  上の2つはTeXの数式環境の中で押した場合のみ有効です。強制的に補
    1.37 -	完機能を使う場合は、C-u を押してから ; / を押します。
    1.38 +	完機能を使う場合は、C-u を押してから ; や : を押します。
    1.39  
    1.40  
    1.41  【プロセス起動】
    1.42  
    1.43  	◆jbibtex起動			[prefix] tb
    1.44  	◆jlatex起動			[prefix] tj
    1.45 -	◆jlatex停止			[prefix] tk	※
    1.46 +	◆makeindex起動			[prefix] ti
    1.47 +	◆jlatexのkill			[prefix] tk	※
    1.48  	◆プリントアウト		[prefix] tl
    1.49  	◆プリントアウト(全ページ)	C-u [prefix] tl
    1.50  	◆プレビューア起動		[prefix] tp
    1.51 +	◆lpq起動			[prefix] tq
    1.52  	◆jlatex起動(領域指定)		[prefix] tr
    1.53  
    1.54  	  [prefix] t を押せばメニューが出るので、[prefix] t の次に押すキー
    1.55 @@ -70,6 +73,7 @@
    1.56  	もちろん jlatex でエラーが生じた場合のみ有効です。
    1.57  
    1.58  	◆対応するオブジェクトジャンプ	[prefix] g
    1.59 +	◆別ウィンドウで   〃		[prefix] 4g
    1.60  
    1.61  	  カーソルジャンプは、[prefix] g を押す時のカーソルの位置により、
    1.62  	ジャンプすべき場所を判断します。
    1.63 @@ -112,12 +116,17 @@
    1.64  【その他】
    1.65  	
    1.66  	◆itemの桁揃え			[prefix] i
    1.67 +
    1.68 +	  \item を使う環境中のみ有効です。
    1.69 +
    1.70  	◆LaTeXコマンド変更		[prefix] c
    1.71  
    1.72  	  \begin{}, \end{} の行で起動すると環境名を同時に変更します。
    1.73  	section型コマンドの上で起動するとコマンドを変更し、コマンドの引
    1.74  	数の位置で起動すると引数を変更します。large型コマンドの上で起動
    1.75 -	するとフォント/サイズ指定子を変更します。
    1.76 +	するとフォント/サイズ指定子を変更します。イメージ補完で入力した
    1.77 +	数式モードコマンドの上で起動すると確定直前のイメージ補完操作に戻
    1.78 +	ります。
    1.79  
    1.80  	◆コマンド削除			[prefix] k
    1.81  
    1.82 @@ -132,7 +141,7 @@
    1.83  
    1.84  	◆モード切り替え		[prefix] w
    1.85  
    1.86 -	  新規作成/更新モード、数式モードの切り替えメニューが出ます。
    1.87 +	  新規作成/修正モード、数式モードの切り替えメニューが出ます。
    1.88  
    1.89  	◆%# 記法の編集			[prefix] %
    1.90  	◆tabular/array桁位置表示	[prefix] &
     2.1 --- a/docs/yatexadd.doc	Tue Dec 20 21:00:21 1994 +0000
     2.2 +++ b/docs/yatexadd.doc	Sun Jan 22 14:20:46 1995 +0000
     2.3 @@ -135,9 +135,20 @@
     2.4  		字が htbp に限られているなら、(YaTeX:read-position "htbp")
     2.5  		と呼び出します。
     2.6  
     2.7 -	・関数	YaTeX:read-coordinates
     2.8 -	  引数	基本プロンプト, X座標プロンプト, Y座標プロンプト(全て省略可)
     2.9 -	  説明	「基本プロンプト X座標プロンプト:」というプロンプトを出し
    2.10 +	・関数	YaTeX-cplread-with-learning
    2.11 +	  引数	プロンプト
    2.12 +		デフォルト補完テーブル変数シンボル
    2.13 +		ユーザ補完テーブル変数シンボル
    2.14 +		ローカル補完テーブル変数シンボル
    2.15 +	  説明	「プロンプト」というプロンプトを出し、補完入力を行います。
    2.16 +		三つの変数のテーブルの値を結合したものが補完候補として用
    2.17 +		いられ、新しい単語を入力すると自動的に学習されます。学習
    2.18 +		結果は ~/.yatexrc か ./.yatexrc に保存されます。使用例と
    2.19 +		して YaTeX::documentstyle 関数の定義をごらんください。
    2.20 +
    2.21 +	・関数	YaTeX:check-comletion-type
    2.22 +	  引数	'begin または、'section または、'maketitle
    2.23 +	  説明	付加関数が呼ばれる時に、行われている補完の形式が、引数で与
    2.24  		て、X座標を読み込み、「基本プロンプト Y座標プロンプト:」を
    2.25  		出して、Y座標を読み込み、(X座標,Y座標) の様な形式を作成します。
    2.26  		何も入力せずリターンを押しても、(,)が返されます。
     3.1 --- a/docs/yatexe.tex	Tue Dec 20 21:00:21 1994 +0000
     3.2 +++ b/docs/yatexe.tex	Sun Jan 22 14:20:46 1995 +0000
     3.3 @@ -135,7 +135,7 @@
     3.4  @item Blanket commenting out or uncommenting
     3.5          (@kbd{C-c >}, @kbd{C-c <}, @kbd{C-c ,}, @kbd{C-c .})
     3.6  @item Easy input of accent mark, math-mode's commands and Greek letters
     3.7 -        (@kbd{C-c a}, @kbd{;}, @kbd{/})
     3.8 +        (@kbd{C-c a}, @kbd{;}, @kbd{:})
     3.9  @item Online help for the popular La@TeX{} commands
    3.10        (@kbd{C-c ?}, @kbd{C-c /})(English help is not yet supported)
    3.11  @end itemize
    3.12 @@ -792,7 +792,7 @@
    3.13  imitate the  corresponding symbols graphically.  This completion
    3.14  only works in the math environment.  YaTeX automatically detects
    3.15  whether the  cursor  located  in math environment  or  not,  and
    3.16 -change the behavior of key strokes @kbd{;} and @kbd{/}.
    3.17 +change the behavior of key strokes @kbd{;} and @kbd{:}.
    3.18  
    3.19    By the way, we often express the leftarrow mark by `<-' for example.
    3.20  Considering such image, you can write @code{\leftarrow} by typing @kbd{<-}
    3.21 @@ -842,19 +842,19 @@
    3.22  @comment  node-name,  next,  previous,  up
    3.23  @section Greek letters completion
    3.24  @cindex Greek letters completion
    3.25 -@cindex /
    3.26 +@cindex :
    3.27  
    3.28    Math-mode of YaTeX provides another image completion, Greek letters
    3.29 -completion in the same method.  After prefix @kbd{/}, typing @kbd{a} makes
    3.30 +completion in the same method.  After prefix @kbd{:}, typing @kbd{a} makes
    3.31  @code{\alpha}, @kbd{b} makes @code{\beta} and @kbd{g} makes @code{\gamma}
    3.32  and so on.  First, type @kbd{/TAB} to know all the correspondence of
    3.33  alphabets v.s. Greek letters.
    3.34  
    3.35 -  If you will find @kbd{;} or @kbd{/} doesn't work in correct position of
    3.36 +  If you will find @kbd{;} or @kbd{:} doesn't work in correct position of
    3.37  math environment, it may be a bug of YaTeX.  Please send me a bug report
    3.38  with the configuration of your text, and avoid it temporarily by typing
    3.39 -@kbd{;} or @kbd{/} after universal-argument(@kbd{C-u}) which forces
    3.40 -@kbd{;} and @kbd{/} to work as math-prefix.
    3.41 +@kbd{;} or @kbd{:} after universal-argument(@kbd{C-u}) which forces
    3.42 +@kbd{;} and @kbd{:} to work as math-prefix.
    3.43  
    3.44  @node Local dictionaries, Commenting out, Completion, Top
    3.45  @comment  node-name,  next,  previous,  up
    3.46 @@ -1065,6 +1065,8 @@
    3.47  @item Argument of section-type commands
    3.48  @item Optional parameters (enclosed by []) of section-type commands
    3.49  @item Font/size designators
    3.50 +@item Math-mode's maketitle-type commands that can be inputted with
    3.51 +image completion
    3.52  @end itemize
    3.53  
    3.54    Typing @kbd{[prefix] c} on one of above objects you want to change
    3.55 @@ -1157,11 +1159,11 @@
    3.56         >
    3.57         > \item bar
    3.58         >
    3.59 -       > When the word `for' is used as an arbitrarily word, `bar' 
    3.60 -       > is bound to follow it.
    3.61 +       >       When the word `for' is used as an arbitrarily word, `bar' 
    3.62 +       >       is bound to follow it.
    3.63  @end example
    3.64  
    3.65 -  Note that the indent depth of the @code{\item} and its descriptive
    3.66 +  Note that the indent depth of an @code{\item} word and its descriptive
    3.67  paragraph are the same in latter case.  If you want to use different
    3.68  depth, invoke fill-paragraph at the beginning of non-whitespace
    3.69  character(see below).
    3.70 @@ -2031,7 +2033,11 @@
    3.71  as a result  of using this  software.   However, any  reports  and
    3.72  suggestions are  welcome as  long as I   feel  interests in   this
    3.73  software.   My possible  e-mail address is  `yuuji@@ae.keio.ac.jp'.
    3.74 -(up to Mar.1995 at least)
    3.75 +(up to Mar.1995 at least)  And there is mailing list for YaTeX.
    3.76 +Although the common language is Japanese, questions in English will be
    3.77 +welcome.  To join the ML, send the mail whose subject is `append' to
    3.78 +the address `yatex-control@@harvest.jaist.ac.jp'.  If you have some
    3.79 +question, please ask to `yatex-request@@harvest.jaist.ac.jp'.
    3.80  
    3.81    The specification of this software will be surely modified
    3.82  (depending on my feelings) without notice :-p.
     4.1 --- a/docs/yatexj.tex	Tue Dec 20 21:00:21 1994 +0000
     4.2 +++ b/docs/yatexj.tex	Sun Jan 22 14:20:46 1995 +0000
     4.3 @@ -22,6 +22,7 @@
     4.4  
     4.5  @menu
     4.6  * Intro::                       はじめに
     4.7 +* Termnology::                  マニュアル参照上の注意
     4.8  * Main features::               主な機能
     4.9  * Installation::                インストール
    4.10  * Invocation::                  プロセス起動
    4.11 @@ -35,6 +36,7 @@
    4.12  * Includeonly::                 勝手に includeonly
    4.13  * What column::                 カラム位置ガイド
    4.14  * Intelligent newline::         おまかせ改行
    4.15 +* Changing mode of YaTeX::      野鳥動作モード変更
    4.16  * Online help::                 LaTeXオンラインヘルプ
    4.17  * Cooperation with other packages::  他パッケージとの連携
    4.18  * Customizations::              カスタマイズ
    4.19 @@ -94,7 +96,7 @@
    4.20  * Hook file::                   hook用ファイル
    4.21  @end menu
    4.22  
    4.23 -@node Intro, Main features, Top, Top
    4.24 +@node Intro, Termnology, Top, Top
    4.25  @comment  node-name,  next,  previous,  up
    4.26  @chapter はじめに
    4.27  @cindex Demacs
    4.28 @@ -110,7 +112,45 @@
    4.29  
    4.30    English manual @xref{Top, , , yatexe,YaTeX English info}
    4.31  
    4.32 -@node Main features, Installation, Intro, Top
    4.33 +@node Termnology, Main features, Intro, Top
    4.34 +@comment  node-name,  next,  previous,  up
    4.35 +@chapter 本マニュアル参照上の注意
    4.36 +
    4.37 +  本マニュアルでは以下の表記を用います。
    4.38 +
    4.39 +@itemize @bullet
    4.40 +@item
    4.41 +begin型コマンド
    4.42 +
    4.43 +@code{\begin@{環境@} 〜 \end@{環境@}}という形式のLaTeXコマンドを指します。
    4.44 +begin型コマンドを補完入力することをbegin型補完と呼びます。
    4.45 +
    4.46 +@item
    4.47 +section型コマンド
    4.48 +
    4.49 +@code{\section@{タイトル@}}や@code{\mbox@{内容@}}のように
    4.50 +引数を取るLaTeXコマンドを指します。
    4.51 +
    4.52 +@item
    4.53 +maketitle型コマンド
    4.54 +
    4.55 +@code{\maketitle}や@code{\tableofcontents}のように引数を取らないLaTeXコマ
    4.56 +ンドを指します。
    4.57 +
    4.58 +@item
    4.59 +large型コマンド
    4.60 +
    4.61 +@code{@{\large ...@}} や @code{@{\tt ...@}} のようなフォント/サイズ指定子
    4.62 +を指します。
    4.63 +
    4.64 +@item @kbd{[prefix]}
    4.65 +
    4.66 +野鳥の機能を呼び出すためのプリフィクスキー。デフォルトでは@kbd{C-c}に割り
    4.67 +当てられているので、特に変更していない場合本マニュアルの @kbd{[prefix]} と
    4.68 +いう表記は、@kbd{C-c} と読み換えてください。
    4.69 +@end itemize
    4.70 +
    4.71 +@node Main features, Installation, Termnology, Top
    4.72  @comment  node-name,  next,  previous,  up
    4.73  @chapter 主な機能
    4.74  
    4.75 @@ -135,7 +175,7 @@
    4.76  @item 一括コメントアウト/アンコメントアウト
    4.77          (@kbd{C-c >}, @kbd{C-c <}, @kbd{C-c ,}, @kbd{C-c .})
    4.78  @item アクセント記号/数式環境用コマンド/ギリシャ文字の入力支援
    4.79 -        (@kbd{C-c a}, @code{;}, @code{/})
    4.80 +        (@kbd{C-c a}, @kbd{;}, @kbd{/})
    4.81  @item tabular/array環境のカラム位置ガイド
    4.82  @item 標準的 La@TeX{} コマンドのオンラインヘルプ(@kbd{C-c ?}, @kbd{C-c /})
    4.83  @end itemize
    4.84 @@ -148,6 +188,7 @@
    4.85  @cindex .emacs
    4.86  @cindex auto-mode-alist
    4.87  @cindex autoload
    4.88 +@section 野鳥起動のための設定
    4.89  
    4.90    ~/.emacsに下の2項目を加えます。
    4.91  
    4.92 @@ -171,6 +212,32 @@
    4.93  ロードされます。野鳥が正常に起動できたときはモードラインの表示が「やてふ」
    4.94  に変わります。
    4.95  
    4.96 +@section タイプセッタ/プレヴューア環境の設定
    4.97 +
    4.98 +  利用する外部プログラムに関する以下の変数を確認し、必要なら正しい値に変更
    4.99 +します。
   4.100 +@table @code
   4.101 +@item tex-command
   4.102 +        @dots{} 起動するタイプセッタのコマンド名
   4.103 +@item dvi2-command
   4.104 +        @dots{} 起動するプレヴューアのコマンド名
   4.105 +@item NTT-jTeX
   4.106 +        @dots{} NTT jTeX を使用するなら t
   4.107 +@item YaTeX-kanji-code
   4.108 +        @dots{} 文書を作成する時の漢字コード
   4.109 +@item dviprint-command-format
   4.110 +        @dots{} ファイルの印刷に使われるコマンド列の書式
   4.111 +@item makeindex-command
   4.112 +        @dots{} makeindexコマンド
   4.113 +@end table
   4.114 +
   4.115 +これらを変更する場合は、やはり@file{~/.emacs}にて、たとえば
   4.116 +@lisp
   4.117 +(setq tex-command "bigjlatex")
   4.118 +@end lisp
   4.119 +のようにしてください。どのような値をセットすれば良いかについては、
   4.120 +@ref{All customizable variables}を参照してください。
   4.121 +
   4.122  
   4.123  @node Invocation, %#notation , Installation, Top
   4.124  @comment  node-name,  next,  previous,  up
   4.125 @@ -182,10 +249,8 @@
   4.126  @cindex jlatex
   4.127  @cindex プリントアウト[ふりんとあうと]
   4.128  
   4.129 - yatex-mode の prefix キーは、標準状態で @kbd{C-c} (Ctrlキーを押しながらc)
   4.130 -です。以下、標準のキー割当の場合、@kbd{[prefix]} は @kbd{C-c} と読み換えて
   4.131 -下さい。まず、次のキー入力により、jlatex などのタイプセットプログラム(以後
   4.132 -タイプセッタと呼ぶ)、プレヴューアなどの起動ができます。
   4.133 +LaTeXソースの編集中、次のキー入力により、jlatex などのタイプセットプログラ
   4.134 +ム(以後タイプセッタと呼ぶ)、プレヴューアなどの起動ができます。
   4.135  
   4.136  @table @kbd
   4.137  @item [prefix] t j
   4.138 @@ -236,30 +301,36 @@
   4.139  ラーの表示されている行にカーソルを合わせスペースキーを押すと La@TeX{} 
   4.140  ソースの対応する行にジャンプします。
   4.141  
   4.142 -  なお、領域指定のタイプセットでは、単一ファイルの La@TeX{} ソースの編集時
   4.143 -にはそのファイルの documentstyle が、別ファイルから include している場合に
   4.144 -はメインファイルの documentstyle が自動的に選択されます。指定領域は、メイ
   4.145 -ンファイルのあるディレクトリの@file{texput.tex}という臨時ファイルに出力さ
   4.146 -れますので、上書きには注意してください。領域の指定方法は@ref{%#記法}の項を
   4.147 -参照してください。
   4.148 +@subsection 領域タイプセット
   4.149 +
   4.150 +  ポイントとマークの間、あるいはテキスト中に埋め込んだ @code{%#BEGIN} と
   4.151 +@code{%#END}の間の領域(@ref{%#記法})だけを切り取ってタイプセットすることが
   4.152 +できます。この場合の documentstyle は、単一ファイルの La@TeX{} ソースの編
   4.153 +集時にはそのファイルの documentstyle が、別ファイルから include している場
   4.154 +合にはメインファイルの documentstyle が自動的に選択されます。指定領域は、
   4.155 +メインファイルのあるディレクトリの@file{texput.tex}という臨時ファイルに出
   4.156 +力されますので、上書きには注意してください。
   4.157  
   4.158  @node Print out,  , Calling typesetter, Invocation
   4.159  @comment  node-name,  next,  previous,  up
   4.160  @section プリントアウト
   4.161  
   4.162 -  プリントアウトする時は、出力開始/終了ページを聞いてきますが、こ
   4.163 -れを省略したい時は、universal-argument をつけて下さい。
   4.164 +  @kbd{[prefix] t l}を押してプリントアウトを指示すると、出力開始/終了ペー
   4.165 +ジを聞いてくるので、それぞれに答えます。これを省略したい時は、
   4.166 +universal-argument をつけ、
   4.167  
   4.168  @cindex 出力開始ページ[しゆつりよくかいしへえし]
   4.169  @cindex 出力終了ページ[しゆつりよくしゆうりようへえし]
   4.170  
   4.171 -
   4.172  @table @kbd
   4.173  @item C-u [prefix] t l
   4.174          @dots{} ページ確認省略lpr起動
   4.175  @end table
   4.176  @cindex ページ確認省略lpr起動[へえしかくにんしようりやくlprきとう]
   4.177  
   4.178 +@noindent
   4.179 +のように起動してください。
   4.180 +
   4.181  @node %#notation , Completion, Invocation, Top
   4.182  @comment  node-name,  next,  previous,  up
   4.183  @chapter %#記法
   4.184 @@ -817,7 +888,7 @@
   4.185  @end table
   4.186  
   4.187  @noindent 
   4.188 -        とすることで、現在開いている環境名で \end{} が補われます。
   4.189 +とすることで、現在開いている環境名で \end{} が補われます。
   4.190  
   4.191  @node Accent mark completion, Image completion, end補完, Completion
   4.192  @comment  node-name,  next,  previous,  up
   4.193 @@ -873,7 +944,7 @@
   4.194    主に数式モードで使用される、矢印やΣなどの記号を擬似的に表現するキー入力
   4.195  で、La@TeX{} コマンドを入力できます。これは野鳥自身の「数式モード」でのみ
   4.196  動作します。野鳥はカーソルが@TeX{}の数式環境の中にある時に@kbd{;}や、
   4.197 -@kbd{/}に特殊な機能を持たせます。
   4.198 +@kbd{:}に特殊な機能を持たせます。
   4.199  
   4.200    さて、例えば、←(leftarrow)をASCII文字だけで表現する場合、一般的には「<-」
   4.201  のようにしますが、これを利用して、数式記号イメージ入力モードで 
   4.202 @@ -936,16 +1007,16 @@
   4.203  @comment  node-name,  next,  previous,  up
   4.204  @section ギリシャ文字補完
   4.205  @cindex ギリシャ文字補完[きりしやもしほかん]
   4.206 -@cindex /
   4.207 +@cindex :
   4.208  
   4.209 -  もう一つ、数式環境中で@kbd{/}を押すとギリシャ文字入力モードに入ります。
   4.210 -@kbd{/}を押した直後に@kbd{a}を押すと@code{\alpha}が、@kbd{g} を押すと 
   4.211 +  もう一つ、数式環境中で@kbd{:}を押すとギリシャ文字入力モードに入ります。
   4.212 +@kbd{:}を押した直後に@kbd{a}を押すと@code{\alpha}が、@kbd{g} を押すと 
   4.213  @code{\gamma}が、などアルファベットに対応したギリシャ文字が挿入されます。
   4.214 -操作方法は;の数式記号補完とまったく同じです。まずは@kbd{/}の直後に
   4.215 +操作方法は;の数式記号補完とまったく同じです。まずは@kbd{:}の直後に
   4.216  TABを押してどのアルファベットにどのギリシャ文字が対応しているか調べてみて
   4.217  ください。
   4.218  
   4.219 -  @kbd{;}と@kbd{/}を数式環境中で押しているにもかかわらず、イメージ補完が働
   4.220 +  @kbd{;}と@kbd{:}を数式環境中で押しているにもかかわらず、イメージ補完が働
   4.221  かない場合は、@kbd{C-u ;}のように universal-argument をつけてキーを押すこ
   4.222  とにより、強制的にイメージ補完に入ることができます。また、この時にどのよう
   4.223  な状態で数式環境内判定に失敗したかをご連絡下さい。
   4.224 @@ -985,11 +1056,6 @@
   4.225  @noindent 
   4.226  として下さい。
   4.227  
   4.228 -@cindex 変な単語[へんなたんこ]
   4.229 -  もし、綴の間違ったものなど、変な単語が学習されてしまった場合は
   4.230 -
   4.231 -
   4.232 -
   4.233  @node Commenting out, Cursor jump, Local dictionary, Top
   4.234  @comment  node-name,  next,  previous,  up
   4.235  @chapter コメントアウト
   4.236 @@ -1182,6 +1248,7 @@
   4.237  @item section型コマンドの引数
   4.238  @item section型コマンドのオプションパラメータ([]で囲まれたもの)
   4.239  @item large型コマンド
   4.240 +@item (イメージ補完で入力可能な)数式モード専用のmaketitle型コマンド
   4.241  @end itemize
   4.242  
   4.243    変えたいsection型コマンドの引数がさらに La@TeX{} コマンドを含む場合は、
   4.244 @@ -1275,13 +1342,13 @@
   4.245  通常インデント:
   4.246         > \item へろへろ
   4.247         >
   4.248 -       > 「ほげほげ」をでたらめが単語として使った時に、第2のでたらめな
   4.249 -       > 単語として「へろへろ」が使われることが多いようです。
   4.250 +       >       「ほげほげ」をでたらめが単語として使った時に、第2のでたら
   4.251 +       >       めな単語として「へろへろ」が使われることが多いようです。
   4.252  @end example
   4.253  
   4.254 -  上の通常インデントの場合、説明パラグラフのインデントは \item と同じ深さ
   4.255 -とする必要があります。ただし、@kbd{M-q}を行の最初の非空白文字の位置で押す
   4.256 -ことにより深さを変えることができます(後述)。
   4.257 +  上の通常インデントの場合、説明パラグラフのインデントは \item の見出しと
   4.258 +同じ深さとする必要があります。ただし、@kbd{M-q}を行の最初の非空白文字の位
   4.259 +置で押すことにより深さを変えることができます(後述)。
   4.260  
   4.261  @section パラグラフの桁揃え
   4.262  @cindex パラグラフの桁揃え[はらくらふのけたそろえ]
   4.263 @@ -1367,7 +1434,7 @@
   4.264  す。もし項目名として別のものを表示して欲しい場合は、行頭を@code{%}にしてダ
   4.265  ミーの項目並びを作っておくと良いでしょう。
   4.266  
   4.267 -@node Intelligent newline, Online help, What column, Top
   4.268 +@node Intelligent newline, Changing mode of YaTeX, What column, Top
   4.269  @comment  node-name,  next,  previous,  up
   4.270  @chapter おまかせ改行
   4.271  @cindex おまかせ改行[おまかせかいぎょう]
   4.272 @@ -1412,7 +1479,37 @@
   4.273  いでしょう。関数 @code{YaTeX-intelligent-newline-itemize} の定義などを参考
   4.274  にしてください。
   4.275  
   4.276 -@node Online help, Cooperation with other packages, Intelligent newline, Top
   4.277 +@node Changing mode of YaTeX, Online help, Intelligent newline, Top
   4.278 +@comment  node-name,  next,  previous,  up
   4.279 +@chapter 野鳥の動作モード切り替え
   4.280 +@cindex モード切り替え[もーときりかえ]
   4.281 +@cindex prefix w
   4.282 +
   4.283 +@table @kbd
   4.284 +@item [prefix] w
   4.285 +        @dots{} 野鳥動作モード切り替えメニュー
   4.286 +@end table
   4.287 +
   4.288 +@noindent
   4.289 +で野鳥自身の動作を決定する以下のモードを切り替えます。
   4.290 +
   4.291 +@itemize @bullet
   4.292 +@item 修正モード
   4.293 +@item 野鳥数式モード
   4.294 +@end itemize
   4.295 +
   4.296 +修正モードは、開き括弧入力時の処理をコントロールし、修正モードONの時は開き
   4.297 +括弧の入力は開き括弧のみの入力になり、修正モードOFFの時は開き括弧の入力だ
   4.298 +けで閉じ括弧まで入力します。デフォルト(起動時)の設定は@emph{OFF}です。
   4.299 +
   4.300 +  野鳥数式モードは、変数 @code{YaTeX-auto-math-mode} が @code{nil} の時の
   4.301 +み有効で、このとき@kbd{;}や@kbd{:}を押した時(@ref{Image completion}参照)に、
   4.302 +どのようなイメージ補完を機能させるか、通常のキーとして機能させるかを手動で
   4.303 +切り替えます。自動判定が遅いマシンでは@code{YaTeX-auto-math-mode}
   4.304 +@code{nil}にセットし、野鳥数式モードを手動で切り替えると良いでしょう。
   4.305 +
   4.306 +
   4.307 +@node Online help, Cooperation with other packages, Changing mode of YaTeX, Top
   4.308  @comment  node-name,  next,  previous,  up
   4.309  @chapter オンラインヘルプ
   4.310  @cindex オンラインヘルプ[おんらいんへるふ]
   4.311 @@ -1581,6 +1678,10 @@
   4.312  (@code{"-t %e"})
   4.313  @end defvar
   4.314  
   4.315 +@defvar makeindex-command
   4.316 +makeindexコマンド(@code{"makeindex"} (MS-DOSでは@code{"makeind"}))
   4.317 +@end defvar
   4.318 +
   4.319  @defvar section-name
   4.320  最初のsection型補完の規定値(@code{"documentstyle"})
   4.321  @end defvar
   4.322 @@ -1777,6 +1878,9 @@
   4.323    苦情、希望、バグ報告、感想等は歓迎いたします。
   4.324  連絡は yuuji@@ae.keio.ac.jp または、
   4.325  pcs39334@@asciinet.or.jp まで(1995年3月現在)。
   4.326 +継続的に使用してくださる方はメイリングリスト「fj野鳥の会」に
   4.327 +是非加入してください。加入方法については本パッケージの @file{docs/qanda}
   4.328 +ファイルの「その他」の章を御覧ください。
   4.329  
   4.330  仕様は、予告なく確実に(気分次第で)変更されます:-p。
   4.331  
     5.1 --- a/help/YATEXHLP.eng	Tue Dec 20 21:00:21 1994 +0000
     5.2 +++ b/help/YATEXHLP.eng	Sun Jan 22 14:20:46 1995 +0000
     5.3 @@ -775,9 +775,10 @@
     5.4  \pushtabs それまで用いていたタブストップ位置を全てpush
     5.5  \poptabs  それまで用いていたタブストップ位置を全てpop. \pushtabs と 
     5.6  	\poptabs は必ず対になっていなければならない. 入れ子可
     5.7 -\aX	Xは = か ' か `   tabbing環境でない通常のアクセントは
     5.8 +\aX	
     5.9 +Xは = か ' か `   tabbing環境でない通常のアクセントは
    5.10  	\a= \a' \a` で表わす
    5.11 -\kill	現在行のテキストは出力せずタブ設定だけ解釈する
    5.12 +\kill	Without outputting text, parse tabbing definition.
    5.13  
    5.14  array
    5.15  \begin{array}{PREAMBLE} C1 & C2 & .. & Cn \\ D1 ... \end{array}
    5.16 @@ -856,7 +857,7 @@
    5.17  allow this.
    5.18  
    5.19  tabular*
    5.20 -\begin{tabular*}{幅}{プリアンブル} ... \end{tabular*}
    5.21 +\begin{tabular*}{WIDTH}{PREAMBLE} ... \end{tabular*}
    5.22  Make tabular environment with specifying its width.
    5.23  To fill this width, use \extracolsep{} of preamble as below:
    5.24  \begin{tabular*}{10em}[b]{|c@{\extracolsep{\fill}}|c|c|}
     6.1 --- a/help/YATEXHLP.jp	Tue Dec 20 21:00:21 1994 +0000
     6.2 +++ b/help/YATEXHLP.jp	Sun Jan 22 14:20:46 1995 +0000
     6.3 @@ -528,11 +528,13 @@
     6.4  
     6.5  raggedright
     6.6  \raggedright
     6.7 -段落を右寄せして組版する。
     6.8 +段落の右端を不揃いにして組版。
     6.9 +結果として左寄せになる。
    6.10  
    6.11  raggedleft
    6.12  \raggedleft
    6.13 -段落を左寄せして組版する。
    6.14 +段落の左端を不揃いにして組版。
    6.15 +結果として右寄せになる。
    6.16  
    6.17  raggedbottom
    6.18  \raggedbottom
    6.19 @@ -1205,6 +1207,7 @@
    6.20  「雷鳥」の旧仮名遣いは「らいてう」だそうです。
    6.21  
    6.22  laitex
    6.23 +a Little Assistant Interface for TeX
    6.24  <refer LaiTeX>
    6.25  
    6.26  YaTeX
    6.27 @@ -1244,16 +1247,21 @@
    6.28  
    6.29  桂川直己さん(筑波大)
    6.30  	数え切れないバグレポートと要望を頂きました。またVzへの移植版であ
    6.31 -	る laitex(雷鳥) を作成されました。
    6.32 +	る laitex(雷鳥) を作成されました。また、「こんな機能はどうだろう?」
    6.33 +	と相談すると、「いらん」と一蹴し、しばらく経ってから「やっぱり欲
    6.34 +	しい」と言うなど、多くの混乱を招かせていただきました。
    6.35  
    6.36 -三平善郎さん(慶応大)
    6.37 +るねきちさん(asciinet)
    6.38 +	占い師だそうです。
    6.39 +
    6.40 +三平善郎さん(慶應大)
    6.41  	開き括弧の入力時の処理のモード分けのアイデアを頂きました。
    6.42  
    6.43 -萩庭崇さん(慶応大)
    6.44 +萩庭崇さん(慶應大)
    6.45  	begin型補完の内側に文字があった場合それらをインデントしてほしい
    6.46  	という要望を頂きました。
    6.47  
    6.48 -田中健次郎さん(慶応大)
    6.49 +田中健次郎さん(慶應大)
    6.50  	タイプセット時に未セーブ状態の関連ファイルをセーブして欲しいとい
    6.51  	う要望を頂きました。
    6.52  
    6.53 @@ -1275,17 +1283,36 @@
    6.54  	パラグラフ境界をLaTeX用に設定しなおす要望などを頂きました。
    6.55  
    6.56  TUSKさん(asciinet)
    6.57 -	Texinfoドキュメント(初版)を作成して頂きました。
    6.58 +	Texinfoドキュメント(初版)を作成して頂き、第二版に関するコメント
    6.59 +	と添削をして頂きました。
    6.60  
    6.61  横田和也さん(asciinet)
    6.62  	dviout起動時の工夫の案、ミニバッファで読み込むもののヒストリを分
    6.63 -	けるアイデアのきっかけをいただき、ヘルプファイルの項目の提供をし
    6.64 -	て頂きました。
    6.65 +	けるアイデアのきっかけを頂き、ヘルプファイルの項目の提供をして頂
    6.66 +	きました。
    6.67  
    6.68 -kanbai-anさん(asciinet)
    6.69 -	日本語入力モード判定関数のバグを直すパッチなどを頂きました。
    6.70 +Nop.Mさん(asciinet)
    6.71 +	異なる環境での設定の不具合等のレポートを数多く頂きました。
    6.72  
    6.73 +内山滋さん(成蹊大学)
    6.74 +	日本語入力モード判定関数のバグを直すパッチ、section-view のバグ
    6.75 +	報告、* 付きセクションコマンド対応の要望、\right, \left のアドイ
    6.76 +	ン関数作成に関する有用な情報などを頂きました。
    6.77 +
    6.78 +神貞介さん(niftyserve)
    6.79 +	dviout起動オプションに関するコメント、ヘルプファイルのバグ報告等
    6.80 +	を頂きました。
    6.81 +
    6.82 +藤枝和宏さん(JAIST)
    6.83 +	野鳥/雷鳥の Mailing List を設立して頂きました。
    6.84 +
    6.85 +松本憲彦さん(東京学芸大学)
    6.86 +	マニュアルのバグを指摘して頂きました。
    6.87 +
    6.88 +小宮山康子さん(成蹊大学)
    6.89 +	\item[] などの補完後 [] の中にカーソルを置く要望を頂きました。
    6.90  
    6.91  yatex
    6.92 +(setq auto-mode-alist (cons '("\\.tex$" . yatex-mode) auto-mode-alist))
    6.93  <refer YaTeX>
    6.94  
     7.1 Binary file yatex.el has changed
     8.1 --- a/yatex.new	Tue Dec 20 21:00:21 1994 +0000
     8.2 +++ b/yatex.new	Sun Jan 22 14:20:46 1995 +0000
     8.3 @@ -1,6 +1,13 @@
     8.4  	What's new in YaTeX
     8.5  	yatex.el 各バージョンの変更点について
     8.6  
     8.7 +1.56	[prefix] d の YaTeX-display-hierarchy を追加。
     8.8 +	変数 indent-line-function に YaTeX-indent-line を設定した。
     8.9 +	YaTeX-generate-simple の修正(1.51から今まで全然動かなかったのに…)。
    8.10 +	NTT-jTeX を利用する時に文書をインデントしても良いように 
    8.11 +	auto-fill や fill-paragraph を調整した。
    8.12 +	maketitle 型コマンドが [] で終わっている時にはカーソルを括弧内に。
    8.13 +
    8.14  1.55	{}の上で [prefix] k した時に直前のコマンドが maketitle 型辞書に
    8.15  	属していれば {} のみ(フォント指定子があればそれも)を消すようにした。
    8.16  	新単語入力時に、N)one を選ぶと、そのEmacsでのみ有効にするように
     9.1 --- a/yatex19.el	Tue Dec 20 21:00:21 1994 +0000
     9.2 +++ b/yatex19.el	Sun Jan 22 14:20:46 1995 +0000
     9.3 @@ -1,7 +1,7 @@
     9.4  ;;; -*- Emacs-Lisp -*-
     9.5  ;;; YaTeX facilities for Emacs 19
     9.6 -;;; (c )1994 by HIROSE Yuuji.[yuuji@ae.keio.ac.jp]
     9.7 -;;; Last modified Mon Dec 19 02:55:36 1994 on VFR
     9.8 +;;; (c )1994-1995 by HIROSE Yuuji.[yuuji@ae.keio.ac.jp]
     9.9 +;;; Last modified Sun Jan 22 23:15:56 1995 on landcruiser
    9.10  ;;; $Id$
    9.11  
    9.12  ;;; とりあえず hilit19 を使っている時に色が付くようにして
    9.13 @@ -92,6 +92,11 @@
    9.14   YaTeX-mode-map [menu-bar yatex]
    9.15   '(what "What column in tabular" YaTeX-what-column))
    9.16  
    9.17 +;; Document hierarchy  ------------------------------------------------------
    9.18 +(YaTeX-19-define-sub-menu
    9.19 + YaTeX-mode-map [menu-bar yatex]
    9.20 + '(hier "Display document hierarchy" YaTeX-display-hierarchy-directly))
    9.21 +
    9.22  ;; Jump cursor ---------------------------------------------------------------
    9.23  (define-key YaTeX-mode-map [menu-bar yatex jump]
    9.24    (cons "Jump cursor"
    9.25 @@ -214,9 +219,9 @@
    9.26     '("\\\\\\(re\\)?new\\(environment\\|command\\){" "}" define)
    9.27     '("\\\\new\\(length\\|theorem\\|counter\\){" "}" define)
    9.28     ;;セクションコマンドが単なるキーワードってことはないでしょう。
    9.29 -   (list
    9.30 -    (concat "\\\\\\(" YaTeX-sectioning-regexp "\\){") "}"
    9.31 -    'sectioning)
    9.32 +   ;;(list
    9.33 +    ;;(concat "\\\\\\(" YaTeX-sectioning-regexp "\\){") "}"
    9.34 +    ;;'sectioning)
    9.35     ;;eqnarray などの数式環境が入ってないみたい…
    9.36     '("\\\\begin{\\(eqnarray\\*?\\|equation\\*?\\)}"
    9.37       "\\\\end{\\(eqnarray\\*?\\|equation\\*?\\)}"
    9.38 @@ -227,9 +232,54 @@
    9.39  (defvar YaTeX-hilit-sectioning-face
    9.40    '(yellow/dodgerblue yellow/cornflowerblue)
    9.41    "*Hilightening face for sectioning unit.  '(FaceForLight FaceForDark)")
    9.42 +(defvar YaTeX-sectioning-patterns-alist nil
    9.43 +  "Hilightening patterns for sectioning units.")
    9.44  (defvar YaTeX-hilit-singlecmd-face
    9.45    '(slateblue2 aquamarine)
    9.46    "*Hilightening face for maketitle type.  '(FaceForLight FaceForDark)")
    9.47 +
    9.48 +;;; セクションコマンドを、構造レベルの高さに応じて色の濃度を変える
    9.49 +;;; 背景が黒でないと何が嬉しいのか分からないに違いない.
    9.50 +(let*((sectface
    9.51 +       (car (if (eq hilit-background-mode 'dark) 
    9.52 +		(cdr YaTeX-hilit-sectioning-face)
    9.53 +	      YaTeX-hilit-sectioning-face)))
    9.54 +      (sectcol (symbol-name sectface))
    9.55 +      sect-pat-alist)
    9.56 +  (if (string-match "/" sectcol)
    9.57 +      (let (colorvalue fR fG fB bR bG bB list pat fg bg level from face)
    9.58 +	(require 'yatexsec)
    9.59 +	(setq fg (substring sectcol 0 (string-match "/" sectcol))
    9.60 +	      bg (substring sectcol (1+ (string-match "/" sectcol)))
    9.61 +	      colorvalue (x-color-values fg)
    9.62 +	      fR (/ (nth 0 colorvalue) 256)
    9.63 +	      fG (/ (nth 1 colorvalue) 256)
    9.64 +	      fB (/ (nth 2 colorvalue) 256)
    9.65 +	      colorvalue (x-color-values bg)
    9.66 +	      bR (/ (nth 0 colorvalue) 256)
    9.67 +	      bG (/ (nth 1 colorvalue) 256)
    9.68 +	      bB (/ (nth 2 colorvalue) 256)
    9.69 +	      list YaTeX-sectioning-level)
    9.70 +	(while list
    9.71 +	  (setq pat (concat YaTeX-ec-regexp (car (car list)) "\\*?{")
    9.72 +		level (cdr (car list))
    9.73 +		fg (format "hex-%02x%02x%02x"
    9.74 +			   (- fR (/ (* level fR) 40))	;40 musn't be constant
    9.75 +			   (- fG (/ (* level fG) 40))
    9.76 +			   (- fB (/ (* level fB) 40)))
    9.77 +		bg (format "hex-%02x%02x%02x"
    9.78 +			   (- bR (/ (* level bR) 15))	;20 musn't be constant
    9.79 +			   (- bG (/ (* level bG) 15))
    9.80 +			   (- bB (/ (* level bB) 15)))
    9.81 +		from (intern (format "sectioning-%d" level))
    9.82 +		face (intern (concat fg "/" bg)))
    9.83 +	  (hilit-translate from face)
    9.84 +	  (setq sect-pat-alist
    9.85 +		(cons (list pat "}" face)
    9.86 +		      sect-pat-alist))
    9.87 +	  (setq list (cdr list)))
    9.88 +	(setq YaTeX-sectioning-patterns-alist sect-pat-alist))))
    9.89 +
    9.90  (defun YaTeX-19-collect-macro ()
    9.91    (cond
    9.92     ((and (featurep 'hilit19) (fboundp 'hilit-translate))
    9.93 @@ -246,7 +296,7 @@
    9.94  	       ((eq hilit-background-mode 'dark) (car (cdr table)))
    9.95  	       (t nil))))))
    9.96        (hilit-translate
    9.97 -       sectioning (funcall get-face YaTeX-hilit-sectioning-face)
    9.98 +       ;;sectioning (funcall get-face YaTeX-hilit-sectioning-face)
    9.99         macro (funcall get-face YaTeX-hilit-singlecmd-face)))
   9.100      (setq hilit-patterns-alist		;Remove at first.
   9.101  	  (delq 'yatex-mode hilit-patterns-alist)
   9.102 @@ -254,6 +304,7 @@
   9.103  	  (cons
   9.104  	   (cons 'yatex-mode
   9.105  		 (append
   9.106 +		  YaTeX-sectioning-patterns-alist
   9.107  		  YaTeX-hilit-pattern-adjustment-private
   9.108  		  YaTeX-hilit-pattern-adjustment-default
   9.109  		  YaTeX-hilit-patterns-alist
    10.1 --- a/yatexadd.el	Tue Dec 20 21:00:21 1994 +0000
    10.2 +++ b/yatexadd.el	Sun Jan 22 14:20:46 1995 +0000
    10.3 @@ -1,8 +1,8 @@
    10.4  ;;; -*- Emacs-Lisp -*-
    10.5  ;;; YaTeX add-in functions.
    10.6 -;;; yatexadd.el rev.11
    10.7 -;;; (c )1991-1994 by HIROSE Yuuji.[yuuji@ae.keio.ac.jp]
    10.8 -;;; Last modified Mon Dec 19 03:07:01 1994 on landcruiser
    10.9 +;;; yatexadd.el rev.12
   10.10 +;;; (c )1991-1995 by HIROSE Yuuji.[yuuji@ae.keio.ac.jp]
   10.11 +;;; Last modified Sun Jan 22 23:15:48 1995 on landcruiser
   10.12  ;;; $Id$
   10.13  
   10.14  ;;;
   10.15 @@ -286,6 +286,11 @@
   10.16        (concat "[" label "]")))
   10.17  )
   10.18  
   10.19 +(defun YaTeX:item () " ")
   10.20 +(fset 'YaTeX:item\[\] 'YaTeX:item)
   10.21 +(fset 'YaTeX:subitem 'YaTeX:item)
   10.22 +(fset 'YaTeX:subsubitem 'YaTeX:item)
   10.23 +
   10.24  ;;;
   10.25  ;;Subroutine
   10.26  ;;;
    11.1 --- a/yatexgen.el	Tue Dec 20 21:00:21 1994 +0000
    11.2 +++ b/yatexgen.el	Sun Jan 22 14:20:46 1995 +0000
    11.3 @@ -1,8 +1,8 @@
    11.4  ;;; -*- Emacs-Lisp -*-
    11.5  ;;; YaTeX add-in function generator.
    11.6 -;;; yatexgen.el rev.4
    11.7 -;;; (c )1991-1994 by HIROSE Yuuji.[yuuji@ae.keio.ac.jp]
    11.8 -;;; Last modified Sun Dec 11 05:38:35 1994 on VFR
    11.9 +;;; yatexgen.el rev.5
   11.10 +;;; (c )1991-1995 by HIROSE Yuuji.[yuuji@ae.keio.ac.jp]
   11.11 +;;; Last modified Sun Jan 22 23:15:34 1995 on landcruiser
   11.12  ;;; $Id$
   11.13  
   11.14  (require 'yatex)
   11.15 @@ -142,6 +142,11 @@
   11.16  (defvar YaTeX-generate-message-height
   11.17    10 "Window height of YaTeX-generate-message-buffer")
   11.18  
   11.19 +;; Do you need learning for generated function?
   11.20 +;; If you need, please tell me (yuuji@ae.keio.ac.jp)
   11.21 +;;(defvar YaTeX-generate-variables-for-learning nil)
   11.22 +;;(defvar YaTeX-generate-current-completion-table nil)
   11.23 +
   11.24  ;;;
   11.25  ;Generate mode.
   11.26  ;;;
   11.27 @@ -437,7 +442,7 @@
   11.28  	(insert cand "\n"))
   11.29        (kill-buffer buf)))
   11.30      ;;(set-buffer cb)
   11.31 -    (concat cands ")"))
   11.32 +    (setq YaTeX-generate-current-completion-table (concat cands ")")))
   11.33  )
   11.34  (defun YaTeX-generate-corresponding-paren (left)
   11.35    (cond
   11.36 @@ -457,19 +462,27 @@
   11.37     ")\n")
   11.38  )
   11.39  (defun YaTeX-generate-create-completing-read (&optional nth)
   11.40 -  (concat
   11.41 -   "(completing-read \""
   11.42 -   (read-string (if nth (format "Prompt for argument#%d: " nth) "Prompt: "))
   11.43 -   ": \"\n"
   11.44 -   (format "'%s\n" (YaTeX-generate-read-completion-table))
   11.45 -   "nil "
   11.46 -   (format "%s)" (y-or-n-p "Require match? ")))
   11.47 +  (prog1
   11.48 +      (concat
   11.49 +       "(completing-read \""
   11.50 +       (read-string
   11.51 +	(if nth (format "Prompt for argument#%d: " nth) "Prompt: "))
   11.52 +       ": \"\n"
   11.53 +       (format "'%s\n" (YaTeX-generate-read-completion-table))
   11.54 +       "nil "
   11.55 +       (format "%s)" (y-or-n-p "Require match? ")))
   11.56 +    (if nil ;;;(y-or-n-p "Do you need learning for this completion?")
   11.57 +	(setq YaTeX-generate-variables-for-learning
   11.58 +	      (cons
   11.59 +	       (cons (format "YaTeX-%s-%d" command (or nth 0))
   11.60 +		     YaTeX-generate-current-completion-table)
   11.61 +	       YaTeX-generate-variables-for-learning))))
   11.62  )
   11.63  (defun YaTeX-generate-create-read-file-name (&optional nth)
   11.64    (concat
   11.65     "(read-file-name \""
   11.66     (read-string (if nth (format "Prompt for argument#%d: " nth) "Prompt: "))
   11.67 -   ": \" "" nil t \"\")\n")
   11.68 +   ": \" "" \"\" t \"\")\n")
   11.69  )
   11.70  (defun YaTeX-generate-create-read-oneof (&optional nth readpos)
   11.71    (concat
   11.72 @@ -491,24 +504,23 @@
   11.73  	 (cond
   11.74  	  ;;Read string
   11.75  	  ((eq type 'string)
   11.76 -	   (concat \"\" (setq leftp (read-string "Left parenthesis: " "{"))
   11.77 -		   \""\n"
   11.78 +	   (concat "\"" (setq leftp (read-string "Left parenthesis: " "("))
   11.79 +		   "\"\n"
   11.80  		   (YaTeX-generate-create-read-string)
   11.81 -		   \"\" (YaTeX-generate-corresponding-paren leftp) \"\"
   11.82 -		   ))
   11.83 -	  
   11.84 +		   "\"" (YaTeX-generate-corresponding-paren leftp) "\"")
   11.85 +	   )
   11.86  	  ;;Completing-read
   11.87  	  ((eq type 'completion)
   11.88 -	   (concat \"\" (setq leftp (read-string "Left parenthesis: " "{"))
   11.89 -		   \""\n"
   11.90 +	   (concat "\"" (setq leftp (read-string "Left parenthesis: " "{"))
   11.91 +		   "\"\n"
   11.92  		   (YaTeX-generate-create-completing-read)
   11.93 -		   \"\" (YaTeX-generate-corresponding-paren leftp) \"\")
   11.94 +		   "\"" (YaTeX-generate-corresponding-paren leftp) "\"")
   11.95  	   )
   11.96  	  ((eq type 'file)
   11.97 -	   (concat \"\" (setq leftp (read-string "Left parenthesis: " "{"))
   11.98 -		   \""\n"
   11.99 +	   (concat "\"" (setq leftp (read-string "Left parenthesis: " "("))
  11.100 +		   "\"\n"
  11.101  		   (YaTeX-generate-create-read-file-name)
  11.102 -		   \"\" (YaTeX-generate-corresponding-paren leftp) \"\")
  11.103 +		   "\"" (YaTeX-generate-corresponding-paren leftp) "\"")
  11.104  	   )
  11.105  	  ((eq type 'oneof)
  11.106  	   (YaTeX-generate-create-read-oneof nil t)
  11.107 @@ -521,7 +533,6 @@
  11.108  		   "    (concat \"[\" op \"]\")\n"
  11.109  		   "  \"\"))\n")
  11.110  	   )
  11.111 -	  
  11.112  	  ((eq type 'coord)
  11.113  	   (concat "(YaTeX:read-coordinates \""
  11.114  		   (read-string "Prompt for coordinates: ")
  11.115 @@ -576,13 +587,13 @@
  11.116  (defun YaTeX-generate-simple (&optional command)
  11.117    "Simple but requiring some elisp knowledge add-in generator."
  11.118    (interactive)
  11.119 +  (setq YaTeX-generate-variables-for-learning nil)
  11.120    (or command
  11.121        (setq command
  11.122  	    (completing-read
  11.123  	     (format "Making add-in function for (default %s): " section-name)
  11.124  	     (append
  11.125  	      section-table user-section-table tmp-section-table
  11.126 -	      article-table user-article-table
  11.127  	      env-table     user-env-table     tmp-env-table
  11.128  	      singlecmd-table user-singlecmd-table tmp-singlecmd-table)
  11.129  	     nil nil)
    12.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    12.2 +++ b/yatexhie.el	Sun Jan 22 14:20:46 1995 +0000
    12.3 @@ -0,0 +1,361 @@
    12.4 +;;; -*- Emacs-Lisp -*-
    12.5 +;;; YaTeX hierarchy browser.
    12.6 +;;; yatexhie.el
    12.7 +;;; (c )1995 by HIROSE Yuuji [yuuji@ae.keio.ac.jp]
    12.8 +;;; Last modified Sun Jan 22 23:15:25 1995 on landcruiser
    12.9 +;;; $Id$
   12.10 +
   12.11 +;; ----- Customizable variables -----
   12.12 +(defvar YaTeX-hierarchy-inspect-mode t
   12.13 +  "*Non-nil inspects the contents of file of cursor position.")
   12.14 +
   12.15 +
   12.16 +;; ----- General variables -----
   12.17 +(defvar YaTeX-default-TeX-extensions "\\.\\(tex\\|sty\\)")
   12.18 +(defvar YaTeX-hierarchy-current-main nil)
   12.19 +(defvar YaTeX-hierarchy-buffer-message
   12.20 +  (concat
   12.21 +   "n)ext p)rev N)extsamelev P)revsamelev u)p K)ill-buffer RET)select"
   12.22 +   (if (and YaTeX-emacs-19 window-system) " Mouse2)select" "")))
   12.23 +(defvar YaTeX-hierarchy-saved-wc nil "Saved window configuration.")
   12.24 +
   12.25 +;; ----- Functions for parsing hierarchy -----
   12.26 +
   12.27 +(defun YaTeX-all-included-files (&optional file)
   12.28 +  "Return all included files from FILE as a list.
   12.29 +If FILE is nil, use current buffer."
   12.30 +  (save-excursion
   12.31 +    (let ((include-regex (concat YaTeX-ec-regexp
   12.32 +				 "\\(\\(input\\)\\|"		;match#2
   12.33 +				 "\\(include\\)\\)\\b"))	;match#3
   12.34 +	  list file (cb (current-buffer)))
   12.35 +      (if file (set-buffer (YaTeX-switch-to-buffer file t)))
   12.36 +      (goto-char (point-min))
   12.37 +      (while (YaTeX-re-search-active-forward
   12.38 +	      include-regex YaTeX-comment-prefix nil t)
   12.39 +	(cond
   12.40 +	 ((match-beginning 2)		;\input, {} is optional, 1 argument
   12.41 +	  (skip-chars-forward " {")
   12.42 +	  (setq file (buffer-substring
   12.43 +		      (point)
   12.44 +		      (progn
   12.45 +			(skip-chars-forward
   12.46 +			 (concat "^ \t\n\r" YaTeX-ec-regexp "{}"))
   12.47 +			(point)))))
   12.48 +	 ((match-beginning 3)
   12.49 +	  (skip-chars-forward "{")
   12.50 +	  (setq file (buffer-substring
   12.51 +		      (point)
   12.52 +		      (progn
   12.53 +			(forward-char -1) (forward-list 1) (1- (point)))))))
   12.54 +	(or (string-match YaTeX-default-TeX-extensions file)
   12.55 +	    (setq file (concat file ".tex")))
   12.56 +	(setq list (cons file list)))
   12.57 +      (set-buffer cb)
   12.58 +      (nreverse list))))
   12.59 +
   12.60 +(defun YaTeX-document-hierarchy (&optional file)
   12.61 +  "Return the document hierarchy beginning from FILE as a list.
   12.62 +If FILE is nil, beginning with current buffer's file."
   12.63 +  (setq file (or file buffer-file-name))
   12.64 +  (message "Parsing [%s]..." (file-name-nondirectory file))
   12.65 +  (prog1
   12.66 +      (save-excursion
   12.67 +	(if (or (file-exists-p file) (null file))
   12.68 +	    (progn
   12.69 +	      (if file
   12.70 +		  (let ((parent buffer-file-name))
   12.71 +		    (YaTeX-switch-to-buffer file t)	;set buffer to file
   12.72 +		    (or YaTeX-parent-file
   12.73 +			(YaTeX-get-builtin "!")
   12.74 +			(setq YaTeX-parent-file parent))))
   12.75 +	      (cons (buffer-file-name (current-buffer))
   12.76 +		    (mapcar 'YaTeX-document-hierarchy	;return value
   12.77 +			    (YaTeX-all-included-files))))))
   12.78 +    (message "Parsing [%s]...done" (file-name-nondirectory file))))
   12.79 +
   12.80 +;; ----- Functions for displaying hierarchy -----
   12.81 +
   12.82 +(defun YaTeX-hierarchy-get-file-heading (file)
   12.83 +  "Get a FILE's heading."
   12.84 +  (save-excursion
   12.85 +    (set-buffer (find-file-noselect file))
   12.86 +    (save-excursion
   12.87 +      (goto-char (point-min))
   12.88 +      (cond
   12.89 +       ((and
   12.90 +	 (YaTeX-re-search-active-forward
   12.91 +	  (concat YaTeX-ec-regexp YaTeX-sectioning-regexp)
   12.92 +	  YaTeX-comment-prefix nil t)
   12.93 +	 (re-search-forward "{\\([^}]+\\)}" nil t))
   12.94 +	(goto-char (match-beginning 1))
   12.95 +	(skip-chars-forward " \t\n")
   12.96 +	(buffer-substring (point)
   12.97 +			  (min (point-end-of-line)
   12.98 +			       (match-end 1))))
   12.99 +       ((re-search-forward "^ *%\\([^#]\\)" nil t)
  12.100 +	(goto-char (match-beginning 1))
  12.101 +	(skip-chars-forward " \t")
  12.102 +	(buffer-substring (point) (point-end-of-line)))
  12.103 +       (t "")))))
  12.104 +
  12.105 +(defun YaTeX-display-a-hierachy (hier level)
  12.106 +  "Put a HIER of document hierarchy.
  12.107 +LEVEL is including depth."
  12.108 +  (message "Formatting hierarchy buffer...")
  12.109 +  (let ((lastatomcol 0) list i p)
  12.110 +    (cond
  12.111 +     ((listp hier)
  12.112 +      (setq  list hier)
  12.113 +      (while list
  12.114 +	(YaTeX-display-a-hierachy (car list) (1+ level))
  12.115 +	(setq list (cdr list))))
  12.116 +     ((stringp hier)			;is an atom
  12.117 +      (insert "  ")
  12.118 +      (setq i level)
  12.119 +      (while (> i 2)
  12.120 +	(insert "|   ")
  12.121 +	(setq i (1- i)))
  12.122 +      (if (> level 1) (insert "+---"))
  12.123 +      (setq p (point))
  12.124 +      (insert (or (buffer-name (get-file-buffer hier))
  12.125 +		  (file-name-nondirectory hier)))
  12.126 +      (if (and window-system YaTeX-emacs-19)
  12.127 +	  (put-text-property p (point) 'mouse-face 'underline))
  12.128 +      (insert " ")
  12.129 +      (indent-to-column (1- (/ (window-width) 2)))
  12.130 +      (insert "% " (YaTeX-hierarchy-get-file-heading hier))
  12.131 +      (insert "\n"))))
  12.132 +  (message "Formatting hierarchy buffer..."))
  12.133 +
  12.134 +(defun YaTeX-display-hierarchy (file &optional use-default)
  12.135 +  "Display document hierarchy that is beginning from FILE."
  12.136 +  (interactive "P")
  12.137 +  (setq YaTeX-hierarchy-saved-wc
  12.138 +	(list (current-window-configuration)
  12.139 +	      (and (featurep 'windows)
  12.140 +		   (boundp 'win:current-config)
  12.141 +		   win:current-config)))
  12.142 +  (let*((b-in (YaTeX-get-builtin "!"))
  12.143 +	(default (or YaTeX-parent-file
  12.144 +		     (and b-in (YaTeX-guess-parent b-in))
  12.145 +		     buffer-file-name)))
  12.146 +    ;;$B$`!<$s"-$3$N$X$s$N;EMM$I$&$7$?$i$$$$$+NI$/J,$+$i$s(B...
  12.147 +    (if default (setq default (expand-file-name default)))
  12.148 +    (YaTeX-visit-main t)		;move to parent file
  12.149 +    (setq file
  12.150 +	  (or (if use-default default file)
  12.151 +	      (read-file-name
  12.152 +	       (format
  12.153 +		"Main .tex file%s: "
  12.154 +		(if default
  12.155 +		    (format "(default %s)"(file-name-nondirectory default))
  12.156 +		  ""))
  12.157 +	       "" default 1))))
  12.158 +  (setq file (expand-file-name file))
  12.159 +  (setq YaTeX-hierarchy-current-main file)
  12.160 +  (let ((dbuf "*document hierarchy*"))
  12.161 +    (YaTeX-showup-buffer dbuf nil t)
  12.162 +    (set-buffer (get-buffer dbuf))
  12.163 +    (setq truncate-lines t)
  12.164 +    (let ((buffer-read-only nil))
  12.165 +      (erase-buffer)
  12.166 +      (YaTeX-display-a-hierachy (YaTeX-document-hierarchy file) 0))
  12.167 +    (goto-char (point-min))
  12.168 +    (YaTeX-hierarchy-next 0)
  12.169 +    (set-buffer-modified-p nil)
  12.170 +    (YaTeX-hierarchy-mode)
  12.171 +    ))
  12.172 +
  12.173 +(defun YaTeX-display-hierarchy-directly ()
  12.174 +  "Same as YaTeX-display-hierarchy.  Call from mouse."
  12.175 +  (interactive)
  12.176 +  (YaTeX-display-hierarchy nil t))
  12.177 +
  12.178 +(defun YaTeX-hierarchy-mode ()
  12.179 +  "Major mode to browse and select document hierarchy.
  12.180 +
  12.181 +\\[YaTeX-hierarchy-next]	next line
  12.182 +\\[YaTeX-hierarchy-prev]	previous line
  12.183 +\\[YaTeX-hierarchy-forward]	move forward in same level
  12.184 +\\[YaTeX-hierarchy-backward]	move backward in same level
  12.185 +\\[YaTeX-hierarchy-up-document]	move to parent file
  12.186 +\\[delete-other-windows]	delete other windows
  12.187 +\\[other-window]	other window
  12.188 +\\[YaTeX-hierarchy-show]	show buffer contents in the next window
  12.189 +\\[YaTeX-hierarchy-select]	select file
  12.190 +\\[YaTeX-hierarchy-mouse-select]	select
  12.191 +"
  12.192 +  (setq major-mode 'YaTeX-hierarchy-mode
  12.193 +	mode-name "YaTeX hier")
  12.194 +  (use-local-map YaTeX-hierarchy-mode-map)
  12.195 +  (setq buffer-read-only t)
  12.196 +  (message YaTeX-hierarchy-buffer-message))
  12.197 +
  12.198 +;; ----- Subfunctions for interactive functions -----
  12.199 +(defun YaTeX-hierarchy-get-current-file-buffer ()
  12.200 +  "Return the buffer associated with current line's file."
  12.201 +  (let ((file (buffer-substring
  12.202 +	       (point)
  12.203 +	       (save-excursion
  12.204 +		 (skip-chars-forward "^ \t" (point-end-of-line)) (point))))
  12.205 +	(hilit-auto-highlight) buffer)
  12.206 +    (set-buffer (find-file-noselect YaTeX-hierarchy-current-main))
  12.207 +    (if (get-buffer file)		;buffer is active
  12.208 +	(setq buffer (get-buffer file)) ;may contain `<2>'
  12.209 +      (if (string-match "<[2-9]>$" file)
  12.210 +	  (setq file (substring file 0 -3)))
  12.211 +      (save-excursion
  12.212 +	(setq buffer (YaTeX-switch-to-buffer file t)))))) ; open it!
  12.213 +
  12.214 +;; ----- Interactive functions -----
  12.215 +(defun YaTeX-hierarchy-next (arg &optional quiet)
  12.216 +  "Move to next line's file in YaTeX document hierarchy buffer."
  12.217 +  (interactive "p")
  12.218 +  (forward-line arg)
  12.219 +  (skip-chars-forward "- +\\|")
  12.220 +  (if (and (/= arg 0) YaTeX-hierarchy-inspect-mode (not quiet))
  12.221 +      (YaTeX-hierarchy-select t))
  12.222 +  (message YaTeX-hierarchy-buffer-message))
  12.223 +
  12.224 +(defun YaTeX-hierarchy-prev (arg)
  12.225 +  "Move to previous line's file in YaTeX document hierarchy buffer."
  12.226 +  (interactive "p")
  12.227 +  (YaTeX-hierarchy-next (- arg)))
  12.228 +
  12.229 +(defun YaTeX-hierarchy-next-line (arg)
  12.230 +  (interactive "p")
  12.231 +  (YaTeX-hierarchy-next arg t))
  12.232 +
  12.233 +(defun YaTeX-hierarchy-prev-line (arg)
  12.234 +  (interactive "p")
  12.235 +  (YaTeX-hierarchy-next (- arg) t))
  12.236 +
  12.237 +(defun YaTeX-hierarchy-forward (arg)
  12.238 +  "Move to forward file in same hierarchy level."
  12.239 +  (interactive "p")
  12.240 +  (YaTeX-hierarchy-next 0)
  12.241 +  (let ((p (point))(column (current-column)) (i (if (> arg 0) arg (- arg))))
  12.242 +    (if (= column 0) (error "Not on file line."))
  12.243 +    (while (> i 0)
  12.244 +      (if (catch 'found
  12.245 +	    (while (and (not (eobp)) (not (bobp)))
  12.246 +	      (forward-line (if (> arg 0) 1 -1))
  12.247 +	      (move-to-column column)
  12.248 +	      (if (looking-at "[- +\\|]") nil
  12.249 +		(YaTeX-hierarchy-next 0)
  12.250 +		(if (= (current-column) column) (throw 'found t)))
  12.251 +	      (beginning-of-line)))
  12.252 +	  nil
  12.253 +	(goto-char p)
  12.254 +	(error "No same level file."))
  12.255 +      (setq i (1- i)))))
  12.256 +
  12.257 +(defun YaTeX-hierarchy-backward (arg)
  12.258 +  "Move to backward file in same hierarchy level."
  12.259 +  (interactive "p")
  12.260 +  (YaTeX-hierarchy-forward (- arg)))
  12.261 +
  12.262 +(defun YaTeX-hierarchy-up-document ()
  12.263 +  "Up level, that is, move to parent file position."
  12.264 +  (interactive)
  12.265 +  (YaTeX-hierarchy-next 0)		;adjust column
  12.266 +  (let ((p (point)) (line (count-lines (point-min) (point))) column)
  12.267 +    (if (or (<= line 1) (< (current-column) 6))
  12.268 +	(message "No more parent")
  12.269 +      (backward-char 1)
  12.270 +      (or (= (char-after (point)) ?-) (error "Unexpected hierarchy buffer"))
  12.271 +      (setq column (current-column))
  12.272 +      (while (and (> line 1) (looking-at "[- +\\|]"))
  12.273 +	(forward-line -1)
  12.274 +	(move-to-column column))
  12.275 +      (YaTeX-hierarchy-next 0)
  12.276 +      (push-mark p t)
  12.277 +      (message "Mark set to last position"))))
  12.278 +
  12.279 +(defun YaTeX-hierarchy-kill-buffer (arg)
  12.280 +  "Kill buffer associated with current line's file."
  12.281 +  (interactive "p")
  12.282 +  (YaTeX-hierarchy-next 0)		;move to file name column
  12.283 +  (if (bolp) (error "Not on file name line"))
  12.284 +  (let ((file (buffer-substring (point) (point-end-of-line))))
  12.285 +    (YaTeX-hierarchy-next arg)
  12.286 +    (cond
  12.287 +     ((get-buffer file)
  12.288 +      (kill-buffer (get-buffer file))
  12.289 +      (message "Buffer [%s] was killed" file))
  12.290 +     (t (message "Buffer [%s] is not active." file)))))
  12.291 +
  12.292 +(defun YaTeX-hierarchy-select (arg)
  12.293 +  "Select current line's file in YaTeX document hierarchy buffer.
  12.294 +If ARG is non-nil, show the buffer in the next window."
  12.295 +  (interactive "P")
  12.296 +  (beginning-of-line)
  12.297 +  (skip-chars-forward "- +\\|")
  12.298 +  (or (eolp)
  12.299 +      (let ((buffer (YaTeX-hierarchy-get-current-file-buffer)))
  12.300 +	(if buffer			;if file was found
  12.301 +	    (if arg
  12.302 +		(YaTeX-showup-buffer buffer nil)
  12.303 +	      (if (and YaTeX-emacs-19 window-system
  12.304 +		       (get-buffer-window buffer t))
  12.305 +		  (goto-buffer-window buffer) ;select currently displaying
  12.306 +		(YaTeX-switch-to-buffer-other-window buffer)))))))
  12.307 +
  12.308 +(defun YaTeX-hierarchy-show ()
  12.309 +  "Show current line's file in the next window."
  12.310 +  (interactive)
  12.311 +  (YaTeX-hierarchy-select t))
  12.312 +
  12.313 +(defun YaTeX-hierarchy-mouse-select (event)
  12.314 +  (interactive "e")
  12.315 +  (mouse-set-point event)
  12.316 +  (YaTeX-hierarchy-select nil))
  12.317 +
  12.318 +(defun YaTeX-hierarchy-quit ()
  12.319 +  "Quit from YaTeX-hierarchy buffer and restore window configuration."
  12.320 +  (interactive)
  12.321 +  (if (or (not (featurep 'windows))
  12.322 +	  (car YaTeX-hierarchy-saved-wc)
  12.323 +	  (and (= (car (cdr YaTeX-hierarchy-saved-wc)) win:current-config)))
  12.324 +      (set-window-configuration (car YaTeX-hierarchy-saved-wc))
  12.325 +    (bury-buffer nil)))
  12.326 +
  12.327 +(defun YaTeX-hierarchy-toggle-inspection (arg)
  12.328 +  "Toggle inspection mode of YaTeX-hierarchy buffer."
  12.329 +  (interactive "P")
  12.330 +  (setq YaTeX-hierarchy-inspect-mode
  12.331 +	(or arg (not YaTeX-hierarchy-inspect-mode)))
  12.332 +  (message "YaTeX hierarchy inspection mode %s"
  12.333 +	   (if YaTeX-hierarchy-inspect-mode "ON" "OFF")))
  12.334 +
  12.335 +;; ----- Setting up keymap -----
  12.336 +(defvar YaTeX-hierarchy-mode-map nil "Keymap used in YaTeX-hierarchy-mode.")
  12.337 +(if YaTeX-hierarchy-mode-map nil
  12.338 +  (setq YaTeX-hierarchy-mode-map (make-sparse-keymap))
  12.339 +  (define-key YaTeX-hierarchy-mode-map "n"	'YaTeX-hierarchy-next)
  12.340 +  (define-key YaTeX-hierarchy-mode-map "p"	'YaTeX-hierarchy-prev)
  12.341 +  (define-key YaTeX-hierarchy-mode-map "j"	'YaTeX-hierarchy-next-line)
  12.342 +  (define-key YaTeX-hierarchy-mode-map "k"	'YaTeX-hierarchy-prev-line)
  12.343 +  (substitute-all-key-definition
  12.344 +   'next-line 'YaTeX-hierarchy-next-line YaTeX-hierarchy-mode-map)
  12.345 +  (substitute-all-key-definition
  12.346 +   'previous-line 'YaTeX-hierarchy-prev-line YaTeX-hierarchy-mode-map)
  12.347 +  (define-key YaTeX-hierarchy-mode-map "N"	'YaTeX-hierarchy-forward)
  12.348 +  (define-key YaTeX-hierarchy-mode-map "P"	'YaTeX-hierarchy-backward)
  12.349 +  (define-key YaTeX-hierarchy-mode-map "u"	'YaTeX-hierarchy-up-document)
  12.350 +  (define-key YaTeX-hierarchy-mode-map "K"	'YaTeX-hierarchy-kill-buffer)
  12.351 +  (define-key YaTeX-hierarchy-mode-map "1"	'delete-other-windows)
  12.352 +  (define-key YaTeX-hierarchy-mode-map "o"	'other-window)
  12.353 +  (define-key YaTeX-hierarchy-mode-map "."	'YaTeX-hierarchy-show)
  12.354 +  (define-key YaTeX-hierarchy-mode-map "\C-m"	'YaTeX-hierarchy-select)
  12.355 +  (define-key YaTeX-hierarchy-mode-map ";" 'YaTeX-hierarchy-toggle-inspection)
  12.356 +  (define-key YaTeX-hierarchy-mode-map "q"	'YaTeX-hierarchy-quit)
  12.357 +  (define-key YaTeX-hierarchy-mode-map "?"	'describe-mode)
  12.358 +  (if (and YaTeX-emacs-19 window-system)
  12.359 +      (define-key YaTeX-hierarchy-mode-map
  12.360 +	[mouse-2] 'YaTeX-hierarchy-mouse-select))
  12.361 +  )
  12.362 +
  12.363 +(provide 'yatexhie)
  12.364 +;;end of yatexhie.el
    13.1 --- a/yatexlib.el	Tue Dec 20 21:00:21 1994 +0000
    13.2 +++ b/yatexlib.el	Sun Jan 22 14:20:46 1995 +0000
    13.3 @@ -1,8 +1,8 @@
    13.4  ;;; -*- Emacs-Lisp -*-
    13.5  ;;; YaTeX library of general functions.
    13.6  ;;; yatexlib.el
    13.7 -;;; (c )1994 by HIROSE Yuuji.[yuuji@ae.keio.ac.jp]
    13.8 -;;; Last modified Wed Dec 21 05:58:06 1994 on landcruiser
    13.9 +;;; (c )1994-1995 by HIROSE Yuuji.[yuuji@ae.keio.ac.jp]
   13.10 +;;; Last modified Sun Jan 22 23:15:03 1995 on landcruiser
   13.11  ;;; $Id$
   13.12  
   13.13  ;;;###autoload
   13.14 @@ -46,17 +46,19 @@
   13.15    "Switch to buffer if buffer exists, find file if not.
   13.16  Optional second arg SETBUF t make use set-buffer instead of switch-to-buffer."
   13.17    (interactive "Fswitch to file: ")
   13.18 -  (let (buf)
   13.19 -    (if (setq buf (get-file-buffer file))
   13.20 -	(progn
   13.21 -	  (funcall (if setbuf 'set-buffer 'switch-to-buffer)
   13.22 -		   (get-file-buffer file))
   13.23 -	  buf)
   13.24 -      (if (file-exists-p file)
   13.25 -	  (or ;find-file returns nil but set current-buffer...
   13.26 -	   (funcall (if setbuf 'find-file-noselect 'find-file) file)
   13.27 -	   (current-buffer))
   13.28 -	(message "%s was not found in this directory." file)
   13.29 +  (if (bufferp file) (setq file (buffer-file-name file)))
   13.30 +  (let (buf (hilit-auto-highlight (not setbuf)))
   13.31 +    (cond
   13.32 +     ((setq buf (get-file-buffer file))
   13.33 +      (funcall (if setbuf 'set-buffer 'switch-to-buffer)
   13.34 +	       (get-file-buffer file))
   13.35 +      buf)
   13.36 +     ((or YaTeX-create-file-prefix-g (file-exists-p file))
   13.37 +      (or ;find-file returns nil but set current-buffer...
   13.38 +       (if setbuf (set-buffer (find-file-noselect file))
   13.39 +	 (find-file file))
   13.40 +       (current-buffer)))
   13.41 +     (t (message "%s was not found in this directory." file)
   13.42  	nil)))
   13.43  )
   13.44  
   13.45 @@ -64,11 +66,14 @@
   13.46  (defun YaTeX-switch-to-buffer-other-window (file)
   13.47    "Switch to buffer if buffer exists, find file if not."
   13.48    (interactive "Fswitch to file: ")
   13.49 -  (if (get-file-buffer file)
   13.50 -      (progn (switch-to-buffer-other-window (get-file-buffer file)) t)
   13.51 -    (if (file-exists-p file)
   13.52 -	(progn (find-file-other-window file) t)
   13.53 -      (message "%s was not found in this directory." file)
   13.54 +  (if (bufferp file) (setq file (buffer-file-name file)))
   13.55 +  (cond
   13.56 +   ((get-file-buffer file)
   13.57 +    (switch-to-buffer-other-window (get-file-buffer file))
   13.58 +    t)
   13.59 +   ((or YaTeX-create-file-prefix-g (file-exists-p file))
   13.60 +    (find-file-other-window file) t)
   13.61 +   (t (message "%s was not found in this directory." file)
   13.62        nil))
   13.63  )
   13.64  
   13.65 @@ -293,6 +298,7 @@
   13.66  (defun goto-buffer-window (buffer)
   13.67    "Select window which is bound to BUFFER.
   13.68  If no such window exist, switch to buffer BUFFER."
   13.69 +  (interactive "BGoto buffer: ")
   13.70    (if (stringp buffer)
   13.71        (setq buffer (or (get-file-buffer buffer) (get-buffer buffer))))
   13.72    (if (get-buffer buffer)
    14.1 --- a/yatexmth.el	Tue Dec 20 21:00:21 1994 +0000
    14.2 +++ b/yatexmth.el	Sun Jan 22 14:20:46 1995 +0000
    14.3 @@ -1,14 +1,14 @@
    14.4  ;;; -*- Emacs-Lisp -*-
    14.5  ;;; YaTeX math-mode-specific functions.
    14.6 -;;; yatexmth.el rev.2
    14.7 -;;; (c )1993-1994 by HIROSE Yuuji [yuuji@ae.keio.ac.jp]
    14.8 -;;; Last modified Fri Dec  2 17:03:30 1994 on VFR
    14.9 +;;; yatexmth.el rev.3
   14.10 +;;; (c )1993-1995 by HIROSE Yuuji [yuuji@ae.keio.ac.jp]
   14.11 +;;; Last modified Sun Jan 22 23:14:51 1995 on landcruiser
   14.12  ;;; $Id$
   14.13  
   14.14  ;;; [Customization guide]
   14.15  ;;;
   14.16  ;;;	  By default,  you can use two  completion  groups in YaTeX math
   14.17 -;;;	mode, `;' for mathematical signs and `/' for greek letters.  But
   14.18 +;;;	mode, `;' for mathematical signs and `:' for greek letters.  But
   14.19  ;;;	you  can add other completion groups   by defining the  alist of
   14.20  ;;;	`prefix  key'    vs   `completion   list'    into  the  variable
   14.21  ;;;	YaTeX-math-key-list-private.  If  you wish  to    accomplish the
   14.22 @@ -50,7 +50,7 @@
   14.23  
   14.24  ;;; 【イメージ補完の追加方法】
   14.25  ;;;
   14.26 -;;;	  標準のイメージ補完では、「;」で始まる数式記号補完と、「/」で始
   14.27 +;;;	  標準のイメージ補完では、「;」で始まる数式記号補完と、「:」で始
   14.28  ;;;	まるギリシャ文字補完が使用可能ですが、これ以外の文字で始まる補完
   14.29  ;;;	シリーズも定義することができます。例えば、「,」で始まる次のよう
   14.30  ;;;	な補完シリーズを定義する場合を考えてみます。
   14.31 @@ -108,7 +108,7 @@
   14.32  (YaTeX-setq-math-sym YaTeX-image-flat		"b"		"♭")
   14.33  (YaTeX-setq-math-sym YaTeX-image-sqrt		""		"√")
   14.34  
   14.35 -(setq
   14.36 +(defvar
   14.37   YaTeX-math-sign-alist-default
   14.38   '(
   14.39     ;frequently used
   14.40 @@ -258,15 +258,15 @@
   14.41     ("D"		"diamondsuit"	"/\\\n\\/")
   14.42     ("H"		"heartsuit"	"<^^>\n \\/")
   14.43     ("S"		"spadesuit"	" /\\\n<++>\n /\\")
   14.44 -
   14.45 -   ))
   14.46 +   )
   14.47 + "Default LaTeX-math-command alist.")
   14.48  
   14.49  (defvar YaTeX-math-sign-alist-private nil
   14.50    "*User definable key vs LaTeX-math-command alist.")
   14.51  
   14.52  (defvar YaTeX-math-quit-with-strict-match nil
   14.53    "*T for quitting completion as soon as strict-match is found.")
   14.54 -(setq YaTeX-math-sign-alist
   14.55 +(defvar YaTeX-math-sign-alist
   14.56        (append YaTeX-math-sign-alist-private YaTeX-math-sign-alist-default))
   14.57  
   14.58  ;;(defun YaTeX-math-alist2array (alist array)
   14.59 @@ -278,7 +278,7 @@
   14.60  ;;	 array))
   14.61  ;;)
   14.62  
   14.63 -(setq YaTeX-greek-key-alist-default
   14.64 +(defvar YaTeX-greek-key-alist-default
   14.65    '(
   14.66      ("a"	"alpha"		("a" "α"))
   14.67      ("b"	"beta"		("|>\n|>\n|" "β"))
   14.68 @@ -326,19 +326,18 @@
   14.69      ("W"	"Omega"		("(~)\n~ ~" "Ω"))
   14.70      ("f" "foo")
   14.71      )
   14.72 -)
   14.73 +  "Default LaTeX-math-command alist.")
   14.74  
   14.75  (defvar YaTeX-greek-key-alist-private nil
   14.76    "*User definable key vs LaTeX-math-command alist.")
   14.77  
   14.78 -(setq YaTeX-greek-key-alist
   14.79 +(defvar YaTeX-greek-key-alist
   14.80        (append YaTeX-greek-key-alist-private YaTeX-greek-key-alist-default))
   14.81  
   14.82  ;;(mapcar (function (lambda (x) (YaTeX-math-alist2array x)))
   14.83  ;;	YaTeX-math-key-list)
   14.84  
   14.85 -(setq YaTeX-math-indicator
   14.86 -  "KEY\tLaTeX sequence\t\tsign")
   14.87 +(defvar YaTeX-math-indicator "KEY\tLaTeX sequence\t\tsign")
   14.88  
   14.89  (defvar YaTeX-math-need-image t
   14.90    "*T for displaying pseudo image momentarily.")
   14.91 @@ -585,14 +584,15 @@
   14.92  	  (setq buffer-file-name name)
   14.93  	  (set-buffer-modified-p modified)))))
   14.94  
   14.95 -(defun YaTeX-math-insert-sequence (&optional force)
   14.96 +(defun YaTeX-math-insert-sequence (&optional force initial)
   14.97    "Insert math-mode sequence with image completion."
   14.98    (interactive "P")
   14.99 -  (let*((key "") regkey str  last-char list i
  14.100 +  (let*((key (or initial "")) regkey str  last-char list i
  14.101  	(case-fold-search nil) match sign
  14.102  	(this-key (char-to-string last-command-char))
  14.103  	(alist (symbol-value (cdr (assoc this-key YaTeX-math-key-list))))
  14.104  	(n (length alist)) (beg (point)) result)
  14.105 +    (if initial (insert YaTeX-ec (car (cdr (assoc initial alist)))))
  14.106      (setq result
  14.107  	  (catch 'complete
  14.108  	    (if (and (not force)
  14.109 @@ -669,7 +669,7 @@
  14.110        (message "Abort."))
  14.111       ((eq result 'escape)
  14.112        (delete-region beg (point))
  14.113 -      (insert this-key))
  14.114 +      (call-interactively (global-key-binding this-key)))
  14.115       ((eq result 'select)
  14.116        (message "Done."))
  14.117       ((eq result 'exit)
  14.118 @@ -680,6 +680,21 @@
  14.119        (setq key (concat "^" (regexp-quote (substring key 0 -1))))
  14.120        (insert (YaTeX-math-show-menu key)))))
  14.121  )
  14.122 +
  14.123 +;; ----- Change image completion types -----
  14.124 +(defun YaTeX-math-member-p (item)
  14.125 +  "Check if ITEM is a member of image completion.
  14.126 +If so return the cons of its invocation key and image-string."
  14.127 +  (let ((lists YaTeX-math-key-list) list)
  14.128 +    (catch 'found
  14.129 +      (while lists
  14.130 +	(setq list (symbol-value (cdr (car lists))))
  14.131 +	(while list
  14.132 +	  (if (string= item (nth 1 (car list)))
  14.133 +	      (throw 'found (cons (car (car lists)) (nth 0 (car list)))))
  14.134 +	  (setq list (cdr list)))
  14.135 +	(setq lists (cdr lists))))))
  14.136 +
  14.137  ;;
  14.138  (provide 'yatexmth)
  14.139  
    15.1 --- a/yatexprc.el	Tue Dec 20 21:00:21 1994 +0000
    15.2 +++ b/yatexprc.el	Sun Jan 22 14:20:46 1995 +0000
    15.3 @@ -1,8 +1,8 @@
    15.4  ;;; -*- Emacs-Lisp -*-
    15.5  ;;; YaTeX process handler.
    15.6  ;;; yatexprc.el
    15.7 -;;; (c )1993-1994 by HIROSE Yuuji.[yuuji@ae.keio.ac.jp]
    15.8 -;;; Last modified Wed Dec 14 16:58:15 1994 on 98fa
    15.9 +;;; (c )1993-1995 by HIROSE Yuuji.[yuuji@ae.keio.ac.jp]
   15.10 +;;; Last modified Sun Jan 22 23:14:44 1995 on landcruiser
   15.11  ;;; $Id$
   15.12  
   15.13  (require 'yatex)
   15.14 @@ -142,8 +142,8 @@
   15.15  )
   15.16  
   15.17  (defun YaTeX-typeset-region ()
   15.18 -  "Paste the region to the file `texput.tex' and execute jlatex (or other)
   15.19 -to LaTeX typeset.  The region is specified by the rule:
   15.20 +  "Paste the region to the file `texput.tex' and execute typesetter.
   15.21 +The region is specified by the rule:
   15.22  	(1)If keyword `%#BEGIN' is found in the upper direction from (point).
   15.23  	  (1-1)if the keyword `%#END' is found after `%#BEGIN',
   15.24  		->Assume the text between `%#BEGIN' and `%#END' as region.
   15.25 @@ -161,7 +161,7 @@
   15.26  	 (cmd (concat (YaTeX-get-latex-command nil) " " texput))
   15.27  	 (buffer (current-buffer)) opoint preamble (subpreamble "") main
   15.28  	 (hilit-auto-highlight nil)	;for Emacs19 with hilit19
   15.29 -	 reg-begin reg-end)
   15.30 +	 reg-begin reg-end lineinfo)
   15.31  
   15.32        (save-excursion
   15.33  	(if (search-backward "%#BEGIN" nil t)
   15.34 @@ -173,8 +173,10 @@
   15.35  		  (setq reg-end (match-beginning 0)
   15.36  			end "END ---")
   15.37  		(setq reg-end (point-max))))
   15.38 -	  (setq typeout "=== Region from (point) to (mark) ===")
   15.39 -	  (setq reg-begin (point) reg-end (mark)))
   15.40 +	  (setq typeout "=== Region from (point) to (mark) ==="
   15.41 +		reg-begin (point) reg-end (mark)))
   15.42 +	(goto-char (min reg-begin reg-end))
   15.43 +	(setq lineinfo (count-lines (point-min) (point-end-of-line)))
   15.44  	(goto-char (point-min))
   15.45  	(while (search-forward "%#REQUIRE" nil t)
   15.46  	  (setq subpreamble
   15.47 @@ -201,12 +203,14 @@
   15.48  		 "\\begin{document}")))
   15.49        (goto-char opoint)
   15.50        ;;(set-buffer buffer)		;for clarity
   15.51 -      (set-buffer (find-file-noselect texput))
   15.52 +      (let ((hilit-auto-highlight nil))
   15.53 +	(set-buffer (find-file-noselect texput)))
   15.54        ;;(find-file YaTeX-texput-file)
   15.55        (erase-buffer)
   15.56        (if YaTeX-need-nonstop
   15.57  	  (insert "\\nonstopmode{}\n"))
   15.58        (insert preamble "\n" subpreamble "\n")
   15.59 +      (setq lineinfo (list (count-lines 1 (point-end-of-line)) lineinfo))
   15.60        (insert-buffer-substring buffer reg-begin reg-end)
   15.61        (insert "\\typeout{" typeout end "}\n") ;Notice the selected method.
   15.62        (insert "\n\\end{document}\n")
   15.63 @@ -215,7 +219,10 @@
   15.64        (set-buffer main)		;return to parent file or itself.
   15.65        (YaTeX-typeset cmd YaTeX-typeset-buffer)
   15.66        (switch-to-buffer buffer)		;for Emacs-19
   15.67 -      (put 'dvi2-command 'region t)))
   15.68 +      (put 'dvi2-command 'region t)
   15.69 +      (put 'dvi2-command 'file buffer)
   15.70 +      (put 'dvi2-command 'offset lineinfo)
   15.71 +      ))
   15.72  )
   15.73  
   15.74  (defun YaTeX-typeset-buffer ()
   15.75 @@ -379,6 +386,17 @@
   15.76  		 " to preview " preview-file))))))
   15.77  )
   15.78  
   15.79 +(defun YaTeX-set-virtual-error-position (file-sym line-sym)
   15.80 +  "Replace the value of FILE-SYM, LINE-SYM by virtual error position."
   15.81 +  (cond
   15.82 +   ((and (get 'dvi2-command 'region)
   15.83 +	 (> (symbol-value line-sym) (car (get 'dvi2-command 'offset))))
   15.84 +    (set file-sym (get 'dvi2-command 'file))
   15.85 +    (set line-sym
   15.86 +	 (+ (- (apply '- (get 'dvi2-command 'offset)))
   15.87 +	    (symbol-value line-sym)
   15.88 +	    -1)))))
   15.89 +
   15.90  (defun YaTeX-prev-error ()
   15.91    "Visit previous typeset error.
   15.92    To avoid making confliction of line numbers by editing, jump to
   15.93 @@ -404,10 +422,11 @@
   15.94  	   (buffer-substring
   15.95  	    (point)
   15.96  	    (progn (skip-chars-forward "0-9" (match-end 0)) (point))))
   15.97 -	  error-buffer (YaTeX-get-error-file cur-buf)
   15.98 -	  error-win (get-buffer-window error-buffer))
   15.99 +	  error-buffer (YaTeX-get-error-file cur-buf))
  15.100      (if (or (null error-line) (equal 0 error-line))
  15.101  	(error "Can't detect error position."))
  15.102 +    (YaTeX-set-virtual-error-position 'error-buffer 'error-line)
  15.103 +    (setq error-win (get-buffer-window error-buffer))
  15.104      (select-window cur-win)
  15.105      (cond
  15.106       (error-win (select-window error-win))
  15.107 @@ -442,12 +461,13 @@
  15.108        (goto-char (match-beginning 0))
  15.109        (setq error-line (string-to-int
  15.110  			(buffer-substring (match-beginning 1) (match-end 1)))
  15.111 -	    error-file (YaTeX-get-error-file YaTeX-current-TeX-buffer)
  15.112 -	    error-buf (YaTeX-switch-to-buffer error-file t))
  15.113 +	    error-file (YaTeX-get-error-file YaTeX-current-TeX-buffer))
  15.114 +      (YaTeX-set-virtual-error-position 'error-file 'error-line)
  15.115 +      (setq error-buf (YaTeX-switch-to-buffer error-file t)))
  15.116        (if (null error-buf)
  15.117  	  (error "`%s' is not found in this directory." error-file))
  15.118        (YaTeX-showup-buffer error-buf nil t)
  15.119 -      (goto-line error-line)))
  15.120 +      (goto-line error-line))
  15.121  )
  15.122  
  15.123  (defun YaTeX-send-string ()
  15.124 @@ -585,7 +605,7 @@
  15.125  page range description."
  15.126    (interactive "P")
  15.127    (let*((cmd (or (YaTeX-get-builtin "LPR") dviprint-command-format))
  15.128 -	from to (lbuffer "*dvi-printing*"))
  15.129 +	from to (lbuffer "*dvi-printing*") dir)
  15.130      (setq
  15.131       cmd 
  15.132       (YaTeX-replace-format
  15.133 @@ -616,10 +636,12 @@
  15.134  	   'YaTeX-lpr-command-history))
  15.135      (save-excursion
  15.136        (YaTeX-visit-main t) ;;change execution directory
  15.137 +      (setq dir default-directory)
  15.138        (YaTeX-showup-buffer
  15.139         lbuffer (function (lambda (x) (nth 3 (window-edges x)))))
  15.140        (set-buffer (get-buffer-create lbuffer))
  15.141        (erase-buffer)
  15.142 +      (cd dir)				;for 19
  15.143        (cond
  15.144         (YaTeX-dos
  15.145  	(call-process shell-file-name "con" "*dvi-printing*" nil
  15.146 @@ -636,6 +658,8 @@
  15.147  (defun YaTeX-main-file-p ()
  15.148    "Return if current buffer is main LaTeX source."
  15.149    (cond
  15.150 +   (YaTeX-parent-file
  15.151 +    (eq (get-file-buffer YaTeX-parent-file) (current-buffer)))
  15.152     ((YaTeX-get-builtin "!")
  15.153      (string-match (YaTeX-guess-parent (YaTeX-get-builtin "!")) (buffer-name)))
  15.154     (t