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 wrap: on
line diff
--- a/docs/yatex.ref	Tue Dec 20 21:00:21 1994 +0000
+++ b/docs/yatex.ref	Sun Jan 22 14:20:46 1995 +0000
@@ -8,11 +8,12 @@
 
 	  野鳥では、prefix キーをカスタマイズできるため(標準ではC-c)これを
 	[prefix] と表記します。C-c のまま変更していない場合、[prefix] a は
-	C-c a を表わします。begin型コマンドとは \begin〜\endの形式のコマ
-	ンド、section型コマンドとは \section{題}のように引数を取るコマン
-	ド、large型コマンドとは {\tt } のような中括弧で囲まれたフォント/
-	サイズ指定子、maketitle型コマンドとは \maketitle のように引数を
-	伴わないコマンドを指します。
+	C-c a を表わします。
+	  begin型コマンドとは \begin〜\endの形式のコマンド、section型コ
+	マンドとは \section{題}のように引数を取るコマンド、large型コマン
+	ドとは {\tt } のような中括弧で囲まれたフォント/サイズ指定子、
+	maketitle型コマンドとは \maketitle のように引数を伴わないコマン
+	ドを指します。
 
 
 【補完】
@@ -30,25 +31,27 @@
 	◆section型補完(領域指定)	[prefix] S
 	◆随時補完			[prefix] SPC
 
-	  即時begin型補完の、環境名の頭文字の対応については、yatex.doc を
-	ご覧ください。領域指定モードでは、マークした位置とポイントの間を
-	\begin{center}…\end{center} や {\large } などで括ります。
+	  即時begin型補完の、環境名の頭文字の対応については、Info マニュ
+	アルをご覧ください。領域指定モードでは、マークした位置とポイント
+	の間を\begin{center}…\end{center} や {\large } などで括ります。
 
 	◆数式記号イメージ補完		;
-	◆ギリシャ文字イメージ補完	/
+	◆ギリシャ文字イメージ補完	:
 
 	  上の2つはTeXの数式環境の中で押した場合のみ有効です。強制的に補
-	完機能を使う場合は、C-u を押してから ; / を押します。
+	完機能を使う場合は、C-u を押してから ; や : を押します。
 
 
 【プロセス起動】
 
 	◆jbibtex起動			[prefix] tb
 	◆jlatex起動			[prefix] tj
-	◆jlatex停止			[prefix] tk	※
+	◆makeindex起動			[prefix] ti
+	◆jlatexのkill			[prefix] tk	※
 	◆プリントアウト		[prefix] tl
 	◆プリントアウト(全ページ)	C-u [prefix] tl
 	◆プレビューア起動		[prefix] tp
+	◆lpq起動			[prefix] tq
 	◆jlatex起動(領域指定)		[prefix] tr
 
 	  [prefix] t を押せばメニューが出るので、[prefix] t の次に押すキー
@@ -70,6 +73,7 @@
 	もちろん jlatex でエラーが生じた場合のみ有効です。
 
 	◆対応するオブジェクトジャンプ	[prefix] g
+	◆別ウィンドウで   〃		[prefix] 4g
 
 	  カーソルジャンプは、[prefix] g を押す時のカーソルの位置により、
 	ジャンプすべき場所を判断します。
@@ -112,12 +116,17 @@
 【その他】
 	
 	◆itemの桁揃え			[prefix] i
+
+	  \item を使う環境中のみ有効です。
+
 	◆LaTeXコマンド変更		[prefix] c
 
 	  \begin{}, \end{} の行で起動すると環境名を同時に変更します。
 	section型コマンドの上で起動するとコマンドを変更し、コマンドの引
 	数の位置で起動すると引数を変更します。large型コマンドの上で起動
-	するとフォント/サイズ指定子を変更します。
+	するとフォント/サイズ指定子を変更します。イメージ補完で入力した
+	数式モードコマンドの上で起動すると確定直前のイメージ補完操作に戻
+	ります。
 
 	◆コマンド削除			[prefix] k
 
@@ -132,7 +141,7 @@
 
 	◆モード切り替え		[prefix] w
 
-	  新規作成/更新モード、数式モードの切り替えメニューが出ます。
+	  新規作成/修正モード、数式モードの切り替えメニューが出ます。
 
 	◆%# 記法の編集			[prefix] %
 	◆tabular/array桁位置表示	[prefix] &
--- a/docs/yatexadd.doc	Tue Dec 20 21:00:21 1994 +0000
+++ b/docs/yatexadd.doc	Sun Jan 22 14:20:46 1995 +0000
@@ -135,9 +135,20 @@
 		字が htbp に限られているなら、(YaTeX:read-position "htbp")
 		と呼び出します。
 
-	・関数	YaTeX:read-coordinates
-	  引数	基本プロンプト, X座標プロンプト, Y座標プロンプト(全て省略可)
-	  説明	「基本プロンプト X座標プロンプト:」というプロンプトを出し
+	・関数	YaTeX-cplread-with-learning
+	  引数	プロンプト
+		デフォルト補完テーブル変数シンボル
+		ユーザ補完テーブル変数シンボル
+		ローカル補完テーブル変数シンボル
+	  説明	「プロンプト」というプロンプトを出し、補完入力を行います。
+		三つの変数のテーブルの値を結合したものが補完候補として用
+		いられ、新しい単語を入力すると自動的に学習されます。学習
+		結果は ~/.yatexrc か ./.yatexrc に保存されます。使用例と
+		して YaTeX::documentstyle 関数の定義をごらんください。
+
+	・関数	YaTeX:check-comletion-type
+	  引数	'begin または、'section または、'maketitle
+	  説明	付加関数が呼ばれる時に、行われている補完の形式が、引数で与
 		て、X座標を読み込み、「基本プロンプト Y座標プロンプト:」を
 		出して、Y座標を読み込み、(X座標,Y座標) の様な形式を作成します。
 		何も入力せずリターンを押しても、(,)が返されます。
--- a/docs/yatexe.tex	Tue Dec 20 21:00:21 1994 +0000
+++ b/docs/yatexe.tex	Sun Jan 22 14:20:46 1995 +0000
@@ -135,7 +135,7 @@
 @item Blanket commenting out or uncommenting
         (@kbd{C-c >}, @kbd{C-c <}, @kbd{C-c ,}, @kbd{C-c .})
 @item Easy input of accent mark, math-mode's commands and Greek letters
-        (@kbd{C-c a}, @kbd{;}, @kbd{/})
+        (@kbd{C-c a}, @kbd{;}, @kbd{:})
 @item Online help for the popular La@TeX{} commands
       (@kbd{C-c ?}, @kbd{C-c /})(English help is not yet supported)
 @end itemize
@@ -792,7 +792,7 @@
 imitate the  corresponding symbols graphically.  This completion
 only works in the math environment.  YaTeX automatically detects
 whether the  cursor  located  in math environment  or  not,  and
-change the behavior of key strokes @kbd{;} and @kbd{/}.
+change the behavior of key strokes @kbd{;} and @kbd{:}.
 
   By the way, we often express the leftarrow mark by `<-' for example.
 Considering such image, you can write @code{\leftarrow} by typing @kbd{<-}
@@ -842,19 +842,19 @@
 @comment  node-name,  next,  previous,  up
 @section Greek letters completion
 @cindex Greek letters completion
-@cindex /
+@cindex :
 
   Math-mode of YaTeX provides another image completion, Greek letters
-completion in the same method.  After prefix @kbd{/}, typing @kbd{a} makes
+completion in the same method.  After prefix @kbd{:}, typing @kbd{a} makes
 @code{\alpha}, @kbd{b} makes @code{\beta} and @kbd{g} makes @code{\gamma}
 and so on.  First, type @kbd{/TAB} to know all the correspondence of
 alphabets v.s. Greek letters.
 
-  If you will find @kbd{;} or @kbd{/} doesn't work in correct position of
+  If you will find @kbd{;} or @kbd{:} doesn't work in correct position of
 math environment, it may be a bug of YaTeX.  Please send me a bug report
 with the configuration of your text, and avoid it temporarily by typing
-@kbd{;} or @kbd{/} after universal-argument(@kbd{C-u}) which forces
-@kbd{;} and @kbd{/} to work as math-prefix.
+@kbd{;} or @kbd{:} after universal-argument(@kbd{C-u}) which forces
+@kbd{;} and @kbd{:} to work as math-prefix.
 
 @node Local dictionaries, Commenting out, Completion, Top
 @comment  node-name,  next,  previous,  up
@@ -1065,6 +1065,8 @@
 @item Argument of section-type commands
 @item Optional parameters (enclosed by []) of section-type commands
 @item Font/size designators
+@item Math-mode's maketitle-type commands that can be inputted with
+image completion
 @end itemize
 
   Typing @kbd{[prefix] c} on one of above objects you want to change
@@ -1157,11 +1159,11 @@
        >
        > \item bar
        >
-       > When the word `for' is used as an arbitrarily word, `bar' 
-       > is bound to follow it.
+       >       When the word `for' is used as an arbitrarily word, `bar' 
+       >       is bound to follow it.
 @end example
 
-  Note that the indent depth of the @code{\item} and its descriptive
+  Note that the indent depth of an @code{\item} word and its descriptive
 paragraph are the same in latter case.  If you want to use different
 depth, invoke fill-paragraph at the beginning of non-whitespace
 character(see below).
@@ -2031,7 +2033,11 @@
 as a result  of using this  software.   However, any  reports  and
 suggestions are  welcome as  long as I   feel  interests in   this
 software.   My possible  e-mail address is  `yuuji@@ae.keio.ac.jp'.
-(up to Mar.1995 at least)
+(up to Mar.1995 at least)  And there is mailing list for YaTeX.
+Although the common language is Japanese, questions in English will be
+welcome.  To join the ML, send the mail whose subject is `append' to
+the address `yatex-control@@harvest.jaist.ac.jp'.  If you have some
+question, please ask to `yatex-request@@harvest.jaist.ac.jp'.
 
   The specification of this software will be surely modified
 (depending on my feelings) without notice :-p.
--- a/docs/yatexj.tex	Tue Dec 20 21:00:21 1994 +0000
+++ b/docs/yatexj.tex	Sun Jan 22 14:20:46 1995 +0000
@@ -22,6 +22,7 @@
 
 @menu
 * Intro::                       はじめに
+* Termnology::                  マニュアル参照上の注意
 * Main features::               主な機能
 * Installation::                インストール
 * Invocation::                  プロセス起動
@@ -35,6 +36,7 @@
 * Includeonly::                 勝手に includeonly
 * What column::                 カラム位置ガイド
 * Intelligent newline::         おまかせ改行
+* Changing mode of YaTeX::      野鳥動作モード変更
 * Online help::                 LaTeXオンラインヘルプ
 * Cooperation with other packages::  他パッケージとの連携
 * Customizations::              カスタマイズ
@@ -94,7 +96,7 @@
 * Hook file::                   hook用ファイル
 @end menu
 
-@node Intro, Main features, Top, Top
+@node Intro, Termnology, Top, Top
 @comment  node-name,  next,  previous,  up
 @chapter はじめに
 @cindex Demacs
@@ -110,7 +112,45 @@
 
   English manual @xref{Top, , , yatexe,YaTeX English info}
 
-@node Main features, Installation, Intro, Top
+@node Termnology, Main features, Intro, Top
+@comment  node-name,  next,  previous,  up
+@chapter 本マニュアル参照上の注意
+
+  本マニュアルでは以下の表記を用います。
+
+@itemize @bullet
+@item
+begin型コマンド
+
+@code{\begin@{環境@} 〜 \end@{環境@}}という形式のLaTeXコマンドを指します。
+begin型コマンドを補完入力することをbegin型補完と呼びます。
+
+@item
+section型コマンド
+
+@code{\section@{タイトル@}}や@code{\mbox@{内容@}}のように
+引数を取るLaTeXコマンドを指します。
+
+@item
+maketitle型コマンド
+
+@code{\maketitle}や@code{\tableofcontents}のように引数を取らないLaTeXコマ
+ンドを指します。
+
+@item
+large型コマンド
+
+@code{@{\large ...@}} や @code{@{\tt ...@}} のようなフォント/サイズ指定子
+を指します。
+
+@item @kbd{[prefix]}
+
+野鳥の機能を呼び出すためのプリフィクスキー。デフォルトでは@kbd{C-c}に割り
+当てられているので、特に変更していない場合本マニュアルの @kbd{[prefix]} と
+いう表記は、@kbd{C-c} と読み換えてください。
+@end itemize
+
+@node Main features, Installation, Termnology, Top
 @comment  node-name,  next,  previous,  up
 @chapter 主な機能
 
@@ -135,7 +175,7 @@
 @item 一括コメントアウト/アンコメントアウト
         (@kbd{C-c >}, @kbd{C-c <}, @kbd{C-c ,}, @kbd{C-c .})
 @item アクセント記号/数式環境用コマンド/ギリシャ文字の入力支援
-        (@kbd{C-c a}, @code{;}, @code{/})
+        (@kbd{C-c a}, @kbd{;}, @kbd{/})
 @item tabular/array環境のカラム位置ガイド
 @item 標準的 La@TeX{} コマンドのオンラインヘルプ(@kbd{C-c ?}, @kbd{C-c /})
 @end itemize
@@ -148,6 +188,7 @@
 @cindex .emacs
 @cindex auto-mode-alist
 @cindex autoload
+@section 野鳥起動のための設定
 
   ~/.emacsに下の2項目を加えます。
 
@@ -171,6 +212,32 @@
 ロードされます。野鳥が正常に起動できたときはモードラインの表示が「やてふ」
 に変わります。
 
+@section タイプセッタ/プレヴューア環境の設定
+
+  利用する外部プログラムに関する以下の変数を確認し、必要なら正しい値に変更
+します。
+@table @code
+@item tex-command
+        @dots{} 起動するタイプセッタのコマンド名
+@item dvi2-command
+        @dots{} 起動するプレヴューアのコマンド名
+@item NTT-jTeX
+        @dots{} NTT jTeX を使用するなら t
+@item YaTeX-kanji-code
+        @dots{} 文書を作成する時の漢字コード
+@item dviprint-command-format
+        @dots{} ファイルの印刷に使われるコマンド列の書式
+@item makeindex-command
+        @dots{} makeindexコマンド
+@end table
+
+これらを変更する場合は、やはり@file{~/.emacs}にて、たとえば
+@lisp
+(setq tex-command "bigjlatex")
+@end lisp
+のようにしてください。どのような値をセットすれば良いかについては、
+@ref{All customizable variables}を参照してください。
+
 
 @node Invocation, %#notation , Installation, Top
 @comment  node-name,  next,  previous,  up
@@ -182,10 +249,8 @@
 @cindex jlatex
 @cindex プリントアウト[ふりんとあうと]
 
- yatex-mode の prefix キーは、標準状態で @kbd{C-c} (Ctrlキーを押しながらc)
-です。以下、標準のキー割当の場合、@kbd{[prefix]} は @kbd{C-c} と読み換えて
-下さい。まず、次のキー入力により、jlatex などのタイプセットプログラム(以後
-タイプセッタと呼ぶ)、プレヴューアなどの起動ができます。
+LaTeXソースの編集中、次のキー入力により、jlatex などのタイプセットプログラ
+ム(以後タイプセッタと呼ぶ)、プレヴューアなどの起動ができます。
 
 @table @kbd
 @item [prefix] t j
@@ -236,30 +301,36 @@
 ラーの表示されている行にカーソルを合わせスペースキーを押すと La@TeX{} 
 ソースの対応する行にジャンプします。
 
-  なお、領域指定のタイプセットでは、単一ファイルの La@TeX{} ソースの編集時
-にはそのファイルの documentstyle が、別ファイルから include している場合に
-はメインファイルの documentstyle が自動的に選択されます。指定領域は、メイ
-ンファイルのあるディレクトリの@file{texput.tex}という臨時ファイルに出力さ
-れますので、上書きには注意してください。領域の指定方法は@ref{%#記法}の項を
-参照してください。
+@subsection 領域タイプセット
+
+  ポイントとマークの間、あるいはテキスト中に埋め込んだ @code{%#BEGIN} と
+@code{%#END}の間の領域(@ref{%#記法})だけを切り取ってタイプセットすることが
+できます。この場合の documentstyle は、単一ファイルの La@TeX{} ソースの編
+集時にはそのファイルの documentstyle が、別ファイルから include している場
+合にはメインファイルの documentstyle が自動的に選択されます。指定領域は、
+メインファイルのあるディレクトリの@file{texput.tex}という臨時ファイルに出
+力されますので、上書きには注意してください。
 
 @node Print out,  , Calling typesetter, Invocation
 @comment  node-name,  next,  previous,  up
 @section プリントアウト
 
-  プリントアウトする時は、出力開始/終了ページを聞いてきますが、こ
-れを省略したい時は、universal-argument をつけて下さい。
+  @kbd{[prefix] t l}を押してプリントアウトを指示すると、出力開始/終了ペー
+ジを聞いてくるので、それぞれに答えます。これを省略したい時は、
+universal-argument をつけ、
 
 @cindex 出力開始ページ[しゆつりよくかいしへえし]
 @cindex 出力終了ページ[しゆつりよくしゆうりようへえし]
 
-
 @table @kbd
 @item C-u [prefix] t l
         @dots{} ページ確認省略lpr起動
 @end table
 @cindex ページ確認省略lpr起動[へえしかくにんしようりやくlprきとう]
 
+@noindent
+のように起動してください。
+
 @node %#notation , Completion, Invocation, Top
 @comment  node-name,  next,  previous,  up
 @chapter %#記法
@@ -817,7 +888,7 @@
 @end table
 
 @noindent 
-        とすることで、現在開いている環境名で \end{} が補われます。
+とすることで、現在開いている環境名で \end{} が補われます。
 
 @node Accent mark completion, Image completion, end補完, Completion
 @comment  node-name,  next,  previous,  up
@@ -873,7 +944,7 @@
   主に数式モードで使用される、矢印やΣなどの記号を擬似的に表現するキー入力
 で、La@TeX{} コマンドを入力できます。これは野鳥自身の「数式モード」でのみ
 動作します。野鳥はカーソルが@TeX{}の数式環境の中にある時に@kbd{;}や、
-@kbd{/}に特殊な機能を持たせます。
+@kbd{:}に特殊な機能を持たせます。
 
   さて、例えば、←(leftarrow)をASCII文字だけで表現する場合、一般的には「<-」
 のようにしますが、これを利用して、数式記号イメージ入力モードで 
@@ -936,16 +1007,16 @@
 @comment  node-name,  next,  previous,  up
 @section ギリシャ文字補完
 @cindex ギリシャ文字補完[きりしやもしほかん]
-@cindex /
+@cindex :
 
-  もう一つ、数式環境中で@kbd{/}を押すとギリシャ文字入力モードに入ります。
-@kbd{/}を押した直後に@kbd{a}を押すと@code{\alpha}が、@kbd{g} を押すと 
+  もう一つ、数式環境中で@kbd{:}を押すとギリシャ文字入力モードに入ります。
+@kbd{:}を押した直後に@kbd{a}を押すと@code{\alpha}が、@kbd{g} を押すと 
 @code{\gamma}が、などアルファベットに対応したギリシャ文字が挿入されます。
-操作方法は;の数式記号補完とまったく同じです。まずは@kbd{/}の直後に
+操作方法は;の数式記号補完とまったく同じです。まずは@kbd{:}の直後に
 TABを押してどのアルファベットにどのギリシャ文字が対応しているか調べてみて
 ください。
 
-  @kbd{;}と@kbd{/}を数式環境中で押しているにもかかわらず、イメージ補完が働
+  @kbd{;}と@kbd{:}を数式環境中で押しているにもかかわらず、イメージ補完が働
 かない場合は、@kbd{C-u ;}のように universal-argument をつけてキーを押すこ
 とにより、強制的にイメージ補完に入ることができます。また、この時にどのよう
 な状態で数式環境内判定に失敗したかをご連絡下さい。
@@ -985,11 +1056,6 @@
 @noindent 
 として下さい。
 
-@cindex 変な単語[へんなたんこ]
-  もし、綴の間違ったものなど、変な単語が学習されてしまった場合は
-
-
-
 @node Commenting out, Cursor jump, Local dictionary, Top
 @comment  node-name,  next,  previous,  up
 @chapter コメントアウト
@@ -1182,6 +1248,7 @@
 @item section型コマンドの引数
 @item section型コマンドのオプションパラメータ([]で囲まれたもの)
 @item large型コマンド
+@item (イメージ補完で入力可能な)数式モード専用のmaketitle型コマンド
 @end itemize
 
   変えたいsection型コマンドの引数がさらに La@TeX{} コマンドを含む場合は、
@@ -1275,13 +1342,13 @@
 通常インデント:
        > \item へろへろ
        >
-       > 「ほげほげ」をでたらめが単語として使った時に、第2のでたらめな
-       > 単語として「へろへろ」が使われることが多いようです。
+       >       「ほげほげ」をでたらめが単語として使った時に、第2のでたら
+       >       めな単語として「へろへろ」が使われることが多いようです。
 @end example
 
-  上の通常インデントの場合、説明パラグラフのインデントは \item と同じ深さ
-とする必要があります。ただし、@kbd{M-q}を行の最初の非空白文字の位置で押す
-ことにより深さを変えることができます(後述)。
+  上の通常インデントの場合、説明パラグラフのインデントは \item の見出しと
+同じ深さとする必要があります。ただし、@kbd{M-q}を行の最初の非空白文字の位
+置で押すことにより深さを変えることができます(後述)。
 
 @section パラグラフの桁揃え
 @cindex パラグラフの桁揃え[はらくらふのけたそろえ]
@@ -1367,7 +1434,7 @@
 す。もし項目名として別のものを表示して欲しい場合は、行頭を@code{%}にしてダ
 ミーの項目並びを作っておくと良いでしょう。
 
-@node Intelligent newline, Online help, What column, Top
+@node Intelligent newline, Changing mode of YaTeX, What column, Top
 @comment  node-name,  next,  previous,  up
 @chapter おまかせ改行
 @cindex おまかせ改行[おまかせかいぎょう]
@@ -1412,7 +1479,37 @@
 いでしょう。関数 @code{YaTeX-intelligent-newline-itemize} の定義などを参考
 にしてください。
 
-@node Online help, Cooperation with other packages, Intelligent newline, Top
+@node Changing mode of YaTeX, Online help, Intelligent newline, Top
+@comment  node-name,  next,  previous,  up
+@chapter 野鳥の動作モード切り替え
+@cindex モード切り替え[もーときりかえ]
+@cindex prefix w
+
+@table @kbd
+@item [prefix] w
+        @dots{} 野鳥動作モード切り替えメニュー
+@end table
+
+@noindent
+で野鳥自身の動作を決定する以下のモードを切り替えます。
+
+@itemize @bullet
+@item 修正モード
+@item 野鳥数式モード
+@end itemize
+
+修正モードは、開き括弧入力時の処理をコントロールし、修正モードONの時は開き
+括弧の入力は開き括弧のみの入力になり、修正モードOFFの時は開き括弧の入力だ
+けで閉じ括弧まで入力します。デフォルト(起動時)の設定は@emph{OFF}です。
+
+  野鳥数式モードは、変数 @code{YaTeX-auto-math-mode} が @code{nil} の時の
+み有効で、このとき@kbd{;}や@kbd{:}を押した時(@ref{Image completion}参照)に、
+どのようなイメージ補完を機能させるか、通常のキーとして機能させるかを手動で
+切り替えます。自動判定が遅いマシンでは@code{YaTeX-auto-math-mode}
+@code{nil}にセットし、野鳥数式モードを手動で切り替えると良いでしょう。
+
+
+@node Online help, Cooperation with other packages, Changing mode of YaTeX, Top
 @comment  node-name,  next,  previous,  up
 @chapter オンラインヘルプ
 @cindex オンラインヘルプ[おんらいんへるふ]
@@ -1581,6 +1678,10 @@
 (@code{"-t %e"})
 @end defvar
 
+@defvar makeindex-command
+makeindexコマンド(@code{"makeindex"} (MS-DOSでは@code{"makeind"}))
+@end defvar
+
 @defvar section-name
 最初のsection型補完の規定値(@code{"documentstyle"})
 @end defvar
@@ -1777,6 +1878,9 @@
   苦情、希望、バグ報告、感想等は歓迎いたします。
 連絡は yuuji@@ae.keio.ac.jp または、
 pcs39334@@asciinet.or.jp まで(1995年3月現在)。
+継続的に使用してくださる方はメイリングリスト「fj野鳥の会」に
+是非加入してください。加入方法については本パッケージの @file{docs/qanda}
+ファイルの「その他」の章を御覧ください。
 
 仕様は、予告なく確実に(気分次第で)変更されます:-p。
 
--- a/help/YATEXHLP.eng	Tue Dec 20 21:00:21 1994 +0000
+++ b/help/YATEXHLP.eng	Sun Jan 22 14:20:46 1995 +0000
@@ -775,9 +775,10 @@
 \pushtabs それまで用いていたタブストップ位置を全てpush
 \poptabs  それまで用いていたタブストップ位置を全てpop. \pushtabs と 
 	\poptabs は必ず対になっていなければならない. 入れ子可
-\aX	Xは = か ' か `   tabbing環境でない通常のアクセントは
+\aX	
+Xは = か ' か `   tabbing環境でない通常のアクセントは
 	\a= \a' \a` で表わす
-\kill	現在行のテキストは出力せずタブ設定だけ解釈する
+\kill	Without outputting text, parse tabbing definition.
 
 array
 \begin{array}{PREAMBLE} C1 & C2 & .. & Cn \\ D1 ... \end{array}
@@ -856,7 +857,7 @@
 allow this.
 
 tabular*
-\begin{tabular*}{幅}{プリアンブル} ... \end{tabular*}
+\begin{tabular*}{WIDTH}{PREAMBLE} ... \end{tabular*}
 Make tabular environment with specifying its width.
 To fill this width, use \extracolsep{} of preamble as below:
 \begin{tabular*}{10em}[b]{|c@{\extracolsep{\fill}}|c|c|}
--- a/help/YATEXHLP.jp	Tue Dec 20 21:00:21 1994 +0000
+++ b/help/YATEXHLP.jp	Sun Jan 22 14:20:46 1995 +0000
@@ -528,11 +528,13 @@
 
 raggedright
 \raggedright
-段落を右寄せして組版する。
+段落の右端を不揃いにして組版。
+結果として左寄せになる。
 
 raggedleft
 \raggedleft
-段落を左寄せして組版する。
+段落の左端を不揃いにして組版。
+結果として右寄せになる。
 
 raggedbottom
 \raggedbottom
@@ -1205,6 +1207,7 @@
 「雷鳥」の旧仮名遣いは「らいてう」だそうです。
 
 laitex
+a Little Assistant Interface for TeX
 <refer LaiTeX>
 
 YaTeX
@@ -1244,16 +1247,21 @@
 
 桂川直己さん(筑波大)
 	数え切れないバグレポートと要望を頂きました。またVzへの移植版であ
-	る laitex(雷鳥) を作成されました。
+	る laitex(雷鳥) を作成されました。また、「こんな機能はどうだろう?」
+	と相談すると、「いらん」と一蹴し、しばらく経ってから「やっぱり欲
+	しい」と言うなど、多くの混乱を招かせていただきました。
 
-三平善郎さん(慶応大)
+るねきちさん(asciinet)
+	占い師だそうです。
+
+三平善郎さん(慶應大)
 	開き括弧の入力時の処理のモード分けのアイデアを頂きました。
 
-萩庭崇さん(慶応大)
+萩庭崇さん(慶應大)
 	begin型補完の内側に文字があった場合それらをインデントしてほしい
 	という要望を頂きました。
 
-田中健次郎さん(慶応大)
+田中健次郎さん(慶應大)
 	タイプセット時に未セーブ状態の関連ファイルをセーブして欲しいとい
 	う要望を頂きました。
 
@@ -1275,17 +1283,36 @@
 	パラグラフ境界をLaTeX用に設定しなおす要望などを頂きました。
 
 TUSKさん(asciinet)
-	Texinfoドキュメント(初版)を作成して頂きました。
+	Texinfoドキュメント(初版)を作成して頂き、第二版に関するコメント
+	と添削をして頂きました。
 
 横田和也さん(asciinet)
 	dviout起動時の工夫の案、ミニバッファで読み込むもののヒストリを分
-	けるアイデアのきっかけをいただき、ヘルプファイルの項目の提供をし
-	て頂きました。
+	けるアイデアのきっかけを頂き、ヘルプファイルの項目の提供をして頂
+	きました。
+
+Nop.Mさん(asciinet)
+	異なる環境での設定の不具合等のレポートを数多く頂きました。
+
+内山滋さん(成蹊大学)
+	日本語入力モード判定関数のバグを直すパッチ、section-view のバグ
+	報告、* 付きセクションコマンド対応の要望、\right, \left のアドイ
+	ン関数作成に関する有用な情報などを頂きました。
 
-kanbai-anさん(asciinet)
-	日本語入力モード判定関数のバグを直すパッチなどを頂きました。
+神貞介さん(niftyserve)
+	dviout起動オプションに関するコメント、ヘルプファイルのバグ報告等
+	を頂きました。
 
+藤枝和宏さん(JAIST)
+	野鳥/雷鳥の Mailing List を設立して頂きました。
+
+松本憲彦さん(東京学芸大学)
+	マニュアルのバグを指摘して頂きました。
+
+小宮山康子さん(成蹊大学)
+	\item[] などの補完後 [] の中にカーソルを置く要望を頂きました。
 
 yatex
+(setq auto-mode-alist (cons '("\\.tex$" . yatex-mode) auto-mode-alist))
 <refer YaTeX>
 
Binary file yatex.el has changed
--- a/yatex.new	Tue Dec 20 21:00:21 1994 +0000
+++ b/yatex.new	Sun Jan 22 14:20:46 1995 +0000
@@ -1,6 +1,13 @@
 	What's new in YaTeX
 	yatex.el 各バージョンの変更点について
 
+1.56	[prefix] d の YaTeX-display-hierarchy を追加。
+	変数 indent-line-function に YaTeX-indent-line を設定した。
+	YaTeX-generate-simple の修正(1.51から今まで全然動かなかったのに…)。
+	NTT-jTeX を利用する時に文書をインデントしても良いように 
+	auto-fill や fill-paragraph を調整した。
+	maketitle 型コマンドが [] で終わっている時にはカーソルを括弧内に。
+
 1.55	{}の上で [prefix] k した時に直前のコマンドが maketitle 型辞書に
 	属していれば {} のみ(フォント指定子があればそれも)を消すようにした。
 	新単語入力時に、N)one を選ぶと、そのEmacsでのみ有効にするように
--- a/yatex19.el	Tue Dec 20 21:00:21 1994 +0000
+++ b/yatex19.el	Sun Jan 22 14:20:46 1995 +0000
@@ -1,7 +1,7 @@
 ;;; -*- Emacs-Lisp -*-
 ;;; YaTeX facilities for Emacs 19
-;;; (c )1994 by HIROSE Yuuji.[yuuji@ae.keio.ac.jp]
-;;; Last modified Mon Dec 19 02:55:36 1994 on VFR
+;;; (c )1994-1995 by HIROSE Yuuji.[yuuji@ae.keio.ac.jp]
+;;; Last modified Sun Jan 22 23:15:56 1995 on landcruiser
 ;;; $Id$
 
 ;;; とりあえず hilit19 を使っている時に色が付くようにして
@@ -92,6 +92,11 @@
  YaTeX-mode-map [menu-bar yatex]
  '(what "What column in tabular" YaTeX-what-column))
 
+;; Document hierarchy  ------------------------------------------------------
+(YaTeX-19-define-sub-menu
+ YaTeX-mode-map [menu-bar yatex]
+ '(hier "Display document hierarchy" YaTeX-display-hierarchy-directly))
+
 ;; Jump cursor ---------------------------------------------------------------
 (define-key YaTeX-mode-map [menu-bar yatex jump]
   (cons "Jump cursor"
@@ -214,9 +219,9 @@
    '("\\\\\\(re\\)?new\\(environment\\|command\\){" "}" define)
    '("\\\\new\\(length\\|theorem\\|counter\\){" "}" define)
    ;;セクションコマンドが単なるキーワードってことはないでしょう。
-   (list
-    (concat "\\\\\\(" YaTeX-sectioning-regexp "\\){") "}"
-    'sectioning)
+   ;;(list
+    ;;(concat "\\\\\\(" YaTeX-sectioning-regexp "\\){") "}"
+    ;;'sectioning)
    ;;eqnarray などの数式環境が入ってないみたい…
    '("\\\\begin{\\(eqnarray\\*?\\|equation\\*?\\)}"
      "\\\\end{\\(eqnarray\\*?\\|equation\\*?\\)}"
@@ -227,9 +232,54 @@
 (defvar YaTeX-hilit-sectioning-face
   '(yellow/dodgerblue yellow/cornflowerblue)
   "*Hilightening face for sectioning unit.  '(FaceForLight FaceForDark)")
+(defvar YaTeX-sectioning-patterns-alist nil
+  "Hilightening patterns for sectioning units.")
 (defvar YaTeX-hilit-singlecmd-face
   '(slateblue2 aquamarine)
   "*Hilightening face for maketitle type.  '(FaceForLight FaceForDark)")
+
+;;; セクションコマンドを、構造レベルの高さに応じて色の濃度を変える
+;;; 背景が黒でないと何が嬉しいのか分からないに違いない.
+(let*((sectface
+       (car (if (eq hilit-background-mode 'dark) 
+		(cdr YaTeX-hilit-sectioning-face)
+	      YaTeX-hilit-sectioning-face)))
+      (sectcol (symbol-name sectface))
+      sect-pat-alist)
+  (if (string-match "/" sectcol)
+      (let (colorvalue fR fG fB bR bG bB list pat fg bg level from face)
+	(require 'yatexsec)
+	(setq fg (substring sectcol 0 (string-match "/" sectcol))
+	      bg (substring sectcol (1+ (string-match "/" sectcol)))
+	      colorvalue (x-color-values fg)
+	      fR (/ (nth 0 colorvalue) 256)
+	      fG (/ (nth 1 colorvalue) 256)
+	      fB (/ (nth 2 colorvalue) 256)
+	      colorvalue (x-color-values bg)
+	      bR (/ (nth 0 colorvalue) 256)
+	      bG (/ (nth 1 colorvalue) 256)
+	      bB (/ (nth 2 colorvalue) 256)
+	      list YaTeX-sectioning-level)
+	(while list
+	  (setq pat (concat YaTeX-ec-regexp (car (car list)) "\\*?{")
+		level (cdr (car list))
+		fg (format "hex-%02x%02x%02x"
+			   (- fR (/ (* level fR) 40))	;40 musn't be constant
+			   (- fG (/ (* level fG) 40))
+			   (- fB (/ (* level fB) 40)))
+		bg (format "hex-%02x%02x%02x"
+			   (- bR (/ (* level bR) 15))	;20 musn't be constant
+			   (- bG (/ (* level bG) 15))
+			   (- bB (/ (* level bB) 15)))
+		from (intern (format "sectioning-%d" level))
+		face (intern (concat fg "/" bg)))
+	  (hilit-translate from face)
+	  (setq sect-pat-alist
+		(cons (list pat "}" face)
+		      sect-pat-alist))
+	  (setq list (cdr list)))
+	(setq YaTeX-sectioning-patterns-alist sect-pat-alist))))
+
 (defun YaTeX-19-collect-macro ()
   (cond
    ((and (featurep 'hilit19) (fboundp 'hilit-translate))
@@ -246,7 +296,7 @@
 	       ((eq hilit-background-mode 'dark) (car (cdr table)))
 	       (t nil))))))
       (hilit-translate
-       sectioning (funcall get-face YaTeX-hilit-sectioning-face)
+       ;;sectioning (funcall get-face YaTeX-hilit-sectioning-face)
        macro (funcall get-face YaTeX-hilit-singlecmd-face)))
     (setq hilit-patterns-alist		;Remove at first.
 	  (delq 'yatex-mode hilit-patterns-alist)
@@ -254,6 +304,7 @@
 	  (cons
 	   (cons 'yatex-mode
 		 (append
+		  YaTeX-sectioning-patterns-alist
 		  YaTeX-hilit-pattern-adjustment-private
 		  YaTeX-hilit-pattern-adjustment-default
 		  YaTeX-hilit-patterns-alist
--- a/yatexadd.el	Tue Dec 20 21:00:21 1994 +0000
+++ b/yatexadd.el	Sun Jan 22 14:20:46 1995 +0000
@@ -1,8 +1,8 @@
 ;;; -*- Emacs-Lisp -*-
 ;;; YaTeX add-in functions.
-;;; yatexadd.el rev.11
-;;; (c )1991-1994 by HIROSE Yuuji.[yuuji@ae.keio.ac.jp]
-;;; Last modified Mon Dec 19 03:07:01 1994 on landcruiser
+;;; yatexadd.el rev.12
+;;; (c )1991-1995 by HIROSE Yuuji.[yuuji@ae.keio.ac.jp]
+;;; Last modified Sun Jan 22 23:15:48 1995 on landcruiser
 ;;; $Id$
 
 ;;;
@@ -286,6 +286,11 @@
       (concat "[" label "]")))
 )
 
+(defun YaTeX:item () " ")
+(fset 'YaTeX:item\[\] 'YaTeX:item)
+(fset 'YaTeX:subitem 'YaTeX:item)
+(fset 'YaTeX:subsubitem 'YaTeX:item)
+
 ;;;
 ;;Subroutine
 ;;;
--- a/yatexgen.el	Tue Dec 20 21:00:21 1994 +0000
+++ b/yatexgen.el	Sun Jan 22 14:20:46 1995 +0000
@@ -1,8 +1,8 @@
 ;;; -*- Emacs-Lisp -*-
 ;;; YaTeX add-in function generator.
-;;; yatexgen.el rev.4
-;;; (c )1991-1994 by HIROSE Yuuji.[yuuji@ae.keio.ac.jp]
-;;; Last modified Sun Dec 11 05:38:35 1994 on VFR
+;;; yatexgen.el rev.5
+;;; (c )1991-1995 by HIROSE Yuuji.[yuuji@ae.keio.ac.jp]
+;;; Last modified Sun Jan 22 23:15:34 1995 on landcruiser
 ;;; $Id$
 
 (require 'yatex)
@@ -142,6 +142,11 @@
 (defvar YaTeX-generate-message-height
   10 "Window height of YaTeX-generate-message-buffer")
 
+;; Do you need learning for generated function?
+;; If you need, please tell me (yuuji@ae.keio.ac.jp)
+;;(defvar YaTeX-generate-variables-for-learning nil)
+;;(defvar YaTeX-generate-current-completion-table nil)
+
 ;;;
 ;Generate mode.
 ;;;
@@ -437,7 +442,7 @@
 	(insert cand "\n"))
       (kill-buffer buf)))
     ;;(set-buffer cb)
-    (concat cands ")"))
+    (setq YaTeX-generate-current-completion-table (concat cands ")")))
 )
 (defun YaTeX-generate-corresponding-paren (left)
   (cond
@@ -457,19 +462,27 @@
    ")\n")
 )
 (defun YaTeX-generate-create-completing-read (&optional nth)
-  (concat
-   "(completing-read \""
-   (read-string (if nth (format "Prompt for argument#%d: " nth) "Prompt: "))
-   ": \"\n"
-   (format "'%s\n" (YaTeX-generate-read-completion-table))
-   "nil "
-   (format "%s)" (y-or-n-p "Require match? ")))
+  (prog1
+      (concat
+       "(completing-read \""
+       (read-string
+	(if nth (format "Prompt for argument#%d: " nth) "Prompt: "))
+       ": \"\n"
+       (format "'%s\n" (YaTeX-generate-read-completion-table))
+       "nil "
+       (format "%s)" (y-or-n-p "Require match? ")))
+    (if nil ;;;(y-or-n-p "Do you need learning for this completion?")
+	(setq YaTeX-generate-variables-for-learning
+	      (cons
+	       (cons (format "YaTeX-%s-%d" command (or nth 0))
+		     YaTeX-generate-current-completion-table)
+	       YaTeX-generate-variables-for-learning))))
 )
 (defun YaTeX-generate-create-read-file-name (&optional nth)
   (concat
    "(read-file-name \""
    (read-string (if nth (format "Prompt for argument#%d: " nth) "Prompt: "))
-   ": \" "" nil t \"\")\n")
+   ": \" "" \"\" t \"\")\n")
 )
 (defun YaTeX-generate-create-read-oneof (&optional nth readpos)
   (concat
@@ -491,24 +504,23 @@
 	 (cond
 	  ;;Read string
 	  ((eq type 'string)
-	   (concat \"\" (setq leftp (read-string "Left parenthesis: " "{"))
-		   \""\n"
+	   (concat "\"" (setq leftp (read-string "Left parenthesis: " "("))
+		   "\"\n"
 		   (YaTeX-generate-create-read-string)
-		   \"\" (YaTeX-generate-corresponding-paren leftp) \"\"
-		   ))
-	  
+		   "\"" (YaTeX-generate-corresponding-paren leftp) "\"")
+	   )
 	  ;;Completing-read
 	  ((eq type 'completion)
-	   (concat \"\" (setq leftp (read-string "Left parenthesis: " "{"))
-		   \""\n"
+	   (concat "\"" (setq leftp (read-string "Left parenthesis: " "{"))
+		   "\"\n"
 		   (YaTeX-generate-create-completing-read)
-		   \"\" (YaTeX-generate-corresponding-paren leftp) \"\")
+		   "\"" (YaTeX-generate-corresponding-paren leftp) "\"")
 	   )
 	  ((eq type 'file)
-	   (concat \"\" (setq leftp (read-string "Left parenthesis: " "{"))
-		   \""\n"
+	   (concat "\"" (setq leftp (read-string "Left parenthesis: " "("))
+		   "\"\n"
 		   (YaTeX-generate-create-read-file-name)
-		   \"\" (YaTeX-generate-corresponding-paren leftp) \"\")
+		   "\"" (YaTeX-generate-corresponding-paren leftp) "\"")
 	   )
 	  ((eq type 'oneof)
 	   (YaTeX-generate-create-read-oneof nil t)
@@ -521,7 +533,6 @@
 		   "    (concat \"[\" op \"]\")\n"
 		   "  \"\"))\n")
 	   )
-	  
 	  ((eq type 'coord)
 	   (concat "(YaTeX:read-coordinates \""
 		   (read-string "Prompt for coordinates: ")
@@ -576,13 +587,13 @@
 (defun YaTeX-generate-simple (&optional command)
   "Simple but requiring some elisp knowledge add-in generator."
   (interactive)
+  (setq YaTeX-generate-variables-for-learning nil)
   (or command
       (setq command
 	    (completing-read
 	     (format "Making add-in function for (default %s): " section-name)
 	     (append
 	      section-table user-section-table tmp-section-table
-	      article-table user-article-table
 	      env-table     user-env-table     tmp-env-table
 	      singlecmd-table user-singlecmd-table tmp-singlecmd-table)
 	     nil nil)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/yatexhie.el	Sun Jan 22 14:20:46 1995 +0000
@@ -0,0 +1,361 @@
+;;; -*- Emacs-Lisp -*-
+;;; YaTeX hierarchy browser.
+;;; yatexhie.el
+;;; (c )1995 by HIROSE Yuuji [yuuji@ae.keio.ac.jp]
+;;; Last modified Sun Jan 22 23:15:25 1995 on landcruiser
+;;; $Id$
+
+;; ----- Customizable variables -----
+(defvar YaTeX-hierarchy-inspect-mode t
+  "*Non-nil inspects the contents of file of cursor position.")
+
+
+;; ----- General variables -----
+(defvar YaTeX-default-TeX-extensions "\\.\\(tex\\|sty\\)")
+(defvar YaTeX-hierarchy-current-main nil)
+(defvar YaTeX-hierarchy-buffer-message
+  (concat
+   "n)ext p)rev N)extsamelev P)revsamelev u)p K)ill-buffer RET)select"
+   (if (and YaTeX-emacs-19 window-system) " Mouse2)select" "")))
+(defvar YaTeX-hierarchy-saved-wc nil "Saved window configuration.")
+
+;; ----- Functions for parsing hierarchy -----
+
+(defun YaTeX-all-included-files (&optional file)
+  "Return all included files from FILE as a list.
+If FILE is nil, use current buffer."
+  (save-excursion
+    (let ((include-regex (concat YaTeX-ec-regexp
+				 "\\(\\(input\\)\\|"		;match#2
+				 "\\(include\\)\\)\\b"))	;match#3
+	  list file (cb (current-buffer)))
+      (if file (set-buffer (YaTeX-switch-to-buffer file t)))
+      (goto-char (point-min))
+      (while (YaTeX-re-search-active-forward
+	      include-regex YaTeX-comment-prefix nil t)
+	(cond
+	 ((match-beginning 2)		;\input, {} is optional, 1 argument
+	  (skip-chars-forward " {")
+	  (setq file (buffer-substring
+		      (point)
+		      (progn
+			(skip-chars-forward
+			 (concat "^ \t\n\r" YaTeX-ec-regexp "{}"))
+			(point)))))
+	 ((match-beginning 3)
+	  (skip-chars-forward "{")
+	  (setq file (buffer-substring
+		      (point)
+		      (progn
+			(forward-char -1) (forward-list 1) (1- (point)))))))
+	(or (string-match YaTeX-default-TeX-extensions file)
+	    (setq file (concat file ".tex")))
+	(setq list (cons file list)))
+      (set-buffer cb)
+      (nreverse list))))
+
+(defun YaTeX-document-hierarchy (&optional file)
+  "Return the document hierarchy beginning from FILE as a list.
+If FILE is nil, beginning with current buffer's file."
+  (setq file (or file buffer-file-name))
+  (message "Parsing [%s]..." (file-name-nondirectory file))
+  (prog1
+      (save-excursion
+	(if (or (file-exists-p file) (null file))
+	    (progn
+	      (if file
+		  (let ((parent buffer-file-name))
+		    (YaTeX-switch-to-buffer file t)	;set buffer to file
+		    (or YaTeX-parent-file
+			(YaTeX-get-builtin "!")
+			(setq YaTeX-parent-file parent))))
+	      (cons (buffer-file-name (current-buffer))
+		    (mapcar 'YaTeX-document-hierarchy	;return value
+			    (YaTeX-all-included-files))))))
+    (message "Parsing [%s]...done" (file-name-nondirectory file))))
+
+;; ----- Functions for displaying hierarchy -----
+
+(defun YaTeX-hierarchy-get-file-heading (file)
+  "Get a FILE's heading."
+  (save-excursion
+    (set-buffer (find-file-noselect file))
+    (save-excursion
+      (goto-char (point-min))
+      (cond
+       ((and
+	 (YaTeX-re-search-active-forward
+	  (concat YaTeX-ec-regexp YaTeX-sectioning-regexp)
+	  YaTeX-comment-prefix nil t)
+	 (re-search-forward "{\\([^}]+\\)}" nil t))
+	(goto-char (match-beginning 1))
+	(skip-chars-forward " \t\n")
+	(buffer-substring (point)
+			  (min (point-end-of-line)
+			       (match-end 1))))
+       ((re-search-forward "^ *%\\([^#]\\)" nil t)
+	(goto-char (match-beginning 1))
+	(skip-chars-forward " \t")
+	(buffer-substring (point) (point-end-of-line)))
+       (t "")))))
+
+(defun YaTeX-display-a-hierachy (hier level)
+  "Put a HIER of document hierarchy.
+LEVEL is including depth."
+  (message "Formatting hierarchy buffer...")
+  (let ((lastatomcol 0) list i p)
+    (cond
+     ((listp hier)
+      (setq  list hier)
+      (while list
+	(YaTeX-display-a-hierachy (car list) (1+ level))
+	(setq list (cdr list))))
+     ((stringp hier)			;is an atom
+      (insert "  ")
+      (setq i level)
+      (while (> i 2)
+	(insert "|   ")
+	(setq i (1- i)))
+      (if (> level 1) (insert "+---"))
+      (setq p (point))
+      (insert (or (buffer-name (get-file-buffer hier))
+		  (file-name-nondirectory hier)))
+      (if (and window-system YaTeX-emacs-19)
+	  (put-text-property p (point) 'mouse-face 'underline))
+      (insert " ")
+      (indent-to-column (1- (/ (window-width) 2)))
+      (insert "% " (YaTeX-hierarchy-get-file-heading hier))
+      (insert "\n"))))
+  (message "Formatting hierarchy buffer..."))
+
+(defun YaTeX-display-hierarchy (file &optional use-default)
+  "Display document hierarchy that is beginning from FILE."
+  (interactive "P")
+  (setq YaTeX-hierarchy-saved-wc
+	(list (current-window-configuration)
+	      (and (featurep 'windows)
+		   (boundp 'win:current-config)
+		   win:current-config)))
+  (let*((b-in (YaTeX-get-builtin "!"))
+	(default (or YaTeX-parent-file
+		     (and b-in (YaTeX-guess-parent b-in))
+		     buffer-file-name)))
+    ;;$B$`!<$s"-$3$N$X$s$N;EMM$I$&$7$?$i$$$$$+NI$/J,$+$i$s(B...
+    (if default (setq default (expand-file-name default)))
+    (YaTeX-visit-main t)		;move to parent file
+    (setq file
+	  (or (if use-default default file)
+	      (read-file-name
+	       (format
+		"Main .tex file%s: "
+		(if default
+		    (format "(default %s)"(file-name-nondirectory default))
+		  ""))
+	       "" default 1))))
+  (setq file (expand-file-name file))
+  (setq YaTeX-hierarchy-current-main file)
+  (let ((dbuf "*document hierarchy*"))
+    (YaTeX-showup-buffer dbuf nil t)
+    (set-buffer (get-buffer dbuf))
+    (setq truncate-lines t)
+    (let ((buffer-read-only nil))
+      (erase-buffer)
+      (YaTeX-display-a-hierachy (YaTeX-document-hierarchy file) 0))
+    (goto-char (point-min))
+    (YaTeX-hierarchy-next 0)
+    (set-buffer-modified-p nil)
+    (YaTeX-hierarchy-mode)
+    ))
+
+(defun YaTeX-display-hierarchy-directly ()
+  "Same as YaTeX-display-hierarchy.  Call from mouse."
+  (interactive)
+  (YaTeX-display-hierarchy nil t))
+
+(defun YaTeX-hierarchy-mode ()
+  "Major mode to browse and select document hierarchy.
+
+\\[YaTeX-hierarchy-next]	next line
+\\[YaTeX-hierarchy-prev]	previous line
+\\[YaTeX-hierarchy-forward]	move forward in same level
+\\[YaTeX-hierarchy-backward]	move backward in same level
+\\[YaTeX-hierarchy-up-document]	move to parent file
+\\[delete-other-windows]	delete other windows
+\\[other-window]	other window
+\\[YaTeX-hierarchy-show]	show buffer contents in the next window
+\\[YaTeX-hierarchy-select]	select file
+\\[YaTeX-hierarchy-mouse-select]	select
+"
+  (setq major-mode 'YaTeX-hierarchy-mode
+	mode-name "YaTeX hier")
+  (use-local-map YaTeX-hierarchy-mode-map)
+  (setq buffer-read-only t)
+  (message YaTeX-hierarchy-buffer-message))
+
+;; ----- Subfunctions for interactive functions -----
+(defun YaTeX-hierarchy-get-current-file-buffer ()
+  "Return the buffer associated with current line's file."
+  (let ((file (buffer-substring
+	       (point)
+	       (save-excursion
+		 (skip-chars-forward "^ \t" (point-end-of-line)) (point))))
+	(hilit-auto-highlight) buffer)
+    (set-buffer (find-file-noselect YaTeX-hierarchy-current-main))
+    (if (get-buffer file)		;buffer is active
+	(setq buffer (get-buffer file)) ;may contain `<2>'
+      (if (string-match "<[2-9]>$" file)
+	  (setq file (substring file 0 -3)))
+      (save-excursion
+	(setq buffer (YaTeX-switch-to-buffer file t)))))) ; open it!
+
+;; ----- Interactive functions -----
+(defun YaTeX-hierarchy-next (arg &optional quiet)
+  "Move to next line's file in YaTeX document hierarchy buffer."
+  (interactive "p")
+  (forward-line arg)
+  (skip-chars-forward "- +\\|")
+  (if (and (/= arg 0) YaTeX-hierarchy-inspect-mode (not quiet))
+      (YaTeX-hierarchy-select t))
+  (message YaTeX-hierarchy-buffer-message))
+
+(defun YaTeX-hierarchy-prev (arg)
+  "Move to previous line's file in YaTeX document hierarchy buffer."
+  (interactive "p")
+  (YaTeX-hierarchy-next (- arg)))
+
+(defun YaTeX-hierarchy-next-line (arg)
+  (interactive "p")
+  (YaTeX-hierarchy-next arg t))
+
+(defun YaTeX-hierarchy-prev-line (arg)
+  (interactive "p")
+  (YaTeX-hierarchy-next (- arg) t))
+
+(defun YaTeX-hierarchy-forward (arg)
+  "Move to forward file in same hierarchy level."
+  (interactive "p")
+  (YaTeX-hierarchy-next 0)
+  (let ((p (point))(column (current-column)) (i (if (> arg 0) arg (- arg))))
+    (if (= column 0) (error "Not on file line."))
+    (while (> i 0)
+      (if (catch 'found
+	    (while (and (not (eobp)) (not (bobp)))
+	      (forward-line (if (> arg 0) 1 -1))
+	      (move-to-column column)
+	      (if (looking-at "[- +\\|]") nil
+		(YaTeX-hierarchy-next 0)
+		(if (= (current-column) column) (throw 'found t)))
+	      (beginning-of-line)))
+	  nil
+	(goto-char p)
+	(error "No same level file."))
+      (setq i (1- i)))))
+
+(defun YaTeX-hierarchy-backward (arg)
+  "Move to backward file in same hierarchy level."
+  (interactive "p")
+  (YaTeX-hierarchy-forward (- arg)))
+
+(defun YaTeX-hierarchy-up-document ()
+  "Up level, that is, move to parent file position."
+  (interactive)
+  (YaTeX-hierarchy-next 0)		;adjust column
+  (let ((p (point)) (line (count-lines (point-min) (point))) column)
+    (if (or (<= line 1) (< (current-column) 6))
+	(message "No more parent")
+      (backward-char 1)
+      (or (= (char-after (point)) ?-) (error "Unexpected hierarchy buffer"))
+      (setq column (current-column))
+      (while (and (> line 1) (looking-at "[- +\\|]"))
+	(forward-line -1)
+	(move-to-column column))
+      (YaTeX-hierarchy-next 0)
+      (push-mark p t)
+      (message "Mark set to last position"))))
+
+(defun YaTeX-hierarchy-kill-buffer (arg)
+  "Kill buffer associated with current line's file."
+  (interactive "p")
+  (YaTeX-hierarchy-next 0)		;move to file name column
+  (if (bolp) (error "Not on file name line"))
+  (let ((file (buffer-substring (point) (point-end-of-line))))
+    (YaTeX-hierarchy-next arg)
+    (cond
+     ((get-buffer file)
+      (kill-buffer (get-buffer file))
+      (message "Buffer [%s] was killed" file))
+     (t (message "Buffer [%s] is not active." file)))))
+
+(defun YaTeX-hierarchy-select (arg)
+  "Select current line's file in YaTeX document hierarchy buffer.
+If ARG is non-nil, show the buffer in the next window."
+  (interactive "P")
+  (beginning-of-line)
+  (skip-chars-forward "- +\\|")
+  (or (eolp)
+      (let ((buffer (YaTeX-hierarchy-get-current-file-buffer)))
+	(if buffer			;if file was found
+	    (if arg
+		(YaTeX-showup-buffer buffer nil)
+	      (if (and YaTeX-emacs-19 window-system
+		       (get-buffer-window buffer t))
+		  (goto-buffer-window buffer) ;select currently displaying
+		(YaTeX-switch-to-buffer-other-window buffer)))))))
+
+(defun YaTeX-hierarchy-show ()
+  "Show current line's file in the next window."
+  (interactive)
+  (YaTeX-hierarchy-select t))
+
+(defun YaTeX-hierarchy-mouse-select (event)
+  (interactive "e")
+  (mouse-set-point event)
+  (YaTeX-hierarchy-select nil))
+
+(defun YaTeX-hierarchy-quit ()
+  "Quit from YaTeX-hierarchy buffer and restore window configuration."
+  (interactive)
+  (if (or (not (featurep 'windows))
+	  (car YaTeX-hierarchy-saved-wc)
+	  (and (= (car (cdr YaTeX-hierarchy-saved-wc)) win:current-config)))
+      (set-window-configuration (car YaTeX-hierarchy-saved-wc))
+    (bury-buffer nil)))
+
+(defun YaTeX-hierarchy-toggle-inspection (arg)
+  "Toggle inspection mode of YaTeX-hierarchy buffer."
+  (interactive "P")
+  (setq YaTeX-hierarchy-inspect-mode
+	(or arg (not YaTeX-hierarchy-inspect-mode)))
+  (message "YaTeX hierarchy inspection mode %s"
+	   (if YaTeX-hierarchy-inspect-mode "ON" "OFF")))
+
+;; ----- Setting up keymap -----
+(defvar YaTeX-hierarchy-mode-map nil "Keymap used in YaTeX-hierarchy-mode.")
+(if YaTeX-hierarchy-mode-map nil
+  (setq YaTeX-hierarchy-mode-map (make-sparse-keymap))
+  (define-key YaTeX-hierarchy-mode-map "n"	'YaTeX-hierarchy-next)
+  (define-key YaTeX-hierarchy-mode-map "p"	'YaTeX-hierarchy-prev)
+  (define-key YaTeX-hierarchy-mode-map "j"	'YaTeX-hierarchy-next-line)
+  (define-key YaTeX-hierarchy-mode-map "k"	'YaTeX-hierarchy-prev-line)
+  (substitute-all-key-definition
+   'next-line 'YaTeX-hierarchy-next-line YaTeX-hierarchy-mode-map)
+  (substitute-all-key-definition
+   'previous-line 'YaTeX-hierarchy-prev-line YaTeX-hierarchy-mode-map)
+  (define-key YaTeX-hierarchy-mode-map "N"	'YaTeX-hierarchy-forward)
+  (define-key YaTeX-hierarchy-mode-map "P"	'YaTeX-hierarchy-backward)
+  (define-key YaTeX-hierarchy-mode-map "u"	'YaTeX-hierarchy-up-document)
+  (define-key YaTeX-hierarchy-mode-map "K"	'YaTeX-hierarchy-kill-buffer)
+  (define-key YaTeX-hierarchy-mode-map "1"	'delete-other-windows)
+  (define-key YaTeX-hierarchy-mode-map "o"	'other-window)
+  (define-key YaTeX-hierarchy-mode-map "."	'YaTeX-hierarchy-show)
+  (define-key YaTeX-hierarchy-mode-map "\C-m"	'YaTeX-hierarchy-select)
+  (define-key YaTeX-hierarchy-mode-map ";" 'YaTeX-hierarchy-toggle-inspection)
+  (define-key YaTeX-hierarchy-mode-map "q"	'YaTeX-hierarchy-quit)
+  (define-key YaTeX-hierarchy-mode-map "?"	'describe-mode)
+  (if (and YaTeX-emacs-19 window-system)
+      (define-key YaTeX-hierarchy-mode-map
+	[mouse-2] 'YaTeX-hierarchy-mouse-select))
+  )
+
+(provide 'yatexhie)
+;;end of yatexhie.el
--- a/yatexlib.el	Tue Dec 20 21:00:21 1994 +0000
+++ b/yatexlib.el	Sun Jan 22 14:20:46 1995 +0000
@@ -1,8 +1,8 @@
 ;;; -*- Emacs-Lisp -*-
 ;;; YaTeX library of general functions.
 ;;; yatexlib.el
-;;; (c )1994 by HIROSE Yuuji.[yuuji@ae.keio.ac.jp]
-;;; Last modified Wed Dec 21 05:58:06 1994 on landcruiser
+;;; (c )1994-1995 by HIROSE Yuuji.[yuuji@ae.keio.ac.jp]
+;;; Last modified Sun Jan 22 23:15:03 1995 on landcruiser
 ;;; $Id$
 
 ;;;###autoload
@@ -46,17 +46,19 @@
   "Switch to buffer if buffer exists, find file if not.
 Optional second arg SETBUF t make use set-buffer instead of switch-to-buffer."
   (interactive "Fswitch to file: ")
-  (let (buf)
-    (if (setq buf (get-file-buffer file))
-	(progn
-	  (funcall (if setbuf 'set-buffer 'switch-to-buffer)
-		   (get-file-buffer file))
-	  buf)
-      (if (file-exists-p file)
-	  (or ;find-file returns nil but set current-buffer...
-	   (funcall (if setbuf 'find-file-noselect 'find-file) file)
-	   (current-buffer))
-	(message "%s was not found in this directory." file)
+  (if (bufferp file) (setq file (buffer-file-name file)))
+  (let (buf (hilit-auto-highlight (not setbuf)))
+    (cond
+     ((setq buf (get-file-buffer file))
+      (funcall (if setbuf 'set-buffer 'switch-to-buffer)
+	       (get-file-buffer file))
+      buf)
+     ((or YaTeX-create-file-prefix-g (file-exists-p file))
+      (or ;find-file returns nil but set current-buffer...
+       (if setbuf (set-buffer (find-file-noselect file))
+	 (find-file file))
+       (current-buffer)))
+     (t (message "%s was not found in this directory." file)
 	nil)))
 )
 
@@ -64,11 +66,14 @@
 (defun YaTeX-switch-to-buffer-other-window (file)
   "Switch to buffer if buffer exists, find file if not."
   (interactive "Fswitch to file: ")
-  (if (get-file-buffer file)
-      (progn (switch-to-buffer-other-window (get-file-buffer file)) t)
-    (if (file-exists-p file)
-	(progn (find-file-other-window file) t)
-      (message "%s was not found in this directory." file)
+  (if (bufferp file) (setq file (buffer-file-name file)))
+  (cond
+   ((get-file-buffer file)
+    (switch-to-buffer-other-window (get-file-buffer file))
+    t)
+   ((or YaTeX-create-file-prefix-g (file-exists-p file))
+    (find-file-other-window file) t)
+   (t (message "%s was not found in this directory." file)
       nil))
 )
 
@@ -293,6 +298,7 @@
 (defun goto-buffer-window (buffer)
   "Select window which is bound to BUFFER.
 If no such window exist, switch to buffer BUFFER."
+  (interactive "BGoto buffer: ")
   (if (stringp buffer)
       (setq buffer (or (get-file-buffer buffer) (get-buffer buffer))))
   (if (get-buffer buffer)
--- a/yatexmth.el	Tue Dec 20 21:00:21 1994 +0000
+++ b/yatexmth.el	Sun Jan 22 14:20:46 1995 +0000
@@ -1,14 +1,14 @@
 ;;; -*- Emacs-Lisp -*-
 ;;; YaTeX math-mode-specific functions.
-;;; yatexmth.el rev.2
-;;; (c )1993-1994 by HIROSE Yuuji [yuuji@ae.keio.ac.jp]
-;;; Last modified Fri Dec  2 17:03:30 1994 on VFR
+;;; yatexmth.el rev.3
+;;; (c )1993-1995 by HIROSE Yuuji [yuuji@ae.keio.ac.jp]
+;;; Last modified Sun Jan 22 23:14:51 1995 on landcruiser
 ;;; $Id$
 
 ;;; [Customization guide]
 ;;;
 ;;;	  By default,  you can use two  completion  groups in YaTeX math
-;;;	mode, `;' for mathematical signs and `/' for greek letters.  But
+;;;	mode, `;' for mathematical signs and `:' for greek letters.  But
 ;;;	you  can add other completion groups   by defining the  alist of
 ;;;	`prefix  key'    vs   `completion   list'    into  the  variable
 ;;;	YaTeX-math-key-list-private.  If  you wish  to    accomplish the
@@ -50,7 +50,7 @@
 
 ;;; 【イメージ補完の追加方法】
 ;;;
-;;;	  標準のイメージ補完では、「;」で始まる数式記号補完と、「/」で始
+;;;	  標準のイメージ補完では、「;」で始まる数式記号補完と、「:」で始
 ;;;	まるギリシャ文字補完が使用可能ですが、これ以外の文字で始まる補完
 ;;;	シリーズも定義することができます。例えば、「,」で始まる次のよう
 ;;;	な補完シリーズを定義する場合を考えてみます。
@@ -108,7 +108,7 @@
 (YaTeX-setq-math-sym YaTeX-image-flat		"b"		"♭")
 (YaTeX-setq-math-sym YaTeX-image-sqrt		""		"√")
 
-(setq
+(defvar
  YaTeX-math-sign-alist-default
  '(
    ;frequently used
@@ -258,15 +258,15 @@
    ("D"		"diamondsuit"	"/\\\n\\/")
    ("H"		"heartsuit"	"<^^>\n \\/")
    ("S"		"spadesuit"	" /\\\n<++>\n /\\")
-
-   ))
+   )
+ "Default LaTeX-math-command alist.")
 
 (defvar YaTeX-math-sign-alist-private nil
   "*User definable key vs LaTeX-math-command alist.")
 
 (defvar YaTeX-math-quit-with-strict-match nil
   "*T for quitting completion as soon as strict-match is found.")
-(setq YaTeX-math-sign-alist
+(defvar YaTeX-math-sign-alist
       (append YaTeX-math-sign-alist-private YaTeX-math-sign-alist-default))
 
 ;;(defun YaTeX-math-alist2array (alist array)
@@ -278,7 +278,7 @@
 ;;	 array))
 ;;)
 
-(setq YaTeX-greek-key-alist-default
+(defvar YaTeX-greek-key-alist-default
   '(
     ("a"	"alpha"		("a" "α"))
     ("b"	"beta"		("|>\n|>\n|" "β"))
@@ -326,19 +326,18 @@
     ("W"	"Omega"		("(~)\n~ ~" "Ω"))
     ("f" "foo")
     )
-)
+  "Default LaTeX-math-command alist.")
 
 (defvar YaTeX-greek-key-alist-private nil
   "*User definable key vs LaTeX-math-command alist.")
 
-(setq YaTeX-greek-key-alist
+(defvar YaTeX-greek-key-alist
       (append YaTeX-greek-key-alist-private YaTeX-greek-key-alist-default))
 
 ;;(mapcar (function (lambda (x) (YaTeX-math-alist2array x)))
 ;;	YaTeX-math-key-list)
 
-(setq YaTeX-math-indicator
-  "KEY\tLaTeX sequence\t\tsign")
+(defvar YaTeX-math-indicator "KEY\tLaTeX sequence\t\tsign")
 
 (defvar YaTeX-math-need-image t
   "*T for displaying pseudo image momentarily.")
@@ -585,14 +584,15 @@
 	  (setq buffer-file-name name)
 	  (set-buffer-modified-p modified)))))
 
-(defun YaTeX-math-insert-sequence (&optional force)
+(defun YaTeX-math-insert-sequence (&optional force initial)
   "Insert math-mode sequence with image completion."
   (interactive "P")
-  (let*((key "") regkey str  last-char list i
+  (let*((key (or initial "")) regkey str  last-char list i
 	(case-fold-search nil) match sign
 	(this-key (char-to-string last-command-char))
 	(alist (symbol-value (cdr (assoc this-key YaTeX-math-key-list))))
 	(n (length alist)) (beg (point)) result)
+    (if initial (insert YaTeX-ec (car (cdr (assoc initial alist)))))
     (setq result
 	  (catch 'complete
 	    (if (and (not force)
@@ -669,7 +669,7 @@
       (message "Abort."))
      ((eq result 'escape)
       (delete-region beg (point))
-      (insert this-key))
+      (call-interactively (global-key-binding this-key)))
      ((eq result 'select)
       (message "Done."))
      ((eq result 'exit)
@@ -680,6 +680,21 @@
       (setq key (concat "^" (regexp-quote (substring key 0 -1))))
       (insert (YaTeX-math-show-menu key)))))
 )
+
+;; ----- Change image completion types -----
+(defun YaTeX-math-member-p (item)
+  "Check if ITEM is a member of image completion.
+If so return the cons of its invocation key and image-string."
+  (let ((lists YaTeX-math-key-list) list)
+    (catch 'found
+      (while lists
+	(setq list (symbol-value (cdr (car lists))))
+	(while list
+	  (if (string= item (nth 1 (car list)))
+	      (throw 'found (cons (car (car lists)) (nth 0 (car list)))))
+	  (setq list (cdr list)))
+	(setq lists (cdr lists))))))
+
 ;;
 (provide 'yatexmth)
 
--- a/yatexprc.el	Tue Dec 20 21:00:21 1994 +0000
+++ b/yatexprc.el	Sun Jan 22 14:20:46 1995 +0000
@@ -1,8 +1,8 @@
 ;;; -*- Emacs-Lisp -*-
 ;;; YaTeX process handler.
 ;;; yatexprc.el
-;;; (c )1993-1994 by HIROSE Yuuji.[yuuji@ae.keio.ac.jp]
-;;; Last modified Wed Dec 14 16:58:15 1994 on 98fa
+;;; (c )1993-1995 by HIROSE Yuuji.[yuuji@ae.keio.ac.jp]
+;;; Last modified Sun Jan 22 23:14:44 1995 on landcruiser
 ;;; $Id$
 
 (require 'yatex)
@@ -142,8 +142,8 @@
 )
 
 (defun YaTeX-typeset-region ()
-  "Paste the region to the file `texput.tex' and execute jlatex (or other)
-to LaTeX typeset.  The region is specified by the rule:
+  "Paste the region to the file `texput.tex' and execute typesetter.
+The region is specified by the rule:
 	(1)If keyword `%#BEGIN' is found in the upper direction from (point).
 	  (1-1)if the keyword `%#END' is found after `%#BEGIN',
 		->Assume the text between `%#BEGIN' and `%#END' as region.
@@ -161,7 +161,7 @@
 	 (cmd (concat (YaTeX-get-latex-command nil) " " texput))
 	 (buffer (current-buffer)) opoint preamble (subpreamble "") main
 	 (hilit-auto-highlight nil)	;for Emacs19 with hilit19
-	 reg-begin reg-end)
+	 reg-begin reg-end lineinfo)
 
       (save-excursion
 	(if (search-backward "%#BEGIN" nil t)
@@ -173,8 +173,10 @@
 		  (setq reg-end (match-beginning 0)
 			end "END ---")
 		(setq reg-end (point-max))))
-	  (setq typeout "=== Region from (point) to (mark) ===")
-	  (setq reg-begin (point) reg-end (mark)))
+	  (setq typeout "=== Region from (point) to (mark) ==="
+		reg-begin (point) reg-end (mark)))
+	(goto-char (min reg-begin reg-end))
+	(setq lineinfo (count-lines (point-min) (point-end-of-line)))
 	(goto-char (point-min))
 	(while (search-forward "%#REQUIRE" nil t)
 	  (setq subpreamble
@@ -201,12 +203,14 @@
 		 "\\begin{document}")))
       (goto-char opoint)
       ;;(set-buffer buffer)		;for clarity
-      (set-buffer (find-file-noselect texput))
+      (let ((hilit-auto-highlight nil))
+	(set-buffer (find-file-noselect texput)))
       ;;(find-file YaTeX-texput-file)
       (erase-buffer)
       (if YaTeX-need-nonstop
 	  (insert "\\nonstopmode{}\n"))
       (insert preamble "\n" subpreamble "\n")
+      (setq lineinfo (list (count-lines 1 (point-end-of-line)) lineinfo))
       (insert-buffer-substring buffer reg-begin reg-end)
       (insert "\\typeout{" typeout end "}\n") ;Notice the selected method.
       (insert "\n\\end{document}\n")
@@ -215,7 +219,10 @@
       (set-buffer main)		;return to parent file or itself.
       (YaTeX-typeset cmd YaTeX-typeset-buffer)
       (switch-to-buffer buffer)		;for Emacs-19
-      (put 'dvi2-command 'region t)))
+      (put 'dvi2-command 'region t)
+      (put 'dvi2-command 'file buffer)
+      (put 'dvi2-command 'offset lineinfo)
+      ))
 )
 
 (defun YaTeX-typeset-buffer ()
@@ -379,6 +386,17 @@
 		 " to preview " preview-file))))))
 )
 
+(defun YaTeX-set-virtual-error-position (file-sym line-sym)
+  "Replace the value of FILE-SYM, LINE-SYM by virtual error position."
+  (cond
+   ((and (get 'dvi2-command 'region)
+	 (> (symbol-value line-sym) (car (get 'dvi2-command 'offset))))
+    (set file-sym (get 'dvi2-command 'file))
+    (set line-sym
+	 (+ (- (apply '- (get 'dvi2-command 'offset)))
+	    (symbol-value line-sym)
+	    -1)))))
+
 (defun YaTeX-prev-error ()
   "Visit previous typeset error.
   To avoid making confliction of line numbers by editing, jump to
@@ -404,10 +422,11 @@
 	   (buffer-substring
 	    (point)
 	    (progn (skip-chars-forward "0-9" (match-end 0)) (point))))
-	  error-buffer (YaTeX-get-error-file cur-buf)
-	  error-win (get-buffer-window error-buffer))
+	  error-buffer (YaTeX-get-error-file cur-buf))
     (if (or (null error-line) (equal 0 error-line))
 	(error "Can't detect error position."))
+    (YaTeX-set-virtual-error-position 'error-buffer 'error-line)
+    (setq error-win (get-buffer-window error-buffer))
     (select-window cur-win)
     (cond
      (error-win (select-window error-win))
@@ -442,12 +461,13 @@
       (goto-char (match-beginning 0))
       (setq error-line (string-to-int
 			(buffer-substring (match-beginning 1) (match-end 1)))
-	    error-file (YaTeX-get-error-file YaTeX-current-TeX-buffer)
-	    error-buf (YaTeX-switch-to-buffer error-file t))
+	    error-file (YaTeX-get-error-file YaTeX-current-TeX-buffer))
+      (YaTeX-set-virtual-error-position 'error-file 'error-line)
+      (setq error-buf (YaTeX-switch-to-buffer error-file t)))
       (if (null error-buf)
 	  (error "`%s' is not found in this directory." error-file))
       (YaTeX-showup-buffer error-buf nil t)
-      (goto-line error-line)))
+      (goto-line error-line))
 )
 
 (defun YaTeX-send-string ()
@@ -585,7 +605,7 @@
 page range description."
   (interactive "P")
   (let*((cmd (or (YaTeX-get-builtin "LPR") dviprint-command-format))
-	from to (lbuffer "*dvi-printing*"))
+	from to (lbuffer "*dvi-printing*") dir)
     (setq
      cmd 
      (YaTeX-replace-format
@@ -616,10 +636,12 @@
 	   'YaTeX-lpr-command-history))
     (save-excursion
       (YaTeX-visit-main t) ;;change execution directory
+      (setq dir default-directory)
       (YaTeX-showup-buffer
        lbuffer (function (lambda (x) (nth 3 (window-edges x)))))
       (set-buffer (get-buffer-create lbuffer))
       (erase-buffer)
+      (cd dir)				;for 19
       (cond
        (YaTeX-dos
 	(call-process shell-file-name "con" "*dvi-printing*" nil
@@ -636,6 +658,8 @@
 (defun YaTeX-main-file-p ()
   "Return if current buffer is main LaTeX source."
   (cond
+   (YaTeX-parent-file
+    (eq (get-file-buffer YaTeX-parent-file) (current-buffer)))
    ((YaTeX-get-builtin "!")
     (string-match (YaTeX-guess-parent (YaTeX-get-builtin "!")) (buffer-name)))
    (t

yatex.org