changeset 69:807c1e7e68b7

yahtml-escape-chars-region Translate <>"& to entity reference. And inverse translation to above. yahtml-translate-hyphens-when-comment-region yahtml-prefer-upcase-attributes Inquire .htaccess file to determine the file-coding-system. Completions for StyleSheet. ---yahtml--- Auto insert of \), \|, \] after corresponding \(, \| \]. [prefix] c for \right\left parens.
author yuuji
date Thu, 15 Jul 1999 04:58:26 +0000
parents 0eb6997bee16
children 44e3a5e1e883
files docs/htmlqa docs/qanda.eng docs/yahtmlj.tex docs/yatex.ref docs/yatexadd.doc docs/yatexe.tex docs/yatexgen.doc docs/yatexj.tex docs/yatexref.eng help/YATEXHLP.jp yahtml.el yatex.el yatex.new yatex19.el yatexadd.el yatexlib.el yatexmth.el yatexprc.el
diffstat 18 files changed, 1725 insertions(+), 632 deletions(-) [+]
line wrap: on
line diff
--- a/docs/htmlqa	Mon Oct 26 12:05:32 1998 +0000
+++ b/docs/htmlqa	Thu Jul 15 04:58:26 1999 +0000
@@ -8,22 +8,36 @@
 ■インストール関連
 ・LaTeX使わないんだけど野鳥も入れなきゃダメですか?
 	
-	そうなにょ。野鳥のライブラリ関数を使っているので野鳥も棲まわせて
-	やって下さいまし。
+	や、別にええっす。
+	ftp://ftp.ae.keio.ac.jp/pub/emacs-lisp/text/yatex/
+	のなかに、"yahtml" で始まるファイルがあるので次からはそれを持っ
+	て来ればよござんす。
 	
 ■カスタマイズ関連
 ・いつもは EUC にしてたまに JIS コードのファイルを作りたいんだけど。
 	
 	~/.emacs で
 	(setq yahtml-kanji-code 3) ;3はEUC
-	しておけば普段のhtmlコードはEUCになります。JISにしたいときは、
-	htmlソースのお尻に、
+	しておけば普段のhtmlコードはEUCになります。で局所的に変える方法。
+	サーバーはApacheですね? ならそのディレクトリに .htaccess という
+	ファイルを用意して、
+	
+		AddType "text/html; charset=iso-2020-jp" .html
+	
+	という行を書きましょう。するとApache君はそのディレクトリのhtmlファ
+	イルを「iso-2022-jp(いわゆるJIS)だよー」とお客さんにあらかじめ伝
+	えるようになります。yahtmlもこれに従い、そのディレクトリ以下のファ
+	イルは漢字コードをJISに設定します。
+	
+	なに、apacheではないとな。なら明示的にhtmlソースのお尻に、
 	
 	<!-- Local Variables: -->
 	<!-- file-coding-system: *junet* -->
 	<!-- End: -->
 	
 	と書いておけばそのファイルだけJISになります。
+	ただし、Emacs-20 や XEmacs の場合、漢字コードのシンボルの両端の*
+	は付きません。
 	
 ■どうにかならんかなあ関連
 ・長い文書の下の方だとインデントがめちゃ遅いんだけど。
@@ -73,7 +87,7 @@
 ・yahtmlの最新情報は?
 	
 	もしあなたが、WWWにアクセスできるなら、
-	http://www.comp.ae.keio.ac.jp/~yuuji/yatex/
+	http://www.yatex.org/
 	を覗いてみて下さい。このなかの、「yatex-current」というリンクを
 	たどると最新版の野鳥を入手することができます。ただし、正式リリー
 	ス版ではなく、作者がデバッグ中だったりして正常に動作しない可能性
@@ -86,7 +100,7 @@
 
 	・近くにいる詳しい人に聞く
 	・メイリングリストに質問を出す
-	・yuuji@ae.keio.ac.jp に質問を出す
+	・yuuji@gentei.org に質問を出す
 	
 	でしょうか。お好きな方法でどうぞ。
 	
--- a/docs/qanda.eng	Mon Oct 26 12:05:32 1998 +0000
+++ b/docs/qanda.eng	Thu Jul 15 04:58:26 1999 +0000
@@ -212,6 +212,17 @@
 	commands in a suitable sequence.  You can find `latexmk' script
 	in a directory of supports/latexmk in some CTAN ftp directory.
 	
+*Can I inhibit auto-filling against very long <a href="..."> line?
+	
+	If you use Emacs-19 or later, Yes.  The variable
+	auto-fill-inhibit-regexp controls the filling behaviour.  To set
+	this, use yatex-mode-hook as below.
+	
+	(add-hook 'yahtml-mode-hook
+	          '(lambda ()
+		     (setq auto-fill-inhibit-regexp
+			   "^[       ]*\\(<a href\\|<img src=\\)")))
+	
 *Filling a paragraph doesn't work as I expected.	
 	
 	It is because the indentation  depth  is different from  default
@@ -339,15 +350,18 @@
 =====
 *Mailing lists?
 	
-	A  question, so an  answer.  The  mailing  list for YaTeX  (Wild
-	Bird)   and it's implementation  to  Vz, Raicho (by KATSURAGAWA,
-	Naoki;  katsura@prc.tsukuba.ac.jp) is  "fj  Wild  Bird Society".
-	Send a mail like
+	A  question, so  an answer.   The mailing  list for  YaTeX (Wild
+	Bird)  and it's  implementation to  Vz; Raicho  (by KATSURAGAWA,
+	Naoki; katsura@prc.tsukuba.ac.jp),  implementation to Wz Editor;
+	HackTeX  (by TAKKENAKA,  Hiroshi),  implementation to  Hidemaru;
+	HiTeX (by YASUDA,  Haruyuki) is "fj Wild Bird  Society".  Send a
+	mail like
 	
-		To: yatex-control@jaist.ac.jp
+		To: yatex@jaist.ac.jp
 		Subject: append
 		-----
-		Hi!  My name is yuuji.  See any birds fly by?
+		Hi!  My name is yuuji.
+		See any birds fly by?
 	
 	and you're in.  The text will be used as  your profile. (you can
 	change it later) Once  you're in, you'll get  a reply with lists
@@ -359,7 +373,7 @@
 *How to get the up-to-date information on YaTeX?
 	
 	If you can access WWW, try to see;
-	http://www.comp.ae.keio.ac.jp/~yuuji/yatex/
+	http://www.yatex.org/
 	And if  you trace the link  of `yatex-current', you  can get the
 	really latest version of YaTeX.  Since it collects the elisps in
 	the author's source directory, what  you'll get may contain some
@@ -372,7 +386,7 @@
 
 	*Look for someone near you who knows what's he/she's doing.
 	*Post a question to the mailing list.
-	*Send mail to yuuji@ae.keio.ac.jp
+	*Send mail to yuuji@gentei.org
 	
 	take a pick.
 	
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/docs/yahtmlj.tex	Thu Jul 15 04:58:26 1999 +0000
@@ -0,0 +1,446 @@
+\def\lang{jp} % -*- texinfo -*- for Texinfo V.3.1 
+\input texinfo
+@setfilename yahtmlj
+@settitle Yet Another html-mode for Emacs
+
+@iftex
+@c @syncodeindex fn cp
+@c Infoって最近読む人が増えたらしい
+@c まだ書き終わっていません。
+@syncodeindex vr cp
+@end iftex
+
+@titlepage
+@sp 10
+@center
+@subtitle Yet Another html-mode for emacs
+@title 『HTML屋』
+@subtitle // yahtml //
+@author @copyright{} 1994-1997 by    HIROSE, Yuuji [yuuji@@gentei.org]
+@end titlepage
+
+@node Top, Intro, (dir), (dir)
+@comment  node-name,  next,  previous,  up
+
+@menu
+* Intro::                       はじめに
+* Installation::                インストール
+* Command Invocation::          外部コマンド起動
+* Completion::                  補完入力
+* Jump::                        カーソルジャンプ
+* Changing and Deleting::       変更と削除
+* Customizations::              カスタマイズ変数一覧
+* Copying::                     とりあつかい
+* Concept Index::               索引
+
+@end menu
+
+@node Intro, Installation, Top, Top
+@comment  node-name,  next,  previous,  up
+@chapter はじめに
+@cindex Demacs
+@cindex Mule
+@cindex LaTeX
+@cindex HTML屋[HTMLや]
+
+yahtmlは GNU Emacs 上で HTML文書を作成する時に、繁雑なHTMLタグの入力を補
+完機能によってスムーズに行えるようにするだけでなく、weblintなどの構文チェッ
+クプログラム、カーソル位置のURLやファイル名に依存したブラウザ/イメージヴュー
+アの起動などを Emacs 編集画面中から
+行えるようにするパッケージです。
+
+(このInfoは未完成です(__)…)
+
+@node Installation, Command Invocation, Intro, Top
+@comment  node-name,  next,  previous,  up
+@chapter インストール
+@menu
+* yahtml起動のための設定::      
+* lintプログラム/ブラウザ/イメージヴューア環境等の設定::  
+* WWWページ環境用変数の設定::   
+@end menu
+
+@node yahtml起動のための設定, lintプログラム/ブラウザ/イメージヴューア環境等の設定, Installation, Installation
+@section yahtml起動のための設定
+
+
+@file{~/.emacs}に下の2項目を加えます。
+
+@lisp
+(setq auto-mode-alist
+      (cons (cons "\\.html$" 'yahtml-mode) auto-mode-alist))
+(autoload 'yahtml-mode "yahtml" "Yet Another HTML mode" t)
+@end lisp
+
+次にyahtmlに必要なファイル(@file{yahtml.el}, @file{yatexlib.el},
+@file{yatexprc.el}) を置くディレクトリを load-path に加えます。たとえば、 
+@file{~/src/emacs/yahtml}に置くのであれば、
+
+@lisp
+(setq load-path (cons (expand-file-name "~/src/emacs/yahtml") load-path))
+@end lisp
+
+@noindent 
+などとします。
+
+  以上の設定により、拡張子が .html であるファイルを編集すると自動的に
+yahtml がロードされます。yahtmlが正常に起動できたときはモードラインの表示が
+「yahtml」に変わります。
+
+@node lintプログラム/ブラウザ/イメージヴューア環境等の設定, WWWページ環境用変数の設定, yahtml起動のための設定, Installation
+@section lintプログラム/ブラウザ/イメージヴューア環境等の設定
+
+利用する外部プログラムなどに関する以下の変数を確認し、必要なら正しい値に変
+更します(括弧内はデフォルト値)。
+@table @code
+@item yahtml-www-browser
+        @dots{} 起動するブラウザのコマンド名(netscape)
+@item yahtml-image-viewer
+        @dots{} 起動する画像ビューアのコマンド名(xv)
+@item yahtml-lint-program
+        @dots{} 構文チェックプログラムのコマンド名(jweblint)
+@item yahtml-kanji-code
+        @dots{} htmlファイルの漢字コード
+@end table
+
+@node WWWページ環境用変数の設定,  , lintプログラム/ブラウザ/イメージヴューア環境等の設定, Installation
+@section WWWページ環境用変数の設定
+
+ホームページとなるファイルが存在するPATH名に関する変数を設定します。
+@table @code
+@item yahtml-path-url-alist
+        @dots{} ファイルシステム上のPATH名と、URLの対応表
+@item yahtml-directory-index
+        @dots{} URL指定でファイル名を省略したときに表示されるインデックス
+                ファイル名(NCSA系httpdなら @file{index.html}, CERN系なら
+                @file{Welcome.html}が一般的)
+@end table
+
+変数 @code{yahtml-path-url-alist} の設定例を示します。例えば、自宅では、
+@file{/home/yuuji/http/} が @code{http://localhost/~yuuji} で参照でき、職
+場では @file{/usr/home/yuuji/www/} が@code{http://www.keio.ac.jp/~yuuji/} 
+で参照できるようになっている場合は以下のように設定します。
+
+@lisp
+(setq yahtml-path-url-alist
+      '(("/home/yuuj/http" . "http://localhost/~yuuji")
+        ("/usr/home/yuuj/www" . "http://www.keio.ac.jp/~yuuji")))
+@end lisp
+
+この対応組はいくらでも設定することができます。
+
+@node Command Invocation, Completion, Installation, Top
+@comment  node-name,  next,  previous,  up
+@chapter 外部コマンド起動
+
+HTMLファイル編集にかかわるいくつかのコマンドを即座に呼ぶことができます。
+@table @kbd
+@item [prefix] t j
+        @dots{} HTML構文チェッカ(jweblint)起動
+@item [prefix] t p
+        @dots{} 現在のページを対象としたブラウザ起動
+@item [prefix] t r
+        @dots{} 現在のページがブラウザに表示されているときのreload指定
+@end table
+
+@node Completion, Jump, Command Invocation, Top
+@comment  node-name,  next,  previous,  up
+@chapter 補完入力
+
+「野鳥」で利用できる、「begin型補完」、「section型補完」、
+「large型補完」、「maketitle型補完」、「アクセント補完」
+と全く同じキー操作で対応する
+HTMLタグの補完入力ができます。それぞれの型の補完は順に、
+「複数行に渡るタグ入力」、「空要素タグ(imgなど)の補完」、
+「一行内での開始/終了タグの入力」、「空要素空属性タグの入力」、
+「文字参照入力」
+に
+対応しています。具体的には
+
+@table @kbd
+@item [prefix] b (野鳥のbegin補完に対応)
+@dots{}
+@example
+<ul>
+</ul>
+@end example
+
+@noindent
+のように開始タグと終了タグを二行に渡って書きたい場合の補完を指します。
+おもにブロック型タグが補完候補に含まれます。
+
+@item [prefix] s (野鳥のsection型補完に対応)
+@dots{}
+@example
+<img src="foo.gif" alt="photo">
+@end example
+
+@noindent
+のように終了タグを持たず、かつ属性値のみで機能を指定するタグを補完します。
+補完候補としては、img, input が存在します。
+
+@item [prefix] l (野鳥のlarge型補完に対応)
+@dots{} begin型補完とほぼ同じですが、
+
+@example
+<big> 〜 </big>
+@end example
+
+@noindent
+のように一行内に開始/終了タグを入れたいときに利用します。
+
+@item [prefix] m (野鳥のmaketitle型補完に対応)
+@dots{} 要素も属性値も持たないタグを補完入力します。<br> 
+などが補完候補に相当します。
+
+@item [prefix] a (野鳥のアクセント補完に対応)
+@dots{} エンティティ参照による文字表記を入力するときに用います。
+デフォルトでは < (&lt;), > (&gt;), & (&amp;), " (&quot;), ' (&apos;),
+ブランク (&nbsp;) の補完入力が行えます。
+@end table
+
+@node Jump, Changing and Deleting, Completion, Top
+@comment  node-name,  next,  previous,  up
+@chapter カーソルジャンプ
+文書中のいろいろな場所で
+
+@table @kbd
+@item [prefix] g
+        @dots{} 対応するオブジェクトにジャンプ
+@end table
+
+@noindent 
+を押すことにより、カーソル位置のHTML構文に対応する場所にジャンプ
+します。対応関係が存在すると解釈されるコマンドには以下のものがあります。
+
+@itemize @bullet
+@item @code{<TAG>} ←→ @code{</TAG>}
+@item @code{<img src="画像ファイル">} → 対応するviewer起動
+@item @code{<a href="リンク先">} → リンク先へのポイント移動
+@item @code{<applet code="プログラム">} → Javaソースプログラムへの移動
+@c @item @code{\include(\input)} → 対応するファイル
+@end itemize
+
+@node Changing and Deleting, Customizations, Jump, Top
+@comment  node-name,  next,  previous,  up
+@chapter 変更/削除
+
+@menu
+* 対タグの変更::                
+* 文字参照への変更::            
+* リジョン内文字のURLencode::   
+@end menu
+
+@node 対タグの変更, 文字参照への変更, Changing and Deleting, Changing and Deleting
+@comment  node-name,  next,  previous,  up
+@section 対タグの変更
+文書中のいろいろな場所で
+
+@table @kbd
+@item [prefix] c
+        @dots{} 対応するタグ等を変更
+@end table
+
+@noindent 
+を押すことにより、カーソル位置のHTML構文に応じた
+記述内容の変更を行います。カーソル位置と変更する内容の
+対応は以下の通りです。
+
+@itemize @bullet
+@item @code{<TAG>}〜@code{</TAG>}
+@dots{} @code{TAG} の変更
+@item @code{<img src="画像ファイル"> alt="photo"} などの属性値
+@dots{} 属性値の変更
+@end itemize
+
+@node 文字参照への変更, リジョン内文字のURLencode, 対タグの変更, Changing and Deleting
+@comment  node-name,  next,  previous,  up
+@section 文字参照への変更
+文字としての < や > を表現するときは、文字参照を用いて
+&lt; や &gt; と表記する必要がありますが、
+HTML以外のファイルからこれらの文字を含むテキストを張り込んだ場合
+などに、これらの文字を一括して文字参照形式に変換できます。
+
+@table @kbd
+@item [prefix] ;
+        @dots{} 指定した領域の文字参照に置き換えるべき文字の置換
+@item [prefix] :
+        @dots{} 指定した領域の文字参照を参照文字そのものに置換
+        ([prefix] ; の逆変換)
+@end table
+
+
+@node リジョン内文字のURLencode,  , 文字参照への変更, Changing and Deleting
+@comment  node-name,  next,  previous,  up
+@section リジョン内文字のURLencode
+@table
+ @item [prefix] #
+	@dots{} 指定した領域内に URLencode すべき文字があればそれらを
+        エンコード表記に置換。
+@end table
+
+
+@node Customizations, Copying, Changing and Deleting, Top
+@comment  node-name,  next,  previous,  up
+@chapter カスタマイズ
+@cindex カスタマイズ[かすたまいす]
+@cindex キーアサイン[きいあさいん]
+
+yahtmlの動作を制御する変数について説明します。
+
+@menu
+* All customizable variables::  カスタマイズ変数一覧
+* Hook variables::              hook変数
+@end menu
+
+@node All customizable variables, Hook variables, Customizations, Customizations
+@comment  node-name,  next,  previous,  up
+@section カスタマイズ変数一覧
+
+@defvar yahtml-prefix
+yahtml-mode 中のプリフィクスキー (@kbd{\C-c})
+@end defvar
+
+@defvar yahtml-image-viewer
+imgで参照している画像ファイルを表示するときに起動するコマンド (xv)
+@end defvar
+
+@defvar yahtml-www-browser
+@kbd{[prefix]g} で外部ページを表示するときに起動するブラウザ (netscape)
+@end defvar
+
+@defvar yahtml-kanji-code
+デフォルトの漢字コード。1=sjis, 2=jis, 3=euc (2)
+.htaccess ファイルに
+@quotation
+ AddType "text/html; charset=xxx" .html
+@end quotation
+の記述があった場合はそれに従う
+@end defvar
+
+@defvar yahtml-fill-column
+auto-fillするときのカラム数 (72)
+@end defvar
+
+@defvar yahtml-fill-prefix
+yahtml-mode 固有のfill-prefix (@code{nil})
+@end defvar
+
+@defvar yahtml-path-url-alist
+OSのファイルシステム上でのフルパス名と、その外部公開時のURLの対応表。
+@end defvar
+
+@defvar yahtml-directory-index
+サーバアクセス時ファイル名を省略したときにデフォルトで開かれる
+インデックスファイルの名前。多くの場合 index.html。(@code{"index.html"})
+@end defvar
+
+@defvar yahtml-lint-program
+HTML構文チェックプログラム。(@code{"jweblint"})
+@end defvar
+
+@defvar yahtml-hate-too-deep-indentation
+ネストした列挙系環境でのインデントが深すぎるときにtにする。(@code{nil})
+@end defvar
+
+@defvar yahtml-always-/p
+@code{<p>} をいれたら必ず @code{</p>} したい人向け。@code{nil}
+@end defvar
+
+@defvar yahtml-p-prefered-env-regexp
+自動的に @code{<p>} を入れて欲しい環境。@code{^\(body\|dl\)}
+@end defvar
+
+@defvar yahtml-template-file
+新規HTMLファイル作成時に自動的に挿入して欲しいファイル名。
+@file{"~/http/template.html"}
+@end defvar
+
+@defvar yahtml-prefer-upcases
+タグに大文字を使いたい。@code{nil}
+@end defvar
+
+@defvar yahtml-prefer-upcase-attributes
+属性指定子に大文字を使いたい。@code{nil}
+@end defvar
+
+@defvar yahtml-server-type
+Apache系のサーバを利用している場合は 'apache をセットする。
+./.htaccess を参照するかどうかを決定する。@code{'apache}
+@end defvar
+
+@defvar yahtml-apache-access-file
+@code{yahtml-server-type} が @code{'apache} のときに
+アクセス制限ファイル名を指定。@file{".htaccess"}
+@end defvar
+
+@defvar yahtml-shell-command-option
+シェルで別コマンドを起動するときのオプション。
+@end defvar
+
+@defvar yahtml-translate-hyphens-when-comment-region
+領域コメントアウトをするときに既に存在するハイフンを @code{&#45;} に
+変更するかどうか。(@code{t})
+@end defvar
+
+@defvar yahtml-entity-reference-chars-alist
+エンティティ参照(Entity Reference)で記述すべき文字群を
+ @code{'(?文字 . "エンティティ表記")}  という形式を列挙した
+alistで並べる。デフォルトで @code{<}, @code{>}, @code{&}, @code{'}, 
+@code{"} に対するalistが設定されているので、追加したい分だけを記述すれば良
+い。cdr部 @code{"エンティティ表記"} は、先頭の @code{&} と 末尾の@code{;}
+は含めずに書く。
+@end defvar
+
+@defvar yahtml-faithful-to-htmllint
+構文チェッカとして htmllint を利用する場合ちょっとした余計な空白などに
+対しても警告を示すので、これを回避するときにはこの変数を@code{t}に
+する。
+@end defvar
+
+
+@node Hook variables,  , All customizable variables, Customizations
+@comment  node-name,  next,  previous,  up
+@section hook変数
+
+
+@node Copying, Concept Index, Customizations, Top
+@comment  node-name,  next,  previous,  up
+@chapter 取り扱い
+
+  本プログラムはフリーソフトウェアです。本プログラムを使用して生じたいかな
+る結果に対しても作者は責任を負わないこととします。転載等に関しては制限いた
+しません。常識的に扱ってください。また、使用している旨をメイルでお知らせい
+ただくと、作者は喜んでサポートに励むことでしょう。
+
+  苦情、希望、バグ報告、感想等は歓迎いたします。
+連絡は gentei.org まで(1999年7月現在)。
+継続的に使用してくださる方はメイリングリスト「fj野鳥の会」に
+是非加入してください。加入方法については本パッケージの @file{docs/yahtmlqa}
+ファイルの「その他」の章を御覧ください。
+
+仕様は、予告なく確実に(気分次第で)変更されます:-p。
+
+@flushright
+広瀬雄二
+@end flushright
+
+
+@node    Concept Index,  , Copying, Top
+@comment node-name, next, previous, up
+@unnumbered 索引
+@printindex cp
+
+
+@contents
+
+@bye
+
+@c Local Variables:
+@c fill-column: 74
+@c fill-prefix: nil
+@c End:
+
+Tag table:
+
+End tag table
--- a/docs/yatex.ref	Mon Oct 26 12:05:32 1998 +0000
+++ b/docs/yatex.ref	Thu Jul 15 04:58:26 1999 +0000
@@ -159,8 +159,7 @@
 	◆インクルード構造ブラウズ	[prefix] d
 
 							       広瀬雄二
-						    yuuji@ae.keio.ac.jp
-						pcs39334@asciinet.or.jp
+						       yuuji@gentei.org
 
 Local variables:
 mode: text
--- a/docs/yatexadd.doc	Mon Oct 26 12:05:32 1998 +0000
+++ b/docs/yatexadd.doc	Thu Jul 15 04:58:26 1999 +0000
@@ -169,5 +169,5 @@
 	思います。
 
 
-							       広瀬雄二
-						    yuuji@ae.keio.ac.jp
+								広瀬雄二
+							yuuji@gentei.org
--- a/docs/yatexe.tex	Mon Oct 26 12:05:32 1998 +0000
+++ b/docs/yatexe.tex	Thu Jul 15 04:58:26 1999 +0000
@@ -14,7 +14,7 @@
 @subtitle Yet Another tex-mode for emacs
 @title Wild Bird
 @subtitle // YaTeX //
-@author @copyright{} 1991-1996 by    HIROSE, Yuuji [yuuji@@ae.keio.ac.jp]
+@author @copyright{} 1991-1996 by    HIROSE, Yuuji [yuuji@@gentei.org]
 @end titlepage
 
 @node Top, What is YaTeX?, (dir), (dir)
@@ -2018,7 +2018,7 @@
 short descriptions on useful functions, where [F] means function, [A]
 means arguments, [D] means description.
 
-@itemize
+@table @kbd
 @item [F]
 YaTeX:read-position
 @itemx [A]
@@ -2047,7 +2047,7 @@
   Check the current completion type is specified one and cause error if
 not. The variable @code{YaTeX-current-completion-type} holds the symbol
 according to the current completion type.
-@end itemize
+@end table
 
 @node Contribution,  , Useful functions for creating add-in, Add-in functions
 @comment  node-name,  next,  previous,  up
@@ -2271,8 +2271,8 @@
 redistribute this software freely but with NO warranty to anything
 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)  And there is mailing list for YaTeX.
+software.   My possible  e-mail address is  `yuuji@@gentei.org'.
+(up to May.1999 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@@jaist.ac.jp'.  If you have some
--- a/docs/yatexgen.doc	Mon Oct 26 12:05:32 1998 +0000
+++ b/docs/yatexgen.doc	Thu Jul 15 04:58:26 1999 +0000
@@ -175,5 +175,5 @@
 	ら、幸福感に浸るだけにして、決して筆者まで送ったりしないで下さい。
 	yatexgen が作るんだから、ろくな関数じゃないことは分かってます:-p。
 
-							       広瀬雄二
-						    yuuji@ae.keio.ac.jp
+								広瀬雄二
+							yuuji@gentei.org
--- a/docs/yatexj.tex	Mon Oct 26 12:05:32 1998 +0000
+++ b/docs/yatexj.tex	Thu Jul 15 04:58:26 1999 +0000
@@ -6,6 +6,7 @@
 @iftex
 @c @syncodeindex fn cp
 @c いつも忘れるのでここに書いとくか。
+@c C-l C-c n でノード入れ
 @c ノードいじったら C-l C-u C-n 全部のノード更新 C-l C-u C-e
 @c メニュー増やしたら C-l C-u C-m 全部のメニュー更新 C-l C-u C-a
 @c フォーマットするときは C-l C-e C-b
@@ -18,7 +19,7 @@
 @subtitle Yet Another tex-mode for emacs
 @title 『野鳥』
 @subtitle // YaTeX //
-@author @copyright{} 1991-1997 by    HIROSE, Yuuji [yuuji@@ae.keio.ac.jp]
+@author @copyright{} 1991-1999 by    HIROSE, Yuuji [yuuji@@gentei.org]
 @end titlepage
 
 @node Top, Intro, (dir), (dir)
@@ -2112,8 +2113,7 @@
 ただくと、作者は喜んでサポートに励むことでしょう。
 
   苦情、希望、バグ報告、感想等は歓迎いたします。
-連絡は yuuji@@ae.keio.ac.jp または、
-pcs39334@@asciinet.or.jp まで(1995年3月現在)。
+連絡は yuuji@@gentei.org まで(1999年5月現在)。
 継続的に使用してくださる方はメイリングリスト「fj野鳥の会」に
 是非加入してください。加入方法については本パッケージの @file{docs/qanda}
 ファイルの「その他」の章を御覧ください。
--- a/docs/yatexref.eng	Mon Oct 26 12:05:32 1998 +0000
+++ b/docs/yatexref.eng	Thu Jul 15 04:58:26 1999 +0000
@@ -154,9 +154,8 @@
 
 	*Browse included structure		[prefix] d
 
-							   HIROSE Yuuji
-						    yuuji@ae.keio.ac.jp
-						pcs39334@asciinet.or.jp
+							    HIROSE Yuuji
+							yuuji@gentei.org
 
 Local variables:
 mode: text
--- a/help/YATEXHLP.jp	Mon Oct 26 12:05:32 1998 +0000
+++ b/help/YATEXHLP.jp	Thu Jul 15 04:58:26 1999 +0000
@@ -1297,12 +1297,12 @@
 	たれました。享年二十六歳。彼には、野鳥だけでなく私が手掛けた数多
 	くのソフトウェアを作る動機、センスあふれるコメントなどを頂きまし
 	た。現在の野鳥が皆様に支持されるように健やかに育ったのは彼のおか
-	げと言っても過言ではありません。野鳥/雷鳥/白鳥を使うときに彼の安
-	らかな眠りを私と共に祈って下さい。
+	げと言っても過言ではありません。野鳥/雷鳥/白鳥/飛鳥を使うときに
+	彼の安らかな眠りを私と共に祈って下さい。
 
 るねきちさん(asciinet)
 	占い師だそうです。
-	http://www.comp.ae.keio.ac.jp/~yuuji/lune/astrology/
+	http://www.gentei.org/~yuuji/lune/astrology/
 
 三平善郎さん(慶應大)
 	開き括弧の入力時の処理のモード分けのアイデアを頂きました。
@@ -1370,6 +1370,7 @@
 	YaTeX-insert-amper をcontributeして頂きました。
 	作者の数多くの凡ミスを丁寧に拾って下さいました。
 	YaTeX-shift-section-undo の実現方法を教えていただきました。
+	Wzへの移植版 HackTeX を作成されました。
 
 佐藤圭さん(慶應大)
 	ネストした同種のitemize環境でのindentationの不具合を指摘して頂き
@@ -1428,6 +1429,9 @@
 	数式モードでのセクション型マクロ対応の要望と足すべきマクロ一覧を
 	頂きました。
 
+松田茂樹さん(千葉大)
+	AMS LaTeX用のいくつかの関数、YaTeX-change-parentheses などを作成
+	して頂きました。
 yatex
 (setq auto-mode-alist (cons '("\\.tex$" . yatex-mode) auto-mode-alist))
 <refer YaTeX>
--- a/yahtml.el	Mon Oct 26 12:05:32 1998 +0000
+++ b/yahtml.el	Thu Jul 15 04:58:26 1999 +0000
@@ -1,9 +1,7 @@
 ;;; -*- Emacs-Lisp -*-
-;;; (c ) 1994-1997 by HIROSE Yuuji [yuuji@ae.keio.ac.jp]
-;;; Last modified Mon Oct 26 19:57:36 1998 on firestorm
+;;; (c ) 1994-1999 by HIROSE Yuuji [yuuji@gentei.org]
+;;; Last modified Wed Jul 14 18:01:18 1999 on firestorm
 ;;; $Id$
-(defconst yahtml-revision-number "1.65.5"
-  "Revision number of running yatex.el")
 
 ;;;[Installation]
 ;;; 
@@ -77,6 +75,12 @@
 ;;; 			 is "netscape")
 ;;;  * [prefix] a	YaTeX's accent mark's equivalent of yahtml.
 ;;;			This function can input $lt, $gt or so.
+;;;  * [prefix] ;	Translate chars of `>', `<', `&', and `"' to 
+;;;			`&gt;', `&lt;', `&amp;', `&quot;' respectively
+;;;			in the region.
+;;;  * [prefix] :	Do translation opposite to above, in the region.
+;;;  * [prefix] #	Translate unsafe-chars and unreserved-chars to
+;;;			URLencoded string in the region.
 ;;; 
 ;;;[キーの説明]
 ;;; 
@@ -126,6 +130,11 @@
 ;;;			送るという芸当が出来ます)
 ;;;  * [prefix] a	YaTeX のアクセント記号補完と同じです。
 ;;;			&lt; &gt; 等が入力できます。
+;;;  * [prefix] ;	指定したリジョン中の > < & " をそれぞれ
+;;;			&gt; &lt; &amp; &quot; に変換します。
+;;;  * [prefix] :	指定したリジョン中で上と逆の変換をします。
+;;;  * [prefix] #	指定したリジョン中で%エンコードの必要な文字が
+;;;			あればそれらをエンコードします。
 ;;; 
 ;;; [謝辞]
 ;;; 
@@ -150,9 +159,14 @@
   "*WWW Browser command")
 (defvar yahtml-kanji-code 2
   "*Kanji coding system number of html file; 1=sjis, 2=jis, 3=euc")
-(defvar yahtml-coding-system
-  (cdr (assq yahtml-kanji-code YaTeX-kanji-code-alist))
-  "Kanji coding system")
+;;(defvar yahtml-coding-system
+;;  (cdr (assq yahtml-kanji-code YaTeX-kanji-code-alist))
+;;  "Kanji coding system")
+(and (featurep 'mule)
+     (integerp yahtml-kanji-code)
+     (setq yahtml-kanji-code
+	   (cdr (assq yahtml-kanji-code YaTeX-kanji-code-alist))))
+
 (defvar yahtml-fill-column 72 "*fill culumn used for yahtml-mode")
 (defvar yahtml-fill-prefix nil "*fill prefix for yahtml-mode")
 
@@ -186,6 +200,20 @@
 (defvar yahtml-template-file "~/http/template.html"
   "*Template HTML file.  It'll be inserted to empty file.")
 
+(defvar yahtml-prefer-upcases nil
+  "*Non-nil for preferring upcase TAGs")
+
+(defvar yahtml-prefer-upcase-attributes nil
+  "*Non-nil for preferring upcase attributes")
+
+(defvar yahtml-server-type 'apache
+  "*WWW server program type")
+
+(defvar yahtml-apache-access-file ".htaccess"
+  "*Server access file name for apache")
+
+(defvar yahtml-use-css t "*Use stylesheet or not")
+
 ;;; --- customizable variable ends here ---
 (defvar yahtml-prefix-map nil)
 (defvar yahtml-mode-map nil "Keymap used in yahtml-mode.")
@@ -216,7 +244,6 @@
     (yahtml-define-begend-region-key
      (concat (upcase (substring key 0 1)) (substring key 1)) env map)))
 
-
 (if yahtml-mode-map nil
   (setq yahtml-mode-map (make-sparse-keymap)
 	yahtml-prefix-map (make-sparse-keymap))
@@ -279,6 +306,9 @@
     (YaTeX-define-key "t" 'yahtml-browse-menu map)
     (YaTeX-define-key "a" 'yahtml-complete-mark map)
     (YaTeX-define-key "'" 'yahtml-prev-error map)
+    (YaTeX-define-key ";" 'yahtml-translate-region map)
+    (YaTeX-define-key ":" 'yahtml-translate-reverse-region map)
+    (YaTeX-define-key "#" 'yahtml-escape-chars-region map)
     ;;;;;(YaTeX-define-key "i" 'yahtml-fill-item map)
     ))
 
@@ -310,7 +340,7 @@
 
 ;;; Completion tables for `form'
 (defvar yahtml-form-table
-  '(("img") ("input")))
+  '(("img") ("input") ("link") ("meta")))
 (defvar yahtml-user-form-table nil)
 (defvar yahtml-tmp-form-table nil)
 (defvar yahtml-last-form "img")
@@ -322,14 +352,16 @@
     ("UnorderedList" . "ul")
     ("DefinitionList" . "dl")
     ("Preformatted" . "pre")
-    ("table") ("tr") ("th") ("td")
+    ("table") ("thead") ("tbody") ("tfoot") ("caption") ("tr") ("th") ("td")
+    ("address") 
     ("h1") ("h2") ("h3") ("h4") ("h5") ("h6")
     ;; ("p") ;This makes indentation screwed up!
+    ("style") ("div")
     ))
 
-(defvar yahtml-itemizing-regexp
-  "\\(ul\\|ul\\|dl\\)"
-  "Regexp of itemizing forms")
+;(defvar yahtml-itemizing-regexp
+;  "\\(ul\\|ol\\|dl\\)"
+;  "Regexp of itemizing forms")
 
 (defvar yahtml-user-env-table nil)
 (defvar yahtml-tmp-env-table nil)
@@ -342,7 +374,8 @@
 (defvar yahtml-typeface-table
   (append
    '(("dfn") ("em") ("cite") ("code") ("kbd") ("samp") ("strike")
-     ("strong") ("var") ("b") ("i") ("tt") ("u") ("address") ("font"))
+     ("strong") ("var") ("b") ("i") ("tt") ("u") ("big") ("small") ("font")
+     ("sup") ("sub") ("span"))
    yahtml-env-table)
   "Default completion table of typeface designator")
 (defvar yahtml-user-typeface-table nil)
@@ -364,8 +397,6 @@
 (defvar yahtml-tmp-single-cmd-table nil)
 (defvar yahtml-last-single-cmd nil)
 
-(defvar yahtml-prefer-upcases nil)
-
 ;(defvar yahtml-struct-name-regexp
 ;  "\\<\\(h[1-6]\\|[uod]l\\|html\\|body\\|title\\|head\\|table\\|t[rhd]\\|pre\\|a\\|form\\|select\\|center\\|blockquote\\)\\b")
 (defvar yahtml-struct-name-regexp
@@ -377,23 +408,65 @@
 (or (assoc "p" yahtml-env-table)
     (setq yahtml-env-table (cons '("p") yahtml-env-table)))
 
+(defun yahtml-dir-default-charset ()
+  (cond
+   ((and (eq yahtml-server-type 'apache) ;;check .htaccess
+	 buffer-file-name)
+    (let ((dir default-directory)
+	  charset af ext (ldir "")
+	  (case-fold-search t)
+	  (uid (car (cdr (cdr (file-attributes "."))))))
+      (setq ext (file-name-nondirectory buffer-file-name)
+	    ext (substring ext (string-match "\\.[a-z0-9]+$" ext)))
+      (if (string-match "^[A-Z]:" dir)
+	  (setq dir (substring dir 2)))	;remove drive letter
+      (while (and dir
+		  (not (string= dir ldir))
+		  (equal uid (car (cdr (cdr (file-attributes dir))))))
+	(setq af (expand-file-name yahtml-apache-access-file dir))
+	(if (file-exists-p af)
+	    (save-excursion
+	      (set-buffer (find-file-noselect af))
+	      (save-excursion
+		(goto-char (point-min))
+		(if (re-search-forward  ;search the charset for same extension
+		     (format "^\\s *AddType.*charset=\\(.*\\)\\%s$" ext)
+		     nil t)
+		    (progn
+		      (setq charset
+			    (buffer-substring
+			     (match-beginning 1) (match-end 1)))
+		      (cond
+		       ((string-match "iso-2022-jp" charset)
+			(setq charset 2))
+		       ((string-match "euc-jp" charset)
+			(setq charset 3))
+		       ((string-match "shift_jis" charset)
+			(setq charset 1))
+		       (t (setq charset nil)))
+		      (setq dir ""))))
+	      (kill-buffer (current-buffer))))
+	(setq ldir dir
+	      dir (substring dir 0 (string-match "/$" dir))
+	      dir (file-name-directory dir)))
+      (if (featurep 'mule)
+	  (setq charset (cdr (assq charset YaTeX-kanji-code-alist))))
+      charset
+      ))
+   (t nil))
+  )
+
 (defun yahtml-mode ()
   (interactive)
-  (cond
-   ((and YaTeX-emacs-20 (fboundp 'coding-system-equal))
-    (let ((mp (buffer-modified-p))
-	  (ud (memq buffer-file-coding-system
-		    '(undecided undecided-unix undecided-dos undecided-mac))))
-      (if (coding-system-equal
-	   yahtml-coding-system buffer-file-coding-system)
-	  nil ; if coding-system is the same, do nothing
-	(set-buffer-file-coding-system yahtml-coding-system)
-	(if ud (set-buffer-modified-p mp)))))
-   ((featurep 'mule)
-    (set-file-coding-system yahtml-coding-system))
-   ((boundp 'NEMACS)
-    (make-local-variable 'kanji-fileio-code)
-    (setq kanji-fileio-code yahtml-kanji-code)))
+  (let ((coding (or (yahtml-dir-default-charset) yahtml-kanji-code)))
+    (cond
+     ((and YaTeX-emacs-20 (boundp 'buffer-file-coding-system))
+      (setq buffer-file-coding-system coding))
+     ((featurep 'mule)
+      (set-file-coding-system coding))
+     ((boundp 'NEMACS)
+      (make-local-variable 'kanji-fileio-code)
+      (setq kanji-fileio-code coding))))
   (setq major-mode 'yahtml-mode
 	mode-name "yahtml")
   (mapcar
@@ -408,7 +481,7 @@
      (YaTeX-struct-end . "</%1>")
      (YaTeX-struct-name-regexp . yahtml-struct-name-regexp)
      (YaTeX-comment-prefix . "<!--")
-     (YaTeX-coding-system . yahtml-coding-system)
+     (YaTeX-coding-system . yahtml-kanji-code) ;necessary?
      (YaTeX-typesetting-mode-map . yahtml-lint-buffer-map)
      (fill-prefix . yahtml-fill-prefix) (fill-column . yahtml-fill-column)
      (paragraph-start . yahtml-paragraph-start)
@@ -420,6 +493,7 @@
   (set-syntax-table yahtml-syntax-table)
   (use-local-map yahtml-mode-map)
   (YaTeX-read-user-completion-table)
+  (yahtml-css-scan-styles)
   (turn-on-auto-fill)			;Sorry, this is prerequisite
   (and (= 0 (buffer-size)) (file-exists-p yahtml-template-file)
        (y-or-n-p (format "Insert %s?" yahtml-template-file))
@@ -582,13 +656,16 @@
     (setq cmd yahtml-last-begend)
     (if yahtml-prefer-upcases (setq cmd (upcase cmd)))
     (if region
+	;; We want to keep region effective for new tagged environment
+	;; to enable continuous regioning by another environment
 	(let ((beg (region-beginning))
 	      (end (region-end))
 	      (addin (yahtml-addin cmd)))
-	  (goto-char end)
-	  (insert (format "</%s>%s" cmd (if bolp "\n" "")))
-	  (goto-char beg)
-	  (insert (format "<%s%s>%s" cmd addin (if bolp "\n" ""))))
+	  (save-excursion
+	    (goto-char end)
+	    (insert-before-markers (format "</%s>%s" cmd (if bolp "\n" "")))
+	    (goto-char beg)
+	    (insert (format "<%s%s>%s" cmd addin (if bolp "\n" "")))))
       (insert (format "<%s%s>" cmd (yahtml-addin cmd)))
       (save-excursion
 	(insert "\n")
@@ -628,33 +705,40 @@
 ;;; ---------- Add-in ----------
 (defun yahtml-addin (form)
   "Check add-in function's existence and call it if exists."
-   (let ((addin (concat "yahtml:" (downcase form))) s)
-     (if (and (intern-soft addin) (fboundp (intern-soft addin))
-	      (stringp (setq s (funcall (intern addin))))
-	      (string< "" s))
-	 (if (eq (aref s 0) ? ) s (concat " " s))
-       "")))
+   (let ((addin (concat "yahtml:" (downcase form))) s a)
+     (concat
+      (if (setq a (assoc form yahtml-css-class-alist))
+	  (yahtml-make-optional-argument ;should be made generic?
+	   "class" (completing-read "class: " (cdr a))))
+      (if (and (intern-soft addin) (fboundp (intern-soft addin))
+	       (stringp (setq s (funcall (intern addin))))
+	       (string< "" s))
+	  (if (eq (aref s 0) ? ) s (concat " " s))
+	""))))
 
 
 (defvar yahtml-completing-buffer nil)
 (defun yahtml-collect-labels (&optional file)
   "Collect current buffers label (<?? name=...>).
 If optional argument FILE is specified collect labels in FILE."
-  (let (list bound)
+  (let (list end)
     (save-excursion
       (set-buffer yahtml-completing-buffer)
       (if file (let (hilit-auto-highlight)
 		 (set-buffer (find-file-noselect file))))
       (save-excursion
 	(goto-char (point-min))
-	(while (re-search-forward "<\\w+\\b" nil t)
-	  (setq bound (match-end 0))
-	  (search-forward ">" nil t)
-	  (if (and (re-search-backward "\\(name\\|id\\)\\s *=" bound t)
-		   (progn
-		     (goto-char (match-end 0))
-		     (skip-chars-forward " \t\n")
-		     (looking-at "\"?#?\\([^\">]+\\)\"?\\b")))
+	(while ;(re-search-forward "<\\w+\\b" nil t)
+	    (re-search-forward "\\(name\\|id\\)\\s *=" nil t)
+	  ;(setq bound (match-end 0))
+	  ;(search-forward ">" nil t)
+	  (setq end (match-end 0))
+	  (if (and ;(re-search-backward "\\(name\\|id\\)\\s *=" bound t)
+	       (yahtml-on-assignment-p)
+	       (progn
+		 (goto-char end)
+		 (skip-chars-forward " \t\n")
+		 (looking-at "\"?#?\\([^\">]+\\)\"?\\b")))
 	      (setq list (cons
 			  (list (concat "#" (YaTeX-match-string 1)))
 			  list))))
@@ -723,22 +807,99 @@
 	      (goto-char p)
 	      (insert " [Sole completion]"))
 	  (delete-region p (point-max))))))))
-  
+
+(defvar yahtml-escape-chars 'ask
+  "*Escape reserved characters to URL-encoding or not.
+Nil for never, t for everytime, and 'ask for inquiring
+at each reserved chars.")
+
+;
+; Subject: [yatex:02849] Re: [yahtml] tilda in href tag
+; From: Masayasu Ishikawa <mimasa@sfc.keio.ac.jp>
+; To: yatex@arcadia.jaist.ac.jp
+; Date: Mon, 31 May 1999 21:09:31 +0900
+; RFC 2396 の "2.4.3. Excluded US-ASCII Characters" によると、以下の文字
+; は必ずエスケープしないといけません。
+;
+;     control     = <US-ASCII coded characters 00-1F and 7F hexadecimal>
+;     space       = <US-ASCII coded character 20 hexadecimal>
+;     delims      = "<" | ">" | "#" | "%" | <">
+;     unwise      = "{" | "}" | "|" | "\" | "^" | "[" | "]" | "`"
+(defvar yahtml-unsafe-chars-regexp
+  "[][\x0- \x7f <>%\"{}|\\^`]" ;#は除去する
+  "Characters regexp which must be escaped in URI.")
+;
+; また、以下の文字は予約された用法以外に用いる場合にはエスケープしないと
+; いけないことになっています。
+;
+;     reserved    = ";" | "/" | "?" | ":" | "@" | "&" | "=" | "+" |
+;                   "$" | ","
+(defvar yahtml-unreserved-chars-regexp
+  "[;/?:@&=+$,]"
+  "Characters regexp which should be escaped in URI on certain conditions.
+Not used yet.")
+
+(defun yahtml-escape-chars-string (str)
+  "Translate reserved chars to URL encoded string."
+  (let ((p 0) (target "")
+	(ask (eq yahtml-escape-chars 'ask)))
+    (cond
+     ((null yahtml-escape-chars) str)
+     (t
+      (while (and (string< "" str)
+		  (setq p (string-match yahtml-unsafe-chars-regexp str)))
+	(if (and ask (y-or-n-p (format "Escape char [%c] of `%s'"
+				       (aref str p) (substring str 0 (1+ p)))))
+	    (setq target (concat target
+				 (substring str 0 p)
+				 (format "%%%x" (aref str p))))
+	  (setq target (concat target (substring str 0 (1+ p)))))
+	(setq str (substring str (1+ p))))
+      (concat target str)))))
+
+(defun yahtml-escape-chars-region (beg end)
+  "Translate reserved chars to encoded string in the region."
+  (interactive "r")
+  (save-excursion
+    (let ((e (set-marker (make-marker) end)) c m yes)
+      (goto-char beg)
+      (while (and (< (point) e)
+		  (re-search-forward
+		   (concat yahtml-unsafe-chars-regexp "\\|"
+			   yahtml-unreserved-chars-regexp) e t))
+	(sit-for 0)
+; 	(setq m (buffer-modified-p)
+; 	      c (char-after (1- (point))))
+; 	(save-excursion (backward-char 1) (insert " ==>"))
+; 	(unwind-protect
+; 	    (setq yes (y-or-n-p (format "Replace: [%c]" c)))
+; 	  (save-excursion
+; 	    (backward-char 1)
+; 	    (delete-backward-char 4))
+; 	  (set-buffer-modified-p m))
+	(message "Replace: [%c] (y or n):" (setq c (char-after (1- (point)))))
+	(if (memq (read-char) '(?y ?Y))
+	    (progn
+	      (delete-region (match-beginning 0) (match-end 0))
+	      (insert (format "%%%x" c)))))
+      (set-marker e nil))))
+;; ab%defgls/.|
+
 (defun yahtml:a ()
   "Add-in function for <a>"
   (let ((href ""))
     (setq yahtml-completing-buffer (current-buffer)
-	  href (read-from-minibuffer "href: " "" yahtml-url-completion-map)
-	  ;; yahtml-urls-local is buffer-local, so we must put
-	  ;; that into yahtml-urls here
-	  yahtml-urls (append yahtml-urls-private yahtml-urls-local))
+	  yahtml-urls (append yahtml-urls-private yahtml-urls-local)
+	  href (yahtml-escape-chars-string
+		(read-from-minibuffer "href: " "" yahtml-url-completion-map)))
     (prog1
 	(concat (yahtml-make-optional-argument
 		 "href" href)
 		(yahtml-make-optional-argument
 		 "name" (read-string "name: ")))
       (if (and (string-match "^http://" href)
-	       (null (assoc href yahtml-urls)))
+	       (null (assoc href yahtml-urls-private))
+	       (null (assoc href yahtml-urls-local)))
 	  (YaTeX-update-table
 	   (list href)
 	   'yahtml-urls-private 'yahtml-urls-private 'yahtml-urls-local))
@@ -747,26 +908,45 @@
 (defvar yahtml-parameters-completion-alist
   '(("align" ("top") ("middle") ("bottom") ("left") ("right") ("center"))
     ("src" . file)
-    ("method" ("POST") ("GET"))))
+    ("method" ("POST") ("GET"))
+    ("rev" . yahtml-link-types-alist)
+    ("rel" . yahtml-link-types-alist)
+    ("type" . yahtml-content-types-alist)))
+
+(defvar yahtml-link-types-alist 
+  '(("alternate") ("stylesheet") ("start") ("next") ("prev")
+    ("contents") ("index") ("glossary") ("chapter") ("section")
+    ("subsection") ("appendix") ("help") ("bookmark")))
 
-(defun yahtml-read-parameter (par)
-  (let* ((alist (cdr-safe (assoc (downcase par)
-				yahtml-parameters-completion-alist)))
+(defvar yahtml-content-types-alist
+  '(("text/css") ("text/html") ("text/plain") ("text/richtext")
+    ("text/sgml") ("text/xml")
+    ("application/octet-stream") ("application/postscript") ("application/pdf")
+    ("image/jpeg") ("image/gif") ("image/tiff") ("video/mpeg"))
+  "Alist of content-types")
+
+(defun yahtml-read-parameter (par &optional default alist)
+  (let* ((alist
+	  (cdr-safe (assoc (downcase par)
+			   (or alist yahtml-parameters-completion-alist))))
 	 (prompt (concat par ": "))
 	 v)
     (cond
      ((eq alist 'file)
-      (read-file-name prompt "" nil nil ""))
+      (read-file-name prompt "" default nil ""))
+     ((symbolp alist)
+      (completing-read prompt (symbol-value alist) nil nil default))
      (alist
-      (completing-read prompt alist))
+      (completing-read prompt alist nil nil default))
      (t 
-      (read-string prompt)))))
+      (read-string prompt default)))))
       
 (defun yahtml-make-optional-argument (opt arg)
   "Make optional argument string."
   (if (string= "" arg)
       ""
-    (concat " " (if yahtml-prefer-upcases (upcase opt) (downcase opt))
+    (concat " "
+	    (if yahtml-prefer-upcase-attributes (upcase opt) (downcase opt))
 	    "=\"" arg "\"")))
 
 (defun yahtml:body ()
@@ -788,7 +968,7 @@
 	(alg (yahtml-read-parameter "align"))
 	(alt (yahtml-read-parameter "alt"))
 	(brd (read-string "border="))
-	(l yahtml-prefer-upcases))
+	(l yahtml-prefer-upcase-attributes))
     (concat (if l "SRC" "src") "=\"" src "\""
 	    (yahtml-make-optional-argument "align" alg)
 	    (yahtml-make-optional-argument "alt" alt)
@@ -797,16 +977,16 @@
 (defun yahtml:form ()
   "Add-in function `form' input format"
   (concat
-   " " (if yahtml-prefer-upcases "METHOD" "method=")
+   " " (if yahtml-prefer-upcase-attributes "METHOD" "method=")
    (completing-read "Method: " '(("POST") ("GET")) nil t)
-   " " (if yahtml-prefer-upcases "ACTION" "action") "=\""
+   " " (if yahtml-prefer-upcase-attributes "ACTION" "action") "=\""
    (read-string "Action: ") "\""
    ))
 
 (defun yahtml:select ()
   "Add-in function for `select' input format"
   (setq yahtml-last-single-cmd "option")
-  (concat " " (if yahtml-prefer-upcases "NAME" "name") "=\""
+  (concat " " (if yahtml-prefer-upcase-attributes "NAME" "name") "=\""
 	  (read-string "name: ") "\""))
 
 (defun yahtml:ol ()
@@ -830,7 +1010,7 @@
 (defun yahtml:input ()
   "Add-in function for `input' form"
   (let ((size "") name type value checked (maxlength "")
-	(l yahtml-prefer-upcases))
+	(l yahtml-prefer-upcase-attributes))
     (setq name (read-string "name: ")
 	  type (completing-read "type (default=text): "
 				yahtml-input-types nil t)
@@ -854,14 +1034,23 @@
 	  cols (read-string "Columns: ")
 	  rows (read-string "Rows: "))
     (concat
-     (concat (if yahtml-prefer-upcases "NAME=" "name=")
+     (concat (if yahtml-prefer-upcase-attributes "NAME=" "name=")
 	     "\"" name "\"")
      (yahtml-make-optional-argument "cols" cols)
      (yahtml-make-optional-argument "rows" rows))))
 
 (defun yahtml:table ()
   "Add-in function for `table'"
-  (yahtml-make-optional-argument "border" (read-string "border=")))
+  (let ((b (read-string "border="))
+	(a (yahtml-read-parameter "align")))
+    (concat
+     (yahtml-make-optional-argument "border" b)
+     (yahtml-make-optional-argument "align" a))))
+;(fset 'yahtml:caption 'yahtml:p)
+(defun yahtml:caption ()
+  "Add-in function for `caption' in table tag"
+  (let ((yahtml-parameters-completion-alist '(("align" ("top") ("bottom")))))
+    (yahtml-make-optional-argument "align" (yahtml-read-parameter "align"))))
 
 (defun yahtml:font ()
   "Add-in function for `font'"
@@ -869,6 +1058,49 @@
    (yahtml-make-optional-argument "color" (read-string "color="))
    (yahtml-make-optional-argument "size" (read-string "size="))))
 
+(defun yahtml:style ()
+  "Add-in function for `style'"
+  (yahtml-make-optional-argument
+   "type" (read-string "type=" "text/css")))
+
+(defun yahtml:tr ()
+  "Add-in function for `tr'"
+  (setq ;yahtml-last-begend "td"		;; which do you prefer?
+	yahtml-last-typeface-cmd "td")
+  "")
+
+(defun yahtml:link ()
+  "Add-in function for `link' (まだちょっと良く分かってない)"
+  (let (rel rev type href)
+    (setq rel (yahtml-read-parameter "rel"))
+    (cond
+     ((equal rel "")
+      (concat (yahtml-make-optional-argument
+	       "rev" (yahtml-read-parameter "rev"))
+	      (yahtml-make-optional-argument
+	       "href" (yahtml-read-parameter "href")
+	       ;;他に良く使うのって何?
+	       )))
+     ((string-match "stylesheet" rel)
+      (concat
+       (yahtml-make-optional-argument "rel" rel)
+       (yahtml-make-optional-argument
+	"type" (yahtml-read-parameter "type" "text/css"))
+       (progn
+	 (setq href
+	       (read-from-minibuffer "href: " "" yahtml-url-completion-map))
+	 (if (string< "" href)
+	     (progn
+	       (if (and (file-exists-p (yahtml-url-to-path href))
+			(y-or-n-p "Load css symbols now? "))
+		   (setq yahtml-css-class-alist
+			 (yahtml-css-collect-classes-file
+			  (yahtml-url-to-path href) yahtml-css-class-alist)))
+	       (message "")
+	       (yahtml-make-optional-argument "href" href))))))
+     (t ;;??
+      ))))
+
 ;;; ---------- Simple tag ----------
 (defun yahtml-insert-tag (region-mode &optional tag)
   "Insert <TAG> </TAG> and put cursor inside of them."
@@ -933,11 +1165,13 @@
   "Check if point is on href clause."
   (let ((p (point)) e cmd (case-fold-search t))
     (save-excursion
-      (and (string= (YaTeX-inner-environment t) "a")
+      (and ;;(string= (YaTeX-inner-environment t) "a") ;aでなくても許可にした
 	   (save-excursion
-	     (search-forward "</a>" nil t)
+	     ;;(search-forward "</a>" nil t) ;aでなくても許可にした
+	     (search-forward "[\" \t\n]" nil t)
 	     (setq e (point)))
-	   (goto-char (get 'YaTeX-inner-environment 'point))
+	   ;(goto-char (get 'YaTeX-inner-environment 'point))
+	   (re-search-backward "<\\(a\\|link\\)\\>" nil t)
 	   (search-forward "href" e t)
 	   (search-forward "=" e t)
 	   (progn
@@ -1032,7 +1266,7 @@
 
 (defun yahtml-jump-to-name (name)
   "Jump to html's named tag."
-  (setq name (format "\\(name\\|id\\)\\s *=\\s *\"?%s\"?" name))
+  (setq name (format "\\(name\\|id\\)\\s *=\\s *\"?%s\\>\"?" name))
   (or (and (re-search-forward name nil t) (goto-char (match-beginning 0)))
       (and (re-search-backward name nil t) (goto-char (match-beginning 0)))
       (message "Named tag `%s' not found" (substring href 1))))
@@ -1270,7 +1504,7 @@
 	(default (append yahtml-env-table yahtml-typeface-table))
 	(user (append yahtml-user-env-table yahtml-user-typeface-table))
 	(tmp (append yahtml-tmp-env-table yahtml-tmp-typeface-table))
-	href b1 e1)
+	href b1 e1 attr new css)
     (cond
      (tag
       (cond
@@ -1306,6 +1540,16 @@
 	      (delete-region b1 e1)
 	      (goto-char b1)
 	      (insert href))))
+       ((setq attr (yahtml-on-assignment-p)) ;if on the assignment to attr
+	(if (and (equal attr "class")	     ;treat "class" attribute specially
+		 (setq css (assoc tag yahtml-css-class-alist)))
+	    (setq new (yahtml-read-parameter ;should be made generic?
+		       attr nil (list (cons "class" (cdr css)))))
+	  ;;other than "class", read parameter normally
+	  (setq new (yahtml-read-parameter attr)))
+	(goto-char (car (get 'yahtml-on-assignment-p 'region)))
+	(delete-region (point) (cdr (get 'yahtml-on-assignment-p 'region)))
+	(insert new))
        (t
 	(save-excursion
 	  (if (= (aref tag 0) ?/) (setq tag (substring tag 1)))
@@ -1385,12 +1629,15 @@
   ))
 
 ;;; ---------- commenting ----------
+(defvar yahtml-translate-hyphens-when-comment-region t
+  "*Non-nil for translate hyphens to &#45; when comment-region")
+
 (defun yahtml-comment-region (&optional uncom)
   "Comment out region or environment."
   (interactive)
-  (let (e beg p)
+  (let ((e (make-marker)) beg p)
     (cond
-     ((setq e (yahtml-on-begend-p))
+     ((marker-position (set-marker e (yahtml-on-begend-p)))
       (save-excursion
 	(setq p (point))
 	(if (string-match "^/" e)
@@ -1401,15 +1648,90 @@
 	(if (string-match "^/" e)
 	    (beginning-of-line)
 	  (forward-line 1))
-	(comment-region beg (point) (if uncom (list 4)))))
-     (t (comment-region (region-beginning) (region-end)
-			(if uncom (list 4)))))))
+	(set-marker e (point))
+	;(comment-region beg (point) (if uncom (list 4)))
+	))
+     (t ;(comment-region (region-beginning) (region-end) (if uncom (list 4)))
+      (setq beg (region-beginning))
+      (set-marker e (region-end))))
+    (if yahtml-translate-hyphens-when-comment-region
+	(let ((yahtml-entity-reference-chars-alist-default nil)
+	      (yahtml-entity-reference-chars-alist '((?- . "#45")))
+	      yahtml-entity-reference-chars-regexp
+	      yahtml-entity-reference-chars-reverse-regexp)
+	  (yahtml-entity-reference-chars-setup)
+	  (funcall
+	   (if uncom 'yahtml-translate-reverse-region
+	     'yahtml-translate-region)
+	   beg e)))
+    (comment-region beg e (if uncom (list 4)))
+    (set-marker e nil)))
 
 (defun yahtml-uncomment-region ()
   (interactive)
   (yahtml-comment-region t))
 
+;;; ---------- translate to entity references ----------
+(defvar yahtml-entity-reference-chars-alist-default
+  ;'((?> . "gt") (?< . "lt") (?& . "amp") (?\" . "quot") (?' . "apos"))
+  '((?> . "gt") (?< . "lt") (?& . "amp") (?\" . "quot"))
+  "Default translation table from character to entity reference")
+(defvar yahtml-entity-reference-chars-alist nil
+  "*Translation table from character to entity reference")
+(defvar yahtml-entity-reference-chars-regexp nil)
+(defvar yahtml-entity-reference-chars-reverse-regexp nil)
 
+(defun yahtml-entity-reference-chars-setup ()
+  (let ((list (append yahtml-entity-reference-chars-alist-default
+		      yahtml-entity-reference-chars-alist)))
+    (setq yahtml-entity-reference-chars-regexp "["
+	  yahtml-entity-reference-chars-reverse-regexp "&\\(")
+    (while list
+      (setq yahtml-entity-reference-chars-regexp
+	    (concat yahtml-entity-reference-chars-regexp
+		    (char-to-string (car (car list))))
+	    yahtml-entity-reference-chars-reverse-regexp
+	    (concat yahtml-entity-reference-chars-reverse-regexp
+		    (cdr (car list))
+		    (if (cdr list) "\\|")))
+      (setq list (cdr list)))
+    (setq yahtml-entity-reference-chars-regexp
+	  (concat yahtml-entity-reference-chars-regexp "]")
+	  yahtml-entity-reference-chars-reverse-regexp
+	  (concat yahtml-entity-reference-chars-reverse-regexp "\\);"))))
+
+(yahtml-entity-reference-chars-setup)
+
+(defun yahtml-translate-region (beg end)
+  "Translate inhibited literals."
+  (interactive "r")
+  (save-excursion
+    (save-restriction
+      (narrow-to-region beg end)
+      (let ((ct (append yahtml-entity-reference-chars-alist
+		       yahtml-entity-reference-chars-alist-default)))
+	(goto-char beg)
+	(while (re-search-forward yahtml-entity-reference-chars-regexp nil t)
+	  ;(setq c (preceding-char))
+	  (replace-match
+	   (concat "&" (cdr (assoc (preceding-char) ct)) ";")))))))
+
+(defun yahtml-translate-reverse-region (beg end)
+  "Translate entity references to literals."
+  (interactive "r")
+  (save-excursion
+    (save-restriction
+      (narrow-to-region beg end)
+      (let ((ct (append yahtml-entity-reference-chars-alist
+		       yahtml-entity-reference-chars-alist-default))
+	    ec)
+	(goto-char beg)
+	(while (re-search-forward
+		yahtml-entity-reference-chars-reverse-regexp nil t)
+	  ;(setq c (preceding-char))
+	  (setq ec (YaTeX-match-string 1))
+	  (delete-region (match-end 0) (match-beginning 0))
+	  (insert (car (YaTeX-rassoc ec ct))))))))
 
 (defun yahtml-inner-environment-but (exclude &optional quick)
   "Return the inner environment but matches with EXCLUDE tag."
@@ -1421,7 +1743,6 @@
     e))
 
 ;;; ---------- filling ----------
-
 (defvar yahtml-saved-move-to-column (symbol-function 'move-to-column))
 (defun yahtml-move-to-column (col &optional force)
   (beginning-of-line)
@@ -1444,7 +1765,11 @@
 	      (setq ccol (+ ccol wd))))
 	(setq ccol (1+ ccol)))
       (if (and YaTeX-japan
-	       (string-match "[chj]" (char-category (preceding-char))))
+	       (or
+		(and (fboundp 'char-category)
+		     (string-match "[chj]" (char-category (preceding-char))))
+		(and (fboundp 'char-charset)
+		     (not (eq (char-charset (preceding-char)) 'ascii)))))
 	  (setq ccol (1+ ccol)))))
   (if (and force (> col ccol))
       (progn
@@ -1462,7 +1787,7 @@
 	(ps1 (if prep (default-value 'paragraph-start)
 	       paragraph-start))
 	(ps2 (if prep (concat (default-value 'paragraph-start)
-			      "\\|^\\s *</?pre>")
+			      "$\\|^\\s *</?pre>")
 	       paragraph-start)))
     (save-excursion
       (unwind-protect
@@ -1488,9 +1813,7 @@
 			(point)))
 	     (progn (goto-char p)
 		    (re-search-forward ps2 nil t)
-		    (match-beginning 0)
-		    
-		    )))
+		    (match-beginning 0))))
 	(fset 'move-to-column yahtml-saved-move-to-column)))))
 
 ;(defun yahtml-indent-new-commnet-line ()
@@ -1797,14 +2120,15 @@
 (defun yahtml-complete-mark ()
   "Complete &gt, &lt, &ampersand, and &quote."
   (interactive)
-  (message "1:< 2:> 3:& 4:\"")
+  (message "1:< 2:> 3:& 4:\" 5:' 6:nbsp")
   (let ((c (read-char)))
-    (setq c (if (or (< c ?0) (> c ?5))
+    (setq c (if (or (< c ?0) (> c ?7))
 		(string-match (regexp-quote (char-to-string c)) "<>&\"")
 	      (- c ?1)))
-    (if (or (< c 0) (> c 4))
+    (if (or (< c 0) (> c 6))
 	nil
-      (insert (format "&%s;" (nth c '("lt" "gt" "amp" "quot")))))))
+      (insert (format "&%s;"
+		      (nth c '("lt" "gt" "amp" "quot" "apos" "nbsp")))))))
 
 
 ;;; ---------- jump to error line ----------
@@ -1831,7 +2155,77 @@
 	  (YaTeX-showup-buffer (YaTeX-switch-to-buffer f t) nil t)
 	  (goto-line l))
       (message "No line number usage"))))
-    
+
+;;; ---------- Style Sheet Support ----------
+(defvar yahtml-css-class-alist nil
+  "Alist of elements vs. their classes")
+
+(defun yahtml-css-collect-classes-region (beg end &optional initial)
+  (save-restriction
+    (save-excursion
+      (narrow-to-region beg end)
+      (goto-char (point-min))
+      (let ((alist initial) b e element class a
+	    (s1 (aref (syntax-table) ?\{ ))
+	    (s2 (aref (syntax-table) ?\} )))
+	;(modify-syntax-entry ?{ "(}")
+        ;(modify-syntax-entry ?} "){")
+	(setq b (point))
+	(unwind-protect
+	    (while (search-forward "{" nil t)
+	      (setq e (point))
+	      (goto-char b)
+	      (while (re-search-forward		;ちょといい加減なREGEXP
+		      "\\([a-z][a-z0-9]*\\)\\.\\([a-z][a-z0-9]*\\)\\>" e t)
+		(setq element (YaTeX-match-string 1)
+		      class (YaTeX-match-string 2))
+		(if (setq a (assoc element alist))
+		    (or (assoc class (cdr a))
+			(setcdr a (cons (list class) (cdr a))))
+		  (setq alist (cons (list element (list class)) alist))))
+	      (goto-char (1- e))
+	      ;(forward-list 1)
+	      (search-forward "}" nil t)
+	      (setq b (point)))
+	  (aset (syntax-table) ?\{ s1)
+	  (aset (syntax-table) ?} s2))
+      alist))))
+	    
+(defun yahtml-css-collect-classes-buffer (&optional initial)
+  (interactive)
+  (yahtml-css-collect-classes-region (point-min) (point-max) initial))
+
+(defun yahtml-css-collect-classes-file (file &optional initial)
+  (let ((hilit-auto-highlight nil) (cb (current-buffer)))
+    (set-buffer (find-file-noselect file))
+    (prog1
+	(yahtml-css-collect-classes-buffer initial)
+      (set-buffer cb))))
+
+(defun yahtml-css-scan-styles ()
+  (save-excursion
+    (goto-char (point-min))
+    (set (make-local-variable 'yahtml-css-class-alist) nil)
+    (while (re-search-forward "<\\(style\\|link\\)" nil t)
+      (let ((b (match-beginning 0))(tag (YaTeX-match-string 1)) e href alist)
+	(cond
+	 ((string-match "style" tag)
+	  (goto-char b)
+	  (save-excursion (forward-list 1) (setq e (point)))
+	  (cond
+	   ((search-forward "text/css" e 1) ;css definition starts
+	    (setq alist
+		  (yahtml-css-collect-classes-region
+		   (point) (progn (search-forward "</style>") (point))
+		   alist)))))
+	 ((and (string-match "link" tag)
+	       (setq href (yahtml-get-attrvalue "href"))
+	       (file-exists-p (yahtml-url-to-path href)))
+	    (setq alist
+		  (yahtml-css-collect-classes-file
+		   (yahtml-url-to-path href) alist))))
+	(setq yahtml-css-class-alist alist)))))
+
 ;;; ---------- ----------
 
 ;;;
@@ -1846,7 +2240,7 @@
     ;; comments
     ("<!--\\s " "-->" comment)
     ;; include&exec
-    ("<!--#\\(include\\|exec\\)" "-->" include)
+    ("<!--#\\(include\\|exec\\|config\\|fsize\\|flastmod\\)" "-->" include)
     ;; string
     (hilit-string-find ?\\ string)
     (yahtml-hilit-region-tag "\\(em\\|strong\\)" bold)
--- a/yatex.el	Mon Oct 26 12:05:32 1998 +0000
+++ b/yatex.el	Thu Jul 15 04:58:26 1999 +0000
@@ -1,9 +1,11 @@
 ;;; -*- Emacs-Lisp -*-
-;;; Yet Another tex-mode for emacs.
-;;; yatex.el rev. 1.66
-;;; (c )1991-1998 by HIROSE Yuuji.[yuuji@ae.keio.ac.jp]
-;;; Last modified Mon Oct 26 21:05:14 1998 on firestorm
+;;; Yet Another tex-mode for emacs - //野鳥//
+;;; yatex.el rev. 1.67
+;;; (c )1991-1999 by HIROSE Yuuji.[yuuji@gentei.org]
+;;; Last modified Tue Jul 13 14:20:45 1999 on firestorm
 ;;; $Id$
+;;; The latest version of this software is always available at;
+;;; http://www.yatex.org/
 
 ;; This program is free software; you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
@@ -22,35 +24,35 @@
 
 (require 'comment)
 (require 'yatexlib)
-(defconst YaTeX-revision-number "1.66"
-  "Revision number of running yatex.el"
-)
+(defconst YaTeX-revision-number "1.67"
+  "Revision number of running yatex.el")
+
 ;---------- Local variables ----------
 (defvar YaTeX-prefix "\C-c"
   "*Prefix key to call YaTeX functions.
-You can select favorite prefix key by setq in your ~/.emacs."
-)
+You can select favorite prefix key by setq in your ~/.emacs.")
+
 (defvar YaTeX-environment-indent 1
-  "*Indentation depth at column width in LaTeX environments."
-)
+  "*Indentation depth at column width in LaTeX environments.")
+
 (defvar YaTeX-fill-prefix nil
   "*fill-prefix used for auto-fill-mode.
-The default value is nil."
-)
+The default value is nil.")
+
 (defvar YaTeX-fill-column 72
-  "*fill-column used for auto-fill-mode."
-)
+  "*fill-column used for auto-fill-mode.")
+
 (defvar YaTeX-comment-prefix "%"
-  "TeX comment prefix."
-)
+  "TeX comment prefix.")
+
 (defvar YaTeX-current-position-register ?3
   "*Position register to keep where the last completion was done.
 All of YaTeX completing input store the current position into
 the register YaTeX-current-position-register.  So every time you
 make a trip to any other part of text other than you are writing, you can
 return to the editing paragraph by calling register-to-point with argument
-YaTeX-current-position-register."
-)
+YaTeX-current-position-register.")
+
 ;;(defvar YaTeX-tmp-dic-unit 'main-file
 ;;  "*Default switching unit of temporary dictionary.
 ;;There are two switching unit:
@@ -58,20 +60,20 @@
 ;;'directory	: switch tmp-dic dir by dir."
 ;;)
 (defvar tex-command (if YaTeX-japan "jlatex" "latex")
-  "*Default command for typesetting LaTeX text."
-)
+  "*Default command for typesetting LaTeX text.")
+
 (defvar bibtex-command (if YaTeX-japan "jbibtex" "bibtex")
-  "*Default command of BibTeX."
-)
+  "*Default command of BibTeX.")
+
 (defvar dvi2-command		;previewer command for your site
   (if YaTeX-dos "dviout -wait=0"
     "xdvi -geo +0+0 -s 4")
   "*Default previewer command including its option.
-This default value is for X window system."
-)
+This default value is for X window system.")
+
 (defvar makeindex-command (if YaTeX-dos "makeind" "makeindex")
-  "*Default makeindex command."
-)
+  "*Default makeindex command.")
+
 (defvar dviprint-command-format
   (if YaTeX-dos "dviprt %s %f%t"
       "dvi2ps %f %t %s | lpr")
@@ -79,31 +81,31 @@
 Format string %s will be replaced by the filename.  Do not forget to
 specify the `from usage' and `to usage' with their option by format string
 %f and %t.
-  See also documentation of dviprint-from-format and dviprint-to-format."
-)
+  See also documentation of dviprint-from-format and dviprint-to-format.")
+
 (defvar dviprint-from-format
   (if YaTeX-dos "%b-" "-f %b")
-  "*`From' page format of dvi filter.  %b will turn to beginning page number."
-)
+  "*`From' page format of dvi filter.  %b will turn to beginning page number.")
+
 (defvar dviprint-to-format
   (if YaTeX-dos "%e" "-t %e")
-  "*`To' page format of dvi filter.  %e will turn to end page number."
-)
+  "*`To' page format of dvi filter.  %e will turn to end page number.")
+
 (defvar YaTeX-default-document-style
   (concat (if YaTeX-japan "j") "article")
-  "*Default LaTeX Documentstyle for YaTeX-typeset-region."
-)
+  "*Default LaTeX Documentstyle for YaTeX-typeset-region.")
+
 (defvar YaTeX-need-nonstop nil
-  "*T for adding `\\nonstopmode{}' to text before invoking latex command."
-)
+  "*T for adding `\\nonstopmode{}' to text before invoking latex command.")
+
 (defvar latex-warning-regexp "line.* [0-9]*"
-  "*Regular expression of line number of warning message by latex command."
-)
+  "*Regular expression of line number of warning message by latex command.")
+
 (defvar latex-error-regexp "l\\.[1-9][0-9]*"
   "*Regular expression of line number of latex error.
 Perhaps your latex command stops at this error message with line number of
-LaTeX source text."
-)
+LaTeX source text.")
+
 (defvar latex-dos-emergency-message
   "Emergency stop"      ;<- for Micro tex, ASCII-pTeX 1.6
   "Message pattern of emergency stop of typesetting.
@@ -113,12 +115,12 @@
 other process, user or OS.  Define to this variable a message string of your
 latex command on DOS shown at abnormal termination.
   Remember Demacs's call-process function is not oriented for interactive
-process."
-)
+process.")
+
 (defvar latex-message-kanji-code 2
   "*Kanji coding system latex command types out.
-1 = Shift JIS, 2 = JIS, 3 = EUC."
-)
+1 = Shift JIS, 2 = JIS, 3 = EUC.")
+
 (defvar NTT-jTeX nil
   "*T for using NTT-jTeX for latex command.
 More precisely, setting t to this variables inhibits inter-word break on
@@ -126,16 +128,16 @@
 put % after each line at filling.
 改行+インデントによって、タイプセット後の字間が空いてしまうのを抑制する場合に
 tにする(古いNTT-jTeXで顕著に現れる)。具体的には、fillするときに各行の終わりに
-%を付加する。"
-)
+%を付加する。")
+
 (defvar YaTeX-item-regexp
   (concat (regexp-quote "\\") "\\(sub\\|bib\\)*item")
-  "*Regular expression of item command."
-)
+  "*Regular expression of item command.")
+
 (defvar YaTeX-sectioning-regexp
-  "part\\|chapter\\*?\\|\\(sub\\)*\\(section\\|paragraph\\)\\(\\*?\\|\\b\\)"
-  "*LaTeX sectioning commands regexp."
-)
+  "\\(part\\|chapter\\*?\\|\\(sub\\)*\\(section\\|paragraph\\)\\)\\(\\*\\|\\b\\)"
+  "*LaTeX sectioning commands regexp.")
+
 (defvar YaTeX-paragraph-start
   (concat "^[ \t]*%\\|^[ \t]*$\\|\\'\\|^\C-l\\|\\\\\\\\$\\|^[ \t]*\\\\\\("
 	  YaTeX-sectioning-regexp		;sectioning commands
@@ -143,8 +145,8 @@
 	  "\\|newpage\\b\\|vspace\\b"
 	  "\\)")
   "*Paragraph starting regexp of common LaTeX source.  Use this value
-for YaTeX-uncomment-paragraph."
-)
+for YaTeX-uncomment-paragraph.")
+
 (defvar YaTeX-paragraph-separate
   (concat "^[ \t]*%\\|^[ \t]*$\\|^\C-l\\|\\\\\\\\$\\|^[ \t]*\\\\\\("
 	  YaTeX-sectioning-regexp		;sectioning commands
@@ -153,8 +155,8 @@
 	  "\\|newpage\\b\\|vspace\\b"
 	  "\\)")
   "*Paragraph delimiter regexp of common LaTeX source.  Use this value
-for YaTeX-uncomment-paragraph."
-)
+for YaTeX-uncomment-paragraph.")
+
 (defvar YaTeX-verbatim-environments 
   '("verbatim" "verbatim*")
   "*Assume these environments of this variable disable LaTeX commands.")
@@ -162,11 +164,11 @@
   "*Regexp of verb family.  Do not contain preceding \\\\ nor \\(\\).")
 (defvar YaTeX-fill-inhibit-environments
   (append '("tabular" "tabular*" "array" "picture" "eqnarray" "eqnarray*"
-	    "equation" "math" "displaymath")
+	    "equation" "equation*" "math" "displaymath")
 	  YaTeX-verbatim-environments)
   "*In these environments, YaTeX inhibits fill-paragraph from formatting.
-Define those environments as a form of list."
-)
+Define those environments as a form of list.")
+
 (defvar YaTeX-itemizing-env-regexp
   "itemize\\|enumerate\\|description\\|list\\|thebibliography"
   "*Regexp of itemizing environments")
@@ -176,51 +178,52 @@
 (defvar YaTeX-array-env-regexp
   (concat
    "array\\*?\\|eqnarray\\*?\\|tabbing\\|tabular\\*?\\|"	;LaTeX
+   "matrix\\|pmatrix\\|bmatrix\\|vmatrix\\|Vmatrix\\|"		;AMS-LaTeX
    "align\\*?\\|split\\*?\\|aligned\\*?\\|alignat\\*?\\|"	;AMS-LaTeX
    "[bpvV]?matrix\\|smallmatrix\\|cases\\|"			;AMS-LaTeX
    "xalignat\\*?\\|xxalignat\\*?")				;AMS-LaTeX
   "*Regexp of environments where `&' becomes field delimiter.")
 (defvar YaTeX-uncomment-once t
   "*T for removing all continuous commenting character(%).
-Nil for removing only one commenting character at the beginning-of-line."
-)
+Nil for removing only one commenting character at the beginning-of-line.")
+
 (defvar YaTeX-close-paren-always t
-  "Close parenthesis always when YaTeX-modify-mode is nil."
-)
+  "*Close parenthesis always when YaTeX-modify-mode is nil.")
+
 (defvar YaTeX-greek-by-maketitle-completion nil
-  "*T for greek letters completion by maketitle-type completion."
-)
+  "*T for greek letters completion by maketitle-type completion.")
+
 (defvar YaTeX-auto-math-mode t
   "*T for changing YaTeX-math mode automatically.")
 (defvar YaTeX-use-AMS-LaTeX nil
-  "*T for using AMS-LaTeX"
-)
+  "*T for using AMS-LaTeX")
+
 (defvar yatex-mode-hook nil
-  "*List of functions to be called at the end of yatex-mode initializations."
-)
+  "*List of functions to be called at the end of yatex-mode initializations.")
+
 ;;-- Math mode values --
 
 (defvar YaTeX-math-key-list-default
   '((";" . YaTeX-math-sign-alist)
     (":" . YaTeX-greek-key-alist))
-  "Default key sequence to invoke math-mode's image completion."
-)
+  "Default key sequence to invoke math-mode's image completion.")
+
 (defvar YaTeX-math-key-list-private nil
-  "*User defined alist, math-mode-prefix vs completion alist."
-)
+  "*User defined alist, math-mode-prefix vs completion alist.")
+
 (defvar YaTeX-math-key-list
   (append YaTeX-math-key-list-private YaTeX-math-key-list-default)
-  "Key sequence to invoke math-mode's image completion."
-)
+  "Key sequence to invoke math-mode's image completion.")
+
 (defvar YaTeX-skip-default-reader nil
-  "Non-nil skips default argument reader of section-type completion."
-)
+  "Non-nil skips default argument reader of section-type completion.")
+
 (defvar YaTeX-simple-messages nil
-  "Non-nil makes minibuffer messages simpler."
-)
+  "Non-nil makes minibuffer messages simpler.")
+
 (defvar YaTeX-template-file "~/work/template.tex"
-  "*Template TeX source file.  This will be inserted to empty file."
-)
+  "*Template TeX source file.  This will be inserted to empty file.")
+
 (defvar YaTeX-addin-prefix "YaTeX:")
 ;------------ Completion table ------------
 ; Set tex-section-like command possible completion
@@ -245,8 +248,8 @@
     ;; section types in mathmode
     ("frac" 2) ("sqrt") ("mathrm") ("mathbf") ("mathit")
     )
-  "Default completion table for section-type completion."
-)
+  "Default completion table for section-type completion.")
+
 (defvar user-section-table nil)
 (defvar tmp-section-table nil)
 
@@ -260,8 +263,8 @@
     ("thebibliography") ("theindex") ("flushleft") ("flushright")
     ("minipage")
     )
-  "Default completion table for begin-type completion."
-)
+  "Default completion table for begin-type completion.")
+
 (defvar user-env-table nil)
 (defvar tmp-env-table nil)
 
@@ -272,8 +275,8 @@
     ("tiny") ("scriptsize") ("footnotesize") ("small")("normalsize")
     ("large") ("Large") ("LARGE") ("huge") ("Huge")
     )
-  "Default completion table for large-type completion."
-)
+  "Default completion table for large-type completion.")
+
 (defvar user-fontsize-table nil)
 (defvar tmp-fontsize-table nil)
 
@@ -296,8 +299,8 @@
 	 ("upsilon") ("phi") ("varphi") ("chi") ("psi") ("omega")
 	 ("Gamma") ("Delta") ("Theta") ("Lambda")("Xi") ("Pi")
 	 ("Sigma") ("Upsilon") ("Phi") ("Psi") ("Omega"))))
-  "Default completion table for maketitle-type completion."
-)
+  "Default completion table for maketitle-type completion.")
+
 (defvar user-singlecmd-table nil)
 (defvar tmp-singlecmd-table nil)
 
@@ -307,24 +310,23 @@
 ;; Do not change this section.
 ;;;
 (defvar YaTeX-mode-map nil
-  "Keymap used in YaTeX mode"
-)
+  "Keymap used in YaTeX mode")
+
 (defvar YaTeX-prefix-map nil
-  "Keymap used when YaTeX-prefix key pushed"
-)
+  "Keymap used when YaTeX-prefix key pushed")
+
 (defvar YaTeX-user-extensional-map (make-sparse-keymap)
   "*Keymap used for the user's customization")
 (defvar YaTeX-current-completion-type nil
-  "Has current completion type.  This may be used in YaTeX addin functions."
-)
+  "Has current completion type.  This may be used in YaTeX addin functions.")
+
 (defvar YaTeX-modify-mode nil
   "*Current editing mode.
 When non-nil, each opening parentheses only opens,
-nil enters both open/close parentheses when opening parentheses key pressed."
-)
+nil enters both open/close parentheses when opening parentheses key pressed.")
+
 (defvar YaTeX-math-mode nil
-  "Holds whether current mode is math-mode."
-)
+  "Holds whether current mode is math-mode.")
 ;;;
 ;; Define key table
 ;;;
@@ -336,6 +338,7 @@
   (define-key YaTeX-mode-map "{" 'YaTeX-insert-braces)
   (define-key YaTeX-mode-map "(" 'YaTeX-insert-parens)
   (define-key YaTeX-mode-map "$" 'YaTeX-insert-dollar)
+  (define-key YaTeX-mode-map "|" 'YaTeX-insert-bar)
   (define-key YaTeX-mode-map "&" 'YaTeX-insert-amper)
   (define-key YaTeX-mode-map "[" 'YaTeX-insert-brackets)
   (define-key YaTeX-mode-map YaTeX-prefix YaTeX-prefix-map)
@@ -419,8 +422,7 @@
    (function
     (lambda (key)
       (define-key YaTeX-mode-map (car key) 'YaTeX-math-insert-sequence)))
-   YaTeX-math-key-list)
-)
+   YaTeX-math-key-list))
 
 (defvar YaTeX-section-completion-map nil
   "*Key map used at YaTeX completion in the minibuffer.")
@@ -448,8 +450,8 @@
 (defvar fontsize-name "large" "*Initial fontsize completion")
 (defvar single-command "maketitle" "*Initial LaTeX single command")
 (defvar YaTeX-kanji-code (if YaTeX-dos 1 2)
-  "*File kanji code used by Japanese TeX."
-)
+  "*File kanji code used by Japanese TeX.")
+
 (defvar YaTeX-coding-system nil "File coding system used by Japanese TeX.")
 (cond
  (YaTeX-emacs-20
@@ -469,8 +471,7 @@
   (setq YaTeX-mode-syntax-table (make-syntax-table (standard-syntax-table)))
   (modify-syntax-entry ?\n " " YaTeX-mode-syntax-table)
   (modify-syntax-entry ?\{ "(}" YaTeX-mode-syntax-table)
-  (modify-syntax-entry ?\} "){" YaTeX-mode-syntax-table)
-)
+  (modify-syntax-entry ?\} "){" YaTeX-mode-syntax-table))
 
 ;---------- Provide YaTeX-mode ----------
 ;;;
@@ -549,19 +550,11 @@
 	    ))
   (cond ((boundp 'MULE)
 	 (set-file-coding-system  YaTeX-coding-system))
-	((and YaTeX-emacs-20 (fboundp 'coding-system-equal))
-	 (let ((mp (buffer-modified-p))
-	       (ud (memq
-		    buffer-file-coding-system
-		    '(undecided undecided-unix undecided-dos undecided-mac))))
-	   (if (coding-system-equal
-		YaTeX-coding-system buffer-file-coding-system)
-	       nil ; if coding-system is the same, do nothing
-	     (set-buffer-file-coding-system YaTeX-coding-system)
-	     (if ud (set-buffer-modified-p mp)))))
+	((and YaTeX-emacs-20 (boundp 'buffer-file-coding-system))
+	 (setq buffer-file-coding-system YaTeX-coding-system))
 	((featurep 'mule)
 	 (set-file-coding-system YaTeX-coding-system))
-  	((boundp 'NEMACS)
+	((boundp 'NEMACS)
 	 (make-local-variable 'kanji-fileio-code)
 	 (setq kanji-fileio-code YaTeX-kanji-code)))
   (setq fill-column YaTeX-fill-column
@@ -582,8 +575,7 @@
   (and (= 0 (buffer-size)) (file-exists-p YaTeX-template-file)
        (y-or-n-p (format "Insert %s?" YaTeX-template-file))
        (insert-file-contents (expand-file-name YaTeX-template-file)))
-  (run-hooks 'text-mode-hook 'yatex-mode-hook)
-)
+  (run-hooks 'text-mode-hook 'yatex-mode-hook))
 
 ;---------- Define YaTeX-mode functions ----------
 (defvar YaTeX-ec "\\" "Escape character of current mark-up language.")
@@ -625,6 +617,12 @@
 (autoload 'YaTeX-in-math-mode-p "yatexmth" "Check if in math-env." t)
 (autoload 'YaTeX-toggle-math-mode "yatexmth" "YaTeX math-mode interfaces." t)
 (autoload 'YaTeX-math-member-p "yatexmth" "Check if a word is math command." t)
+(autoload 'YaTeX-insert-amsparens-region "yatexmth" "AMS parens region" t)
+(autoload 'YaTeX-insert-amsbraces-region "yatexmth" "AMS braces region" t)
+(autoload 'YaTeX-insert-amsbrackets-region "yatexmth" "AMS brackets region" t)
+(autoload 'YaTeX-on-parenthesis-p "yatexmth" "Check if on math-parens" t)
+(autoload 'YaTeX-goto-open-paren "yatexmth" "Goto opening paren" t)
+(autoload 'YaTeX-change-parentheses "yatexmth" "Change corresponding parens" t)
 
 ;;autoload from yatexhlp.el
 (autoload 'YaTeX-help "yatexhlp" "YaTeX helper with LaTeX commands." t)
@@ -635,6 +633,7 @@
 (autoload 'YaTeX-generate-simple "yatexgen" "YaTeX add-in support." t)
 
 ;;autoload from yatexsec.el
+(autoload 'YaTeX-section-overview "yatexsec" "YaTeX sectioning(view)" t)
 (autoload 'YaTeX-read-section-in-minibuffer "yatexsec" "YaTeX sectioning" t)
 (autoload 'YaTeX-make-section-with-overview "yatexsec" "YaTeX sectioning" t)
 
@@ -704,8 +703,7 @@
       (YaTeX-intelligent-newline nil)
       (YaTeX-indent-line))
     (if YaTeX-current-position-register
-	(point-to-register YaTeX-current-position-register)))
-)
+	(point-to-register YaTeX-current-position-register))))
 
 (defun YaTeX-make-begin-end (arg)
   "Make LaTeX environment command of \\begin{env.} ... \\end{env.}
@@ -724,14 +722,12 @@
     (setq env-name env)
     (YaTeX-update-table
      (list env-name) 'env-table 'user-env-table 'tmp-env-table)
-    (YaTeX-insert-begin-end env-name arg))
-)
+    (YaTeX-insert-begin-end env-name arg)))
 
 (defun YaTeX-make-begin-end-region ()
   "Call YaTeX-make-begin-end with ARG to specify region mode."
   (interactive)
-  (YaTeX-make-begin-end t)
-)
+  (YaTeX-make-begin-end t))
 
 (defun YaTeX-make-section (arg &optional beg end cmd)
   "Make LaTeX \\section{} type command with completing read.
@@ -813,14 +809,12 @@
 	  (forward-char -1))
 	(while (string= (buffer-substring (- (point) 3) (1- (point))) "{}")
 	  (forward-char -2)))
-    (if (<= (minibuffer-depth) 0) (use-global-map global-map)))
-)
+    (if (<= (minibuffer-depth) 0) (use-global-map global-map))))
 
 (defun YaTeX-make-section-region (args beg end)
   "Call YaTeX-make-section with arguments to specify region mode."
  (interactive "P\nr")
- (YaTeX-make-section args beg end)
-)
+ (YaTeX-make-section args beg end))
 
 (defun YaTeX-make-fontsize (arg &optional fontsize)
   "Make completion like {\\large ...} or {\\slant ...} in minibuffer.
@@ -856,14 +850,12 @@
       (if YaTeX-current-position-register
 	  (point-to-register YaTeX-current-position-register))
       (save-excursion
-	(insert (YaTeX-addin fontsize-name) "}"))))
-)
+	(insert (YaTeX-addin fontsize-name) "}")))))
 
 (defun YaTeX-make-fontsize-region ()
   "Call function:YaTeX-make-fontsize with ARG to specify region mode."
   (interactive)
-  (YaTeX-make-fontsize t)
-)
+  (YaTeX-make-fontsize t))
 
 (defvar YaTeX-singlecmd-suffix "" "*Suffix for maketitle-type commands.")
 (defvar YaTeX-read-singlecmd-history nil "Holds maketitle-type history.")
@@ -895,8 +887,7 @@
     (forward-char -2)
     (if (looking-at "\\[\\]") (forward-char 1) (goto-char q)))
   (if YaTeX-current-position-register
-      (point-to-register YaTeX-current-position-register))
-)
+      (point-to-register YaTeX-current-position-register)))
 
 (defvar YaTeX-completion-begin-regexp "[{\\]"
   "Regular expression of limit where LaTeX command's completion begins.")
@@ -957,8 +948,7 @@
 	    (message "Making completion list...")
 	    (with-output-to-temp-buffer "*Help*"
 	      (display-completion-list
-	       (all-completions pattern all-table))))))))))
-)
+	       (all-completions pattern all-table)))))))))))
 
 (defun YaTeX-toggle-modify-mode (&optional arg)
   (interactive "P")
@@ -971,8 +961,7 @@
 	(message "Modify mode"))
     (setq YaTeX-modify-mode nil)
     (message "Cancel modify mode."))
-  (set-buffer-modified-p (buffer-modified-p))	;redraw mode-line
-)
+  (set-buffer-modified-p (buffer-modified-p)))	;redraw mode-line
 
 (defun YaTeX-switch-mode-menu (arg &optional char)
   (interactive "P")
@@ -983,8 +972,7 @@
      ((or (= c ?$) (= c ?t))
       (if YaTeX-auto-math-mode
 	  (message "Makes no sense in YaTeX-auto-math-mode.")
-	(YaTeX-toggle-math-mode arg)))))
-)
+	(YaTeX-toggle-math-mode arg))))))
 
 (defun YaTeX-insert-quote ()
   (interactive)
@@ -1001,8 +989,7 @@
 	  (regexp-quote (char-to-string (preceding-char)))
 	  "、。,.?!「」『』【】()"))
      "``")
-    (t  "''")))
-)
+    (t  "''"))))
 
 (defun YaTeX-closable-p ()
   (and (not YaTeX-modify-mode)
@@ -1014,7 +1001,7 @@
   ;;    (and (not YaTeX-close-paren-always) (not (eolp)))
   ;;    (input-pending-p)
   ;;    (YaTeX-quick-in-environment-p "verbatim"))
-)
+  )
 
 (defun YaTeX-insert-braces-region (beg end &optional open close)
   (interactive "r")
@@ -1022,8 +1009,7 @@
     (goto-char end)
     (insert (or close "}"))
     (goto-char beg)
-    (insert (or open "{")))
-)
+    (insert (or open "{"))))
 
 (defun YaTeX-insert-braces (arg &optional open close)
   (interactive "p")
@@ -1037,6 +1023,24 @@
 	(looking-at "\\\\left\\\\"))
       (insert "{\\right\\}")
       (forward-char -8))
+     ((save-excursion			;from matsu@math.s.chiba-u.ac.jp
+	(and (> (- (point) (point-min)) 6) (forward-char -6))
+	(looking-at "\\\\[bB]igl\\\\"))
+      (insert
+       (concat
+	"{" (buffer-substring (match-beginning 0) (- (match-end 0) 2)) "r\\}"))
+      (forward-char -7))
+     ((save-excursion
+	(and (> (- (point) (point-min)) 7)
+	     (condition-case () (forward-char -7) (error nil)))
+	(looking-at "\\\\[bB]iggl\\\\"))
+      (insert
+       (concat
+	"{" (buffer-substring (match-beginning 0) (- (match-end 0) 2)) "r\\}"))
+      (forward-char -8))
+     ((= (preceding-char) ?\\ )
+      (insert "{\\}")
+      (forward-char -2))		;matsu's hack ends here
      ((and (> (point) (+ (point-min) 4))
 	   (save-excursion (backward-char 4) (looking-at "\\\\end"))
 	   (not (YaTeX-literal-p))
@@ -1057,13 +1061,11 @@
       (if (and (eq (char-after (point)) ?\})
 	       (eq (char-after (- (point) 2)) ?\\ ))
 	  (progn (insert "\\") (forward-char -1)))
-      )))
-)
+      ))))
 
 (defun YaTeX-jmode ()
   (or (and (boundp 'canna:*japanese-mode*) canna:*japanese-mode*)
-      (and (boundp 'egg:*mode-on*) egg:*mode-on* egg:*input-mode*))
-)
+      (and (boundp 'egg:*mode-on*) egg:*mode-on* egg:*input-mode*)))
 
 (defun YaTeX-jmode-off ()
   (cond
@@ -1072,9 +1074,11 @@
    ((and (boundp 'egg:*mode-on*) egg:*mode-on* egg:*input-mode*)
     (egg:toggle-egg-mode-on-off))
    ((and (fboundp 'skk-mode) (boundp 'skk-mode) skk-mode)
-    (if (fboundp 'skk-mode-off) (skk-mode-off) (j-mode-off)))
-   ((and (fboundp 'fep-force-off) (fep-force-off))))
-)
+    (cond
+     ((fboundp 'skk-latin-mode)	(skk-latin-mode t))
+     ((fboundp 'skk-mode-off)	(skk-mode-off))
+     (t (j-mode-off))))
+   ((and (fboundp 'fep-force-off) (fep-force-off)))))
 
 (defun YaTeX-self-insert (arg)
   (call-interactively (global-key-binding (char-to-string last-command-char))))
@@ -1092,6 +1096,20 @@
 	(looking-at "\\\\left"))
       (insert "[\\right]")
       (forward-char -7))
+     ((save-excursion			;from matsu@math.s.chiba-u.ac.jp
+	(and (> (- (point) (point-min)) 5) (forward-char -5))
+	(looking-at "\\\\[bB]igl"))
+      (insert
+       (concat
+	"[" (buffer-substring (match-beginning 0) (- (match-end 0) 1)) "r]"))
+      (forward-char -6))
+     ((save-excursion
+	(and (> (- (point) (point-min)) 6) (forward-char -6))
+	(looking-at "\\\\[bB]iggl"))
+      (insert
+       (concat
+	"[" (buffer-substring (match-beginning 0) (- (match-end 0) 1)) "r]"))
+      (forward-char -7))		;matsu's hack ends here
      ((and (= (preceding-char) ?\\ )
 	   (/= (char-after (- (point) 2)) ?\\ )
 	   (not (YaTeX-in-math-mode-p)))
@@ -1106,14 +1124,11 @@
      ((YaTeX-closable-p)
       (insert "[]")
       (backward-char 1))
-     (t (YaTeX-self-insert arg)))
-    )
-)
+     (t (YaTeX-self-insert arg)))))
 
 (defun YaTeX-insert-brackets-region (beg end)
   (interactive "r")
-  (YaTeX-insert-braces-region beg end "[" "]")
-)
+  (YaTeX-insert-braces-region beg end "[" "]"))
 
 (defun YaTeX-insert-parens (arg)
   "Insert parenthesis pair."
@@ -1126,19 +1141,85 @@
       (looking-at "\\\\left"))
     (insert "(\\right)")
     (forward-char -7))
-   ((and (= (preceding-char) ?\\ ) (not (YaTeX-in-math-mode-p)))
+   ((save-excursion			;from matsu@math.s.chiba-u.ac.jp
+      (and (> (- (point) (point-min)) 5) (forward-char -5))
+      (looking-at "\\\\[bB]igl"))
+    (insert
+     (concat
+      "(" (buffer-substring (match-beginning 0) (- (match-end 0) 1)) "r)"))
+     (forward-char -6))
+   ((save-excursion
+      (and (> (- (point) (point-min)) 6) (forward-char -6))
+      (looking-at "\\\\[bB]iggl"))
+    (insert
+     (concat
+      "(" (buffer-substring (match-beginning 0) (- (match-end 0) 1)) "r)"))
+     (forward-char -7))
+   ((= (preceding-char) ?\\ )		;matsu's hack ends here
     (insert "(\\)")
     (backward-char 2))
    ((YaTeX-closable-p)
     (insert "()")
     (backward-char 1))
-   (t (YaTeX-self-insert arg)))
-)
+   (t (YaTeX-self-insert arg))))
 
 (defun YaTeX-insert-parens-region (beg end)
   (interactive "r")
-  (YaTeX-insert-braces-region beg end "(" ")")
-)
+  (YaTeX-insert-braces-region beg end "(" ")"))
+
+(defun YaTeX-insert-bar (arg)
+  "Insert bar pair."
+  (interactive "p")
+  (cond
+   ((YaTeX-jmode) (YaTeX-self-insert arg))
+   ((not (YaTeX-closable-p)) (YaTeX-self-insert arg))
+   ((save-excursion
+      (and (> (- (point) (point-min)) 5) (forward-char -5))
+      (looking-at "\\\\left"))
+    (insert "|\\right|")
+    (forward-char -7))
+   ((save-excursion			;from matsu@math.s.chiba-u.ac.jp
+      (and (> (- (point) (point-min)) 5) (forward-char -5))
+      (looking-at "\\\\[bB]igl"))
+    (insert
+     (concat
+      "|" (buffer-substring (match-beginning 0) (- (match-end 0) 1)) "r|"))
+     (forward-char -6))
+   ((save-excursion
+      (and (> (- (point) (point-min)) 6) (forward-char -6))
+      (looking-at "\\\\[bB]iggl"))
+    (insert
+     (concat
+      "|" (buffer-substring (match-beginning 0) (- (match-end 0) 1)) "r|"))
+     (forward-char -7))
+   ((save-excursion		; added by Jin <MAF01011@nifty.ne.jp>
+      (and (> (- (point) (point-min)) 6) (forward-char -6))
+      (looking-at "\\\\left\\\\"))
+    (insert "|\\right\\|")
+    (forward-char -8))
+   ((save-excursion
+      (and (> (- (point) (point-min)) 6) (forward-char -6))
+      (looking-at "\\\\[bB]igl\\\\"))
+    (insert
+     (concat
+      "|" (buffer-substring (match-beginning 0) (- (match-end 0) 2)) "r\\|"))
+     (forward-char -7))
+   ((save-excursion
+      (and (> (- (point) (point-min)) 7) (forward-char -7))
+      (looking-at "\\\\[bB]iggl\\\\"))
+    (insert
+     (concat
+      "|" (buffer-substring (match-beginning 0) (- (match-end 0) 2)) "r\\|"))
+     (forward-char -8))		; added by Jin up to here.
+   ((= (preceding-char) ?\\ )
+    (insert "|\\|")
+    (backward-char 2))
+;   ((and (YaTeX-closable-p)
+;	 (/= (preceding-char) ?|)
+;	 (/= (following-char) ?|))
+;    (insert "||")
+;    (backward-char 1))
+   (t (YaTeX-self-insert arg))))
 
 (defun YaTeX-insert-dollar ()
   (interactive)
@@ -1150,13 +1231,11 @@
     (insert "$$")
     (forward-char -1)
     (YaTeX-jmode-off)
-    (or YaTeX-auto-math-mode YaTeX-math-mode (YaTeX-toggle-math-mode 1)))
-)
+    (or YaTeX-auto-math-mode YaTeX-math-mode (YaTeX-toggle-math-mode 1))))
 
 (defun YaTeX-insert-dollars-region (beg end)
   (interactive "r")
-  (YaTeX-insert-braces-region beg end "$" "$")
-)
+  (YaTeX-insert-braces-region beg end "$" "$"))
 
 (defun YaTeX-insert-amper ()
   (interactive)
@@ -1165,8 +1244,7 @@
 	  (= (preceding-char) 92)
 	  (YaTeX-literal-p))
       (insert "&")
-    (insert "\\&"))
-)
+    (insert "\\&")))
 
 (defun YaTeX-version ()
   "Return string of the version of running YaTeX."
@@ -1175,8 +1253,7 @@
    (concat "Yet Another tex-mode "
 	   (if YaTeX-japan "「野鳥」" "`Wild Bird'")
 	   " Revision "
-	   YaTeX-revision-number))
-)
+	   YaTeX-revision-number)))
 
 (defun YaTeX-typeset-menu (arg &optional char)
   "Typeset, preview, visit error and miscellaneous convenient menu.
@@ -1205,8 +1282,7 @@
      ((= c ?l) (YaTeX-lpr arg))
      ((= c ?m) (YaTeX-switch-mode-menu arg))
      ((= c ?b) (YaTeX-insert-string "\\"))
-     ((= c ?s) (YaTeX-xdvi-remote-search arg))))
-)
+     ((= c ?s) (YaTeX-xdvi-remote-search arg)))))
 
 (defun YaTeX-%-menu (&optional beg end char)
   "Operate %# notation."
@@ -1248,8 +1324,7 @@
 	(insert "%#END\n")
 	(set-marker b nil)
 	(set-marker e nil))
-       )))
-)
+       ))))
 
 (defun YaTeX-goto-corresponding-label (reverse &optional otherwin)
   "Jump to corresponding \\label{} and \\ref{} or \\cite and \\bibitem.
@@ -1342,8 +1417,7 @@
 	  (setq regexp-search-ring
 		(cons string (delete string regexp-search-ring)))
 	(setq search-last-regexp string)))
-     (t nil)))
-)
+     (t nil))))
 
 (defun YaTeX-goto-corresponding-environment (&optional allow-mismatch noerr)
   "Go to corresponding begin/end enclosure.
@@ -1406,8 +1480,7 @@
 	       (if noerr 'message 'error)
 	       "Corresponding environment `%s' not found." env)
 	      (sit-for 1)
-	      nil)))))
-)
+	      nil))))))
 
 (defun YaTeX-goto-corresponding-file (&optional other)
   "Visit or switch buffer of corresponding file,
@@ -1429,8 +1502,7 @@
        (t (YaTeX-switch-to-buffer input-file)))
       (or (YaTeX-get-builtin "!")
 	  YaTeX-parent-file
-	  (setq YaTeX-parent-file parent))))
-)
+	  (setq YaTeX-parent-file parent)))))
 
 (defun YaTeX-goto-corresponding-BEGIN-END ()
   (if (not (YaTeX-on-BEGIN-END-p)) nil
@@ -1441,8 +1513,7 @@
 	  (not (search-backward "%#BEGIN" nil t))))
 	(error "Corresponding %%#BEGIN/END not found."))
     (beginning-of-line)
-    t)
-)
+    t))
 
 (defvar YaTeX-processed-file-regexp-alist nil
   "Alist of regexp of processed file regexp vs. its file name part;
@@ -1479,13 +1550,12 @@
     ("\\\\\\(psbox\\)\\(\\[[^]]+\\]\\)?{\\(\\([^,} ]*/\\)?[^} ]+\\)\\(\\.e?ps\\)}" 3) ;\psbox[options...]{hoge.eps} (97/1/11)
     ("\\\\input{\\([^} ]+\\)\\(\\.tps\\)}" 1) ;tgif2tex (1998/9/16)
     )
-  "See the documentation of YaTeX-processed-file-regexp-alist."
-)
+  "See the documentation of YaTeX-processed-file-regexp-alist.")
 
 (defvar YaTeX-file-processor-alist nil
   "*Alist of files' processor vs. its extension;
-See also the documentation of YaTeX-processed-file-regexp-alist."
-)  
+See also the documentation of YaTeX-processed-file-regexp-alist.")
+  
 (defvar YaTeX-file-processor-alist-default
   '(("tgif" . ".obj")
     ("ghostview" . ".ps")
@@ -1493,8 +1563,7 @@
     (t . ".tex")
     (t . ".sty")
     (t . ""))
-  "See the documentation of YaTeX-file-processor-alist."
-)
+  "See the documentation of YaTeX-file-processor-alist.")
 
 (defun YaTeX-goto-corresponding-file-processor (&optional other)
   "Execute corresponding file processor."
@@ -1558,8 +1627,7 @@
 		  (cond
 		   ((symbol-function cmd)
 		    (funcall cmd src other)))
-		  t)))))))
-)
+		  t))))))))
 
 (defun YaTeX-on-section-command-p (command)
   "Check if point is on the LaTeX command: COMMAND(regexp).
@@ -1606,8 +1674,7 @@
 		     (>= p (match-beginning i)) (< p (match-end i)))
 		-1			;return -1 if point is on optional arg
 	      (if (< p (point)) parg))
-	    ))))
-)
+	    )))))
 
 (defun YaTeX-on-maketitle-p ()
   "Check if point is on maketitle type commands.
@@ -1636,15 +1703,13 @@
       (YaTeX-replace-format-args
        (regexp-quote YaTeX-struct-end)
        (concat "\\(" YaTeX-struct-name-regexp "\\)") "" "" ""))
-     (point-end-of-line) t))
-)
+     (point-end-of-line) t)))
 
 (defun YaTeX-on-includes-p ()
   (save-excursion
     (beginning-of-line)
     (re-search-forward "\\(\\(include.*\\)\\|\\(input\\)\\){.*}"
-		       (point-end-of-line) t))
-)
+		       (point-end-of-line) t)))
 
 (defun YaTeX-on-comment-p (&optional sw)
   "Return t if current line is commented out.
@@ -1653,15 +1718,14 @@
   (save-excursion
     (beginning-of-line)
     (skip-chars-forward "\\s ")
-    (looking-at (if sw "%" "%[^#]")))
-)
+    (looking-at (if sw "%" "%[^#]"))))
 
 (defun YaTeX-on-BEGIN-END-p ()
   (save-excursion
     (let ((case-fold-search nil))
       (beginning-of-line)
-      (re-search-forward "\\(%#BEGIN\\)\\|\\(%#END\\)" (point-end-of-line) t)))
-)
+      (re-search-forward
+       "\\(%#BEGIN\\)\\|\\(%#END\\)" (point-end-of-line) t))))
 
 (defun YaTeX-goto-corresponding-* (arg)
   "Parse current line and call suitable function."
@@ -1676,8 +1740,7 @@
 	  YaTeX-equation-env-regexp	;to delay loading
 	  (or (YaTeX-inner-environment t) "document"))
 	 (YaTeX-goto-corresponding-leftright)))
-   (t (message "I don't know where to go.")))
-)
+   (t (message "I don't know where to go."))))
 
 (defun YaTeX-goto-corresponding-*-other-window (arg)
   "Parse current line and call suitable function."
@@ -1687,8 +1750,7 @@
    ;;((YaTeX-goto-corresponding-environment))
    ((YaTeX-goto-corresponding-file t))
    ;;((YaTeX-goto-corresponding-BEGIN-END))
-   (t (message "I don't know where to go.")))
-)
+   (t (message "I don't know where to go."))))
 
 (defun YaTeX-comment-region (alt-prefix)
   "Comment out region by '%'.
@@ -1700,8 +1762,7 @@
        (if alt-prefix
 	   (read-string "Insert prefix: ")
 	 YaTeX-comment-prefix))
-    (YaTeX-comment-uncomment-env 'comment-out-region))
-)
+    (YaTeX-comment-uncomment-env 'comment-out-region)))
 
 (defun YaTeX-uncomment-region (alt-prefix)
   "Uncomment out region by '%'."
@@ -1711,8 +1772,7 @@
        (if alt-prefix (read-string "Remove prefix: ")
 	 YaTeX-comment-prefix)
        (region-beginning) (region-end) YaTeX-uncomment-once)
-    (YaTeX-comment-uncomment-env 'uncomment-region))
-)
+    (YaTeX-comment-uncomment-env 'uncomment-region)))
 
 (defun YaTeX-comment-uncomment-env (func)
   "Comment or uncomment out one LaTeX environment switching function by FUNC."
@@ -1725,8 +1785,7 @@
       (if (> p (point)) (setq beg (1+ beg)) (forward-char 1))
       (funcall func YaTeX-comment-prefix beg (point) YaTeX-uncomment-once)))
   (message "%sommented out current environment."
-	   (if (eq func 'comment-out-region) "C" "Un-c"))
-)
+	   (if (eq func 'comment-out-region) "C" "Un-c")))
 
 (defun YaTeX-beginning-of-environment (&optional limit-search-bound end)
   "Goto the beginning of the current environment.
@@ -1740,16 +1799,14 @@
 	  (goto-char (get 'YaTeX-inner-environment 'point))
 	  (and end (YaTeX-goto-corresponding-environment))
 	  (if (interactive-p) (push-mark op))
-	  t)))
-)
+	  t))))
 
 (defun YaTeX-end-of-environment (&optional limit-search-bound)
   "Goto the end of the current environment.
 Optional argument LIMIT-SEARCH-BOUND non-nil limits the search bound
 to most recent sectioning command."
   (interactive)
-  (YaTeX-beginning-of-environment limit-search-bound t)
-)
+  (YaTeX-beginning-of-environment limit-search-bound t))
 
 (defun YaTeX-mark-environment ()
   "Mark current position and move point to end of environment."
@@ -1773,8 +1830,7 @@
       (set-mark-command nil)
       (YaTeX-goto-corresponding-environment)
       (end-of-line)
-      (if (eobp) nil (forward-char 1))))
-)
+      (if (eobp) nil (forward-char 1)))))
 
 (defun YaTeX-comment-paragraph ()
   "Comment out current paragraph."
@@ -1792,8 +1848,7 @@
      (t
       (mark-paragraph)
       (if (looking-at paragraph-separate) (forward-line 1))
-      (comment-out-region "%"))))
-)
+      (comment-out-region "%")))))
 
 (defun YaTeX-uncomment-paragraph ()
   "Uncomment current paragraph."
@@ -1816,8 +1871,7 @@
 	    (mark-paragraph)
 	    (if (not (bobp)) (forward-line 1))
 	    (uncomment-region "%" nil nil YaTeX-uncomment-once))
-	(message "This line is not a comment line."))))
-)
+	(message "This line is not a comment line.")))))
 
 (defun YaTeX-remove-prefix (prefix &optional once)
   "Remove prefix on current line as far as prefix detected. But
@@ -1826,8 +1880,7 @@
   (beginning-of-line)
   (while (re-search-forward (concat "^" prefix) (point-end-of-line) t)
     (replace-match "")
-    (if once (end-of-line)))
-)
+    (if once (end-of-line))))
 
 (defun YaTeX-kill-some-pairs (predicate gofunc kill-contents)
   "Kill some matching pair.
@@ -1878,8 +1931,7 @@
 	  (kill-region
 	   (if (bolp) (point) b1)
 	   e2)))
-      t))
-)
+      t)))
 
 (defun YaTeX-kill-section-command (point kill-all)
   "Kill section-type command at POINT leaving its argument.
@@ -1902,8 +1954,7 @@
 	(goto-char end)
 	(set-marker end nil)
 	(kill-append (buffer-substring (point) (1- (point))) nil)
-	(delete-backward-char 1))))
-)
+	(delete-backward-char 1)))))
 
 (defun YaTeX-kill-paren (kill-contents)
   "Kill parentheses leaving its contents.
@@ -1927,8 +1978,7 @@
 		   (point)
 		   (progn (re-search-forward "\\s +" nil t) (point)))
 		(delete-char 1)))
-	    t))))
-)
+	    t)))))
 
 (defvar YaTeX-read-environment-history nil "Holds history of environments.")
 (put 'YaTeX-read-environment-history 'no-default t)
@@ -1939,8 +1989,7 @@
    prompt
    (append tmp-env-table user-env-table env-table)
    predicate must-match initial
-   'YaTeX-read-environment-history)
-)
+   'YaTeX-read-environment-history))
 
 (defvar YaTeX-read-section-history nil "Holds history of section-types.")
 (put 'YaTeX-read-section-history 'no-default t)
@@ -1951,8 +2000,7 @@
 	 (append tmp-section-table user-section-table section-table)))
     (read-from-minibuffer-with-history
      prompt initial YaTeX-section-completion-map nil
-     'YaTeX-read-section-history))
-)
+     'YaTeX-read-section-history)))
 
 (defun YaTeX-read-section-with-overview ()
   "Read sectioning command with overview.
@@ -1974,9 +2022,7 @@
     (if (eq (selected-window) (minibuffer-window))
 	(erase-buffer))
     (insert sect)
-    (exit-minibuffer)
-    )
-)
+    (exit-minibuffer)))
 
 (defvar YaTeX-read-fontsize-history nil "Holds history of font designator.")
 (put 'YaTeX-read-fontsize-history 'no-default t)
@@ -1985,8 +2031,7 @@
   (YaTeX-sync-local-table 'tmp-fontsize-table)
   (completing-read-with-history
    prompt (append tmp-fontsize-table user-fontsize-table fontsize-table)
-   predicate must-match initial 'YaTeX-read-fontsize-history)
-)
+   predicate must-match initial 'YaTeX-read-fontsize-history))
 
 (defun YaTeX-change-environment ()
   "Change the name of environment."
@@ -2010,8 +2055,7 @@
 	  (exchange-point-and-mark)
 	  (search-forward (concat "{" env) (point-end-of-line) t)
 	  (replace-match (concat "{" newenv) t)))
-	t)))
-)
+	t))))
 
 (defun YaTeX-change-section ()
   "Change section-type command."
@@ -2061,8 +2105,7 @@
       (goto-char beg)
       (insert-before-markers new)
       ;;(goto-char (marker-position p))
-      new))
-)
+      new)))
 
 (defun YaTeX-change-fontsize ()
   "Change large-type command."
@@ -2091,8 +2134,7 @@
 	(insert-before-markers new)
 	new)
        (t nil)
-       )))
-)
+       ))))
 
 (defun YaTeX-change-math-image ()
   "Change with image completion."
@@ -2118,8 +2160,7 @@
    ((YaTeX-on-section-command-p YaTeX-command-token-regexp);on any command
     (YaTeX-kill-section-command (match-beginning 0) arg))
    ((YaTeX-kill-paren arg))
-   (t (message "I don't know what to kill.")))
-)
+   (t (message "I don't know what to kill."))))
 
 (defun YaTeX-change-* ()
   "Parse current line and call suitable function."
@@ -2129,8 +2170,8 @@
    ((YaTeX-change-section))
    ((YaTeX-change-fontsize))
    ((YaTeX-change-math-image))
-   (t (message "I don't know what to change.")))
-)
+   ((YaTeX-change-parentheses))
+   (t (message "I don't know what to change."))))
 
 ;;;
 ;Check availability of add-in functions
@@ -2147,8 +2188,8 @@
 	   (fboundp (intern-soft (concat YaTeX-addin-prefix name))))
       (let ((s (funcall (intern (concat YaTeX-addin-prefix name)))))
 	(if (stringp s) s ""))
-    "") ;Add in function is not bound.
-)
+    "")) ;Add in function is not bound.
+
 
 (defun YaTeX-on-item-p (&optional point)
   "Return t if POINT (default is (point)) is on \\item."
@@ -2158,8 +2199,7 @@
       (end-of-line)
       (setq p (point))
       (re-search-backward YaTeX-paragraph-delimiter nil t)
-      (re-search-forward YaTeX-item-regexp p t)))
-)
+      (re-search-forward YaTeX-item-regexp p t))))
 
 (defun YaTeX-in-verb-p (&optional point)
   "Check if POINT is in verb or verb*.  Default of POINT is (point)."
@@ -2175,8 +2215,7 @@
       (goto-char (match-end 2))
       (skip-chars-forward
        (concat "^" (buffer-substring (match-beginning 2) (match-end 2))))
-      (and (< (match-beginning 2) point) (< (1- point) (point)))))
-)
+      (and (< (match-beginning 2) point) (< (1- point) (point))))))
 
 (defun YaTeX-literal-p (&optional point)
   "Check if POINT is in verb or verb* or verbatime environment family.
@@ -2187,8 +2226,7 @@
       (and point (goto-char point))
       (or (YaTeX-in-verb-p (point))
 	  (and (not (looking-at "\\\\end{verb"))
-	       (YaTeX-quick-in-environment-p YaTeX-verbatim-environments))))))
-)
+	       (YaTeX-quick-in-environment-p YaTeX-verbatim-environments)))))))
 
 (defun YaTeX-in-environment-p (env)
   "Return if current LaTeX environment is ENV.
@@ -2220,8 +2258,7 @@
 		(and (cdr env) (YaTeX-in-environment-p (cdr env)))))))
     (store-match-data md)
     p;(or p (YaTeX-in-verb-p (match-beginning 0)))
-    )
-)
+    ))
 
 (defun YaTeX-quick-in-environment-p (env)
   "Check quickly but unsure if current environment is ENV.
@@ -2242,8 +2279,7 @@
 			    YaTeX-struct-end env)
 			   YaTeX-comment-prefix p t nil))))
 	(store-match-data md)
-	rc))))
-)
+	rc)))))
 
 ;; Filling \item
 (defun YaTeX-remove-trailing-comment (start end)
@@ -2253,8 +2289,7 @@
       (goto-char start)
       (while (re-search-forward trcom end t)
 	(if (/= (char-after (1- (match-beginning 0))) ?\\ )
-	    (replace-match "\\1")))))
-)
+	    (replace-match "\\1"))))))
 
 (defun YaTeX-get-item-info (&optional recent thisenv)
   "Return the list of the beginning of \\item and column of its item.
@@ -2281,8 +2316,7 @@
 	      (if (equal (following-char) ?\[) (forward-list 1))
 	      (setq c 0))
 	    (skip-chars-forward " \t" (point-end-of-line))
-	    (list (point-beginning-of-line) (+ c (current-column)))))))
-)
+	    (list (point-beginning-of-line) (+ c (current-column))))))))
 
 (defun YaTeX-fill-item ()
   "Fill item in itemize environment."
@@ -2334,8 +2368,7 @@
 	  (if NTT-jTeX
 	      (while (progn(forward-line -1)(end-of-line) (> (point) start))
 		(insert ?%)))
-	  (pop-mark)))))
-)
+	  (pop-mark))))))
 
 (defun YaTeX-fill-paragraph (arg)
   "YaTeX adjustment function for fill-paragraph.
@@ -2410,8 +2443,7 @@
 		  (forward-line 1))
 		(goto-char p)
 		(if (looking-at "%") (delete-char 1)) ;remove last inserted `%'
-		)))))))
-)
+		))))))))
 
 (if (fboundp 'YaTeX-saved-indent-new-comment-line) nil
   (fset 'YaTeX-saved-indent-new-comment-line
@@ -2421,6 +2453,7 @@
 (defun YaTeX-indent-new-comment-line (&optional soft)
   "Tuned `indent-new-comment-line' function for yatex.
 See the documentation of `YaTeX-saved-indent-new-comment-line'."
+  (interactive)
   (cond
    ((or (not (memq major-mode '(yatex-mode yahtml-mode)))
 	(string-match
@@ -2435,16 +2468,14 @@
    ((and (eq major-mode 'yatex-mode)	;1997/2/4
 	 (YaTeX-in-math-mode-p)) nil)		;1996/12/30
    (t (let (fill-prefix)
-	(apply 'YaTeX-saved-indent-new-comment-line (if soft (list soft))))))
-)
+	(apply 'YaTeX-saved-indent-new-comment-line (if soft (list soft)))))))
 
 (defun YaTeX-fill-* ()
   "Fill paragraph according to its condition."
   (interactive)
   (cond
    ((YaTeX-fill-item))
-   )
-)
+   ))
 
 ;; Accent completion
 (defun YaTeX-read-accent-char (x)
@@ -2454,8 +2485,7 @@
      (if (and (or (= c ?i) (= c ?j))
 	      (not (string-match (regexp-quote x) "cdb")))
 	 "\\" "")
-     (char-to-string c)))
-)
+     (char-to-string c))))
 
 (defun YaTeX-make-accent ()
   "Make accent usage."
@@ -2471,8 +2501,7 @@
       (backward-char 1)
       (insert (YaTeX-read-accent-char c))
       (if (string= c "t") (insert (YaTeX-read-accent-char c)))
-      (forward-char 1)))
-)
+      (forward-char 1))))
 
 ;; Indentation
 (defun YaTeX-current-indentation ()
@@ -2484,8 +2513,7 @@
       (forward-line -1)
       (beginning-of-line)
       (skip-chars-forward " \t"))
-    (current-column))
-)
+    (current-column)))
 
 (defun YaTeX-previous-line-indentation ()
   (save-excursion
@@ -2612,8 +2640,7 @@
 		(save-excursion
 		  (backward-word 1)
 		  (looking-at "\\sw+")) ;is not japanese string
-		(insert YaTeX-comment-prefix))))))
-)
+		(insert YaTeX-comment-prefix)))))))
 
 (provide 'yatex)
 (defvar yatex-mode-load-hook nil
--- a/yatex.new	Mon Oct 26 12:05:32 1998 +0000
+++ b/yatex.new	Thu Jul 15 04:58:26 1999 +0000
@@ -1,6 +1,33 @@
-	What's new in YaTeX
+	What's new in YaTeX/yahtml
 	野鳥/yahtml - 各バージョンの変更点について
 
+1.67	[[[ http://www.yatex.org/ が誕生しました ]]]
+	=== yahtml ===
+	href入力でSPCなどのunsafe-charを%エンコードに置換するかを
+	yahtml-escape-chars で選べるようにした。nilならしない、tなら常に、
+	'ask なら確認する。デフォルトは 'ask。
+	初回href入力時に yahtml-urls を補完候補に入れてなかったのを修正。
+	[prefix] ; でリジョン中の <>'"& をエンティティ参照に変換、
+	[prefix] : で逆変換する機能を追加。
+	yahtml-translate-hyphens-when-comment-region が non-nil のときに
+	領域コメントアウトで - を &#45; に変換。
+	yahtml-prefer-upcase-attributes が non-nil のとき属性名を大文字に。
+	カレントまたは上位ディレクトリに .htaccess ファイルがありその中に
+	  AddType "text/html; charset=XXXX" .html
+	宣言があれば編集するHTMLソースの漢字コードもその宣言に合わせる。
+	<style>をデフォルト補完候補にいれ type 属性を入れるアドイン作成。
+	yahtml-insert-begend-region で領域を括った後の状態のリジョンが
+	括った環境全体になるようにした。つまり続けて insert-begend-region
+	すると括った直後の環境をさらに括ることが出来る。
+	スタイルシート(に関する補完)対応(ローカルファイルにあるもののみ)。
+	[prefix] s で<link>タグ補完。type="text/css" などの補完可。
+	[prefix] c で属性代入値をどこでも変更できるようにした。
+	=== yatex ===
+	数式モードで \left の直後に ( | [ を入れたときには自動的に対応す
+	る \right ) | ] を挿入するようにした。
+	[prefix] c で \right\left の括弧の組をまとめて変更できるようにし
+	た(by 千葉大松田さん)。
+
 1.66	\section*{} などの*つきセクションコマンドでインデントがずれるの
 	を修正。
 	[prefix] g でのlabel/ref検索をre-searchにしpagerefにも飛べるよう
--- a/yatex19.el	Mon Oct 26 12:05:32 1998 +0000
+++ b/yatex19.el	Thu Jul 15 04:58:26 1999 +0000
@@ -1,7 +1,7 @@
 ;;; -*- Emacs-Lisp -*-
 ;;; YaTeX facilities for Emacs 19
-;;; (c )1994-1997 by HIROSE Yuuji.[yuuji@ae.keio.ac.jp]
-;;; Last modified Thu Jan 29 10:55:12 1998 on crx
+;;; (c )1994-1999 by HIROSE Yuuji.[yuuji@gentei.org]
+;;; Last modified Thu Apr 29 18:40:26 1999 on firestorm
 ;;; $Id$
 
 ;;; とりあえず hilit19 を使っている時に色が付くようにして
@@ -230,16 +230,23 @@
 (defun YaTeX-19-region-section-type (pattern)
   "Return list of starting and end point of section-type commands of PATTERN."
   (if (re-search-forward pattern nil t)
-      (let ((m0 (match-beginning 0)) cmd (argc 1))
+      (let ((m0 (match-beginning 0)) (e0 (match-end 0)) cmd (argc 1))
 	(setq cmd (substring (YaTeX-match-string 0) 1)
 	      argc (or (car (cdr (YaTeX-lookup-table cmd 'section))) argc))
-	(cons m0
-	      (progn ;(skip-chars-backward "^{") (forward-char -2)
-		     (while (> argc 0)
-		       (skip-chars-forward "^{")
-		       (forward-list 1)
-		       (setq argc (1- argc)))
-		     (point))))))
+	(if (= argc 0) (cons m0 (point)) ;引数個数0ならマッチした領域
+	  (skip-chars-forward " \n\t*")
+	  (while (looking-at "\\[") (forward-list 1)) ;optionならスキップ
+	  (skip-chars-forward " \n\t")
+	  (if (looking-at "{")		;{}が始まるならちゃんとしたsection型
+	      (cons m0
+		    (progn ;(skip-chars-backward "^{") (forward-char -2)
+		      (while (> argc 0)
+			(skip-chars-forward "^{")
+			(forward-list 1)
+			(setq argc (1- argc)))
+		      (point)))
+	    ;{}でないならたぶん \verb 環境などにあるダミー
+	    (cons m0 e0))))))
 
 (defun YaTeX-19-region-large-type (pattern)
   "Return list of large-type contents.
@@ -379,7 +386,7 @@
 		list YaTeX-sectioning-level)
 	  (while list
 	    (setq pat (concat YaTeX-ec-regexp (car (car list))
-			      ;"\\*?\\(\\[[^]]*\\]\\)?\\>"
+			      ;"\\*?\\(\\[[^]]*\\]\\)?\\>" ;改行はさむと駄目
 			      "\\>"
 			      )
 		  level (cdr (car list))
--- a/yatexadd.el	Mon Oct 26 12:05:32 1998 +0000
+++ b/yatexadd.el	Thu Jul 15 04:58:26 1999 +0000
@@ -1,8 +1,8 @@
 ;;; -*- Emacs-Lisp -*-
 ;;; YaTeX add-in functions.
 ;;; yatexadd.el rev.14
-;;; (c )1991-1997 by HIROSE Yuuji.[yuuji@ae.keio.ac.jp]
-;;; Last modified Mon Sep 28 13:03:37 1998 on firestorm
+;;; (c )1991-1999 by HIROSE Yuuji.[yuuji@gentei.org]
+;;; Last modified Tue Jul 13 13:57:45 1999 on firestorm
 ;;; $Id$
 
 ;;;
@@ -10,14 +10,14 @@
 ;;;
 (defvar YaTeX:tabular-default-rule
   "@{\\vrule width 1pt\\ }c|c|c@{\\ \\vrule width 1pt}"
-  "*Your favorite default rule format."
-)
+  "*Your favorite default rule format.")
+
 (defvar YaTeX:tabular-thick-vrule "\\vrule width %s"
-  "*Vertical thick line format (without @{}).  %s'll be replaced by its width."
-)
+  "*Vertical thick line format (without @{}). %s'll be replaced by its width.")
+
 (defvar YaTeX:tabular-thick-hrule "\\noalign{\\hrule height %s}"
-  "*Horizontal thick line format.  %s will be replaced by its width."
-)
+  "*Horizontal thick line format.  %s will be replaced by its width.")
+
 (defun YaTeX:tabular ()
   "YaTeX add-in function for tabular environment.
 Notice that this function refers the let-variable `env' in
@@ -53,13 +53,12 @@
     (setq rule (read-string "rule format: " rule))
     (setq single-command "hline")
 
-    (format "%s%s{%s}" width loc rule))
-)
+    (format "%s%s{%s}" width loc rule)))
+
 (fset 'YaTeX:tabular* 'YaTeX:tabular)
 (defun YaTeX:array ()
   (concat (YaTeX:read-position "tb")
-	  "{" (read-string "Column format: ") "}")
-)
+	  "{" (read-string "Column format: ") "}"))
 
 (defun YaTeX:read-oneof (oneof)
   (let ((pos "") loc (guide ""))
@@ -82,21 +81,18 @@
 	(message "Please input one of `%s'." oneof)
 	(sit-for 3))))
     (message "")
-    pos)
-)
+    pos))
 
 (defun YaTeX:read-position (oneof)
   "Read a LaTeX (optional) position format such as `[htbp]'."
   (let ((pos (YaTeX:read-oneof oneof)))
-    (if (string= pos "")  "" (concat "[" pos "]")))
-)
+    (if (string= pos "")  "" (concat "[" pos "]"))))
 
 (defun YaTeX:table ()
   "YaTeX add-in function for table environment."
   (setq env-name "tabular"
 	section-name "caption")
-  (YaTeX:read-position "htbp")
-)
+  (YaTeX:read-position "htbp"))
 
 (fset 'YaTeX:figure 'YaTeX:table)
 (fset 'YaTeX:figure* 'YaTeX:table)
@@ -105,28 +101,25 @@
 (defun YaTeX:description ()
   "Truly poor service:-)"
   (setq single-command "item[]")
-  ""
-)
+  "")
 
 (defun YaTeX:itemize ()
   "It's also poor service."
   (setq single-command "item")
-  ""
-)
+  "")
 
 (fset 'YaTeX:enumerate 'YaTeX:itemize)
 
 (defun YaTeX:picture ()
   "Ask the size of coordinates of picture environment."
   (concat (YaTeX:read-coordinates "Picture size")
-	  (YaTeX:read-coordinates "Initial position"))
-)
+	  (YaTeX:read-coordinates "Initial position")))
 
 (defun YaTeX:equation ()
   (YaTeX-jmode-off)
   (if (fboundp 'YaTeX-toggle-math-mode)
-      (YaTeX-toggle-math-mode t))		;force math-mode ON.
-)
+      (YaTeX-toggle-math-mode t)))		;force math-mode ON.
+
 (mapcar '(lambda (f) (fset f 'YaTeX:equation))
 	'(YaTeX:eqnarray YaTeX:eqnarray* YaTeX:align YaTeX:align*
 	  YaTeX:split YaTeX:multline YaTeX:multline* YaTeX:gather YaTeX:gather*
@@ -135,18 +128,15 @@
 	  YaTeX:xxalignat YaTeX:xxalignat*))
 
 (defun YaTeX:list ()
-  "%\n{} %default label\n{} %formatting parameter"
-)
+  "%\n{} %default label\n{} %formatting parameter")
 
 (defun YaTeX:minipage ()
   (concat (YaTeX:read-position "cbt")
-	  "{" (read-string "Width: ") "}")
-)
+	  "{" (read-string "Width: ") "}"))
 
 (defun YaTeX:thebibliography ()
   (setq section-name "bibitem")
-  ""
-)
+  "")
 
 ;;;
 ;;Sample functions for section-type command.
@@ -154,12 +144,10 @@
 (defun YaTeX:multiput ()
   (concat (YaTeX:read-coordinates "Pos")
 	  (YaTeX:read-coordinates "Step")
-	  "{" (read-string "How many times: ") "}")
-)
+	  "{" (read-string "How many times: ") "}"))
 
 (defun YaTeX:put ()
-  (YaTeX:read-coordinates "Pos")
-)
+  (YaTeX:read-coordinates "Pos"))
 
 (defun YaTeX:makebox ()
   (cond
@@ -172,18 +160,15 @@
 	  (progn
 	    (or (equal (aref width 0) ?\[)
 		(setq width (concat "[" width "]")))
-	    (concat width (YaTeX:read-position "lr")))))))
-)
+	    (concat width (YaTeX:read-position "lr"))))))))
 
 (defun YaTeX:framebox ()
   (if (YaTeX-quick-in-environment-p "picture")
-      (YaTeX:makebox))
-)
+      (YaTeX:makebox)))
 
 (defun YaTeX:dashbox ()
   (concat "{" (read-string "Dash dimension: ") "}"
-	  (YaTeX:read-coordinates "Dimension"))
-)
+	  (YaTeX:read-coordinates "Dimension")))
 
 (defvar YaTeX-minibuffer-quick-map nil)
 (if YaTeX-minibuffer-quick-map nil
@@ -232,8 +217,7 @@
    (read-string (format "%s %s: " (or mes "Dimension") (or varX "X")))
    ","
    (read-string (format "%s %s: " (or mes "Dimension") (or varY "Y")))
-   ")")
-)
+   ")"))
 
 ;;;
 ;;Sample functions for maketitle-type command.
@@ -241,8 +225,7 @@
 (defun YaTeX:sum ()
   "Read range of summation."
   (YaTeX:check-completion-type 'maketitle)
-  (concat (YaTeX:read-boundary "_") (YaTeX:read-boundary "^"))
-)
+  (concat (YaTeX:read-boundary "_") (YaTeX:read-boundary "^")))
 
 (fset 'YaTeX:int 'YaTeX:sum)
 
@@ -253,47 +236,41 @@
     (if (string= "" var) ""
       (setq limit (read-string "Limit ($ means infinity): "))
       (if (string= "$" limit) (setq limit "\\infty"))
-      (concat "_{" var " \\rightarrow " limit "}")))
-)
+      (concat "_{" var " \\rightarrow " limit "}"))))
 
 (defun YaTeX:gcd ()
   "Add-in function for \\gcd(m,n)."
   (YaTeX:check-completion-type 'maketitle)
-  (YaTeX:read-coordinates "\\gcd" "(?,)" "(,?)")
-)
+  (YaTeX:read-coordinates "\\gcd" "(?,)" "(,?)"))
 
 (defun YaTeX:read-boundary (ULchar)
   "Read boundary usage by _ or ^.  _ or ^ is indicated by argument ULchar."
   (let ((bndry (read-string (concat ULchar "{???} ($ for infinity): "))))
     (if (string= bndry "") ""
       (if (string= bndry "$") (setq bndry "\\infty"))
-      (concat ULchar "{" bndry "}")))
-)
+      (concat ULchar "{" bndry "}"))))
 
 (defun YaTeX:verb ()
   "Enclose \\verb's contents with the same characters."
   (let ((quote-char (read-string "Quoting char: " "|"))
 	(contents (read-string "Quoted contents: ")))
-    (concat quote-char contents quote-char))
-)
+    (concat quote-char contents quote-char)))
+
 (fset 'YaTeX:verb* 'YaTeX:verb)
 
 (defun YaTeX:footnotemark ()
   (setq section-name "footnotetext")
-  nil
-)
+  nil)
 
 (defun YaTeX:cite ()
   (let ((comment (read-string "Comment for citation: ")))
     (if (string= comment "") ""
-      (concat "[" comment "]")))
-)
+      (concat "[" comment "]"))))
 
 (defun YaTeX:bibitem ()
   (let ((label (read-string "Citation label for bibitem: ")))
     (if (string= label "") ""
-      (concat "[" label "]")))
-)
+      (concat "[" label "]"))))
 
 (defun YaTeX:item ()
   (YaTeX-indent-line)
@@ -309,8 +286,7 @@
     (setq obl (char-to-string (read-char)))
     (if (string-match "[0-4]" obl)
 	(concat "[" obl "]")
-      ""))
-)
+      "")))
 (fset 'YaTeX:pagebreak 'YaTeX:linebreak)
 
 ;;;
@@ -320,8 +296,7 @@
 (defun YaTeX:check-completion-type (type)
   "Check valid completion type."
   (if (not (eq type YaTeX-current-completion-type))
-      (error "This should be completed with %s-type completion." type))
-)
+      (error "This should be completed with %s-type completion." type)))
 
 
 ;;;
@@ -375,8 +350,8 @@
 	  'YaTeX::label-search-tag)
 	(define-key YaTeX-label-select-map (char-to-string (+ key (- ?a ?A)))
 	  'YaTeX::label-search-tag)
-	(setq key (1+ key)))))
-)
+	(setq key (1+ key))))))
+
 (defun YaTeX::label-next ()
   (interactive) (forward-line 1) (message YaTeX-label-guide-msg))
 (defun YaTeX::label-previous ()
@@ -394,8 +369,8 @@
 	(goto-char (point-min))
 	(re-search-forward (concat "^" tag) nil t))
       (goto-char (match-beginning 0))))
-    (message YaTeX-label-guide-msg))
-)
+    (message YaTeX-label-guide-msg)))
+
 (defun YaTeX::ref (argp &optional labelcmd refcmd)
   (cond
    ((= argp 1)
@@ -415,8 +390,12 @@
 	      ;(message "cb=%s" buf)(sit-for 3)
 	      ))
 	(save-excursion
+	  (set-buffer (get-buffer-create YaTeX-label-buffer))
+	  (setq buffer-read-only nil)
+	  (erase-buffer))
+	(save-excursion
 	  (goto-char (point-min))
-	  (with-output-to-temp-buffer YaTeX-label-buffer
+	  (let ((standard-output (get-buffer YaTeX-label-buffer)))
 	    (princ (format "=== LABELS in [%s] ===\n" (buffer-name buf)))
 	    (while (YaTeX-re-search-active-forward
 		    (concat "\\\\" labelcmd "\\b")
@@ -440,7 +419,7 @@
 	    (princ YaTeX-label-menu-other)
 	    (princ YaTeX-label-menu-repeat)
 	    (princ YaTeX-label-menu-any)
-	    );with
+	    );standard-output
 	  (goto-char p)
 	  (or initl (setq initl lnum))
 	  (message "Collecting %s...Done" labelcmd)
@@ -474,10 +453,8 @@
 		  (setq label (read-string (format "\\%s{???}: " refcmd))))
 		 (t (setq label (nth (- lnum line 1) label-list)))))
 	    (bury-buffer YaTeX-label-buffer)))
-	label
-	))
-    ))
-)
+	label)))))
+
 (fset 'YaTeX::pageref 'YaTeX::ref)
 (defun YaTeX::cite (argp)
   (cond
@@ -490,8 +467,7 @@
     (delq nil (mapcar (function (lambda (buf)
 				  (set-buffer buf)
 				  (if (eq major-mode 'yatex-mode) buf)))
-		      (buffer-list))))
-)
+		      (buffer-list)))))
 
 (defun YaTeX-select-other-yatex-buffer ()
   "Select buffer from all yatex-mode's buffers interactivelly."
@@ -501,7 +477,11 @@
 	(ff "**find-file**"))
     (YaTeX-showup-buffer
      lbuf (function (lambda (x) 1)))	;;Select next window surely.
-    (with-output-to-temp-buffer lbuf
+    (save-excursion
+      (set-buffer (get-buffer lbuf))
+      (setq buffer-read-only nil)
+      (erase-buffer))
+    (let ((standard-output (get-buffer lbuf)))
       (while blist
 	(princ
 	 (format "%c:{%s}\n" (+ (% (setq lnum (1+ lnum)) 26) ?A)
@@ -526,8 +506,7 @@
 	(progn
 	  (call-interactively 'find-file)
 	  (current-buffer))
-      rv))
-)
+      rv)))
 
 (defun YaTeX-label-other ()
   (let ((rv (YaTeX-select-other-yatex-buffer)))
@@ -535,9 +514,7 @@
      ((null rv) "")
      (t
       (set-buffer rv)
-      (YaTeX::ref argp labelcmd refcmd)))
-    )
-)
+      (YaTeX::ref argp labelcmd refcmd)))))
 
 ;;
 ; completion for the arguments of \newcommand
@@ -573,8 +550,7 @@
       (message "")
       def				;return command name
       ))
-   (t ""))
-)
+   (t "")))
 
 ;;
 ; completion for the arguments of \pagestyle
@@ -583,8 +559,8 @@
   "Read the pagestyle with completion."
   (completing-read
    "Page style: "
-   '(("plain") ("empty") ("headings") ("myheadings") ("normal") nil))
-)
+   '(("plain") ("empty") ("headings") ("myheadings") ("normal") nil)))
+
 (fset 'YaTeX::thispagestyle 'YaTeX::pagestyle)
 
 ;;
@@ -594,8 +570,7 @@
   "Read the numbering style."
   (completing-read
    "Page numbering style: "
-   '(("arabic") ("Alpha") ("alpha") ("Roman") ("roman")))
-)
+   '(("arabic") ("Alpha") ("alpha") ("Roman") ("roman"))))
 
 ;;
 ; Length
@@ -656,8 +631,8 @@
      nil nil "\\")
     )
    ((equal 2 argp)
-    (read-string-with-history "Length: " nil 'YaTeX:length-history)))
-)
+    (read-string-with-history "Length: " nil 'YaTeX:length-history))))
+
 (fset 'YaTeX::addtolength 'YaTeX::setlength)
 
 (defun YaTeX::settowidth (&optional argp)
@@ -671,8 +646,8 @@
      'YaTeX:style-parameters-local
      nil nil "\\"))
    ((equal 2 argp)
-    (read-string "Text: ")))
-)
+    (read-string "Text: "))))
+
 (defun YaTeX::newlength (&optional argp)
   "YaTeX add-in function for arguments of \\newlength"
   (cond
@@ -684,9 +659,7 @@
 	   'YaTeX:style-parameters-default
 	   'YaTeX:style-parameters-private
 	   'YaTeX:style-parameters-local))
-      length)
-    ))
-)
+      length))))
 
 ;; \multicolumn's arguments
 (defun YaTeX::multicolumn (&optional argp)
@@ -702,8 +675,7 @@
 		   "lrc")))
       c))
    ((equal 3 argp)
-    (read-string "Item: ")))
-)
+    (read-string "Item: "))))
 
 (defvar YaTeX:documentstyles-default
   '(("article") ("jarticle") ("j-article")
@@ -773,8 +745,7 @@
 	    'YaTeX:documentstyles-private
 	    'YaTeX:documentstyles-local)))
       (if (string= "" sname) (setq sname YaTeX-default-document-style))
-      (setq YaTeX-default-document-style sname))))
-)
+      (setq YaTeX-default-document-style sname)))))
 
 ;;; -------------------- LaTeX2e stuff --------------------
 (defvar YaTeX:documentclass-options-default
--- a/yatexlib.el	Mon Oct 26 12:05:32 1998 +0000
+++ b/yatexlib.el	Thu Jul 15 04:58:26 1999 +0000
@@ -1,8 +1,8 @@
 ;;; -*- Emacs-Lisp -*-
 ;;; YaTeX and yahtml common libraries, general functions and definitions
 ;;; yatexlib.el
-;;; (c )1994-1997 by HIROSE Yuuji.[yuuji@ae.keio.ac.jp]
-;;; Last modified Mon Oct 19 13:41:29 1998 on firestorm
+;;; (c )1994-1999 by HIROSE Yuuji.[yuuji@gentei.org]
+;;; Last modified Tue May  4 10:25:55 1999 on firestorm
 ;;; $Id$
 
 ;; General variables
@@ -54,8 +54,8 @@
 
 ;----------- work variables ----------------------------------------
 (defvar YaTeX-typesetting-mode-map nil
-  "Keymap used in YaTeX typesetting buffer"
-)
+  "Keymap used in YaTeX typesetting buffer")
+
 (if YaTeX-typesetting-mode-map nil
   (setq YaTeX-typesetting-mode-map (make-keymap))
   ;(suppress-keymap YaTeX-typesetting-mode-map t)
@@ -295,25 +295,23 @@
 		   (beginning-of-line)
 		   (re-search-forward cmntrx (match-beginning 0) t)))))
     (store-match-data md)
-    found)
-)
+    found))
 
 (defun YaTeX-re-search-active-forward (regexp cmntrx &optional bound err cnt)
   "Search REGEXP backward which is not commented out by regexp CMNTRX.
 See also YaTeX-search-active-forward."
-  (YaTeX-search-active-forward regexp cmntrx bound err cnt 're-search-forward)
-)
+  (YaTeX-search-active-forward regexp cmntrx bound err cnt 're-search-forward))
+
 (defun YaTeX-search-active-backward (string cmntrx &optional bound err cnt)
   "Search STRING backward which is not commented out by regexp CMNTRX.
 See also YaTeX-search-active-forward."
-  (YaTeX-search-active-forward string cmntrx bound err cnt 'search-backward)
-)
+  (YaTeX-search-active-forward string cmntrx bound err cnt 'search-backward))
+
 (defun YaTeX-re-search-active-backward (regexp cmntrx &optional bound err cnt)
   "Search REGEXP backward which is not commented out by regexp CMNTRX.
 See also YaTeX-search-active-forward."
-  (YaTeX-search-active-forward regexp cmntrx bound err cnt 're-search-backward)
-)
-
+  (YaTeX-search-active-forward
+   regexp cmntrx bound err cnt 're-search-backward))
 
 ;;;###autoload
 (defun YaTeX-switch-to-buffer (file &optional setbuf)
@@ -333,8 +331,7 @@
 	 (find-file file))
        (current-buffer)))
      (t (message "%s was not found in this directory." file)
-	nil)))
-)
+	nil))))
 
 ;;;###autoload
 (defun YaTeX-switch-to-buffer-other-window (file)
@@ -348,8 +345,7 @@
    ((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))
-)
+      nil)))
 
 (defun YaTeX-replace-format-sub (string format repl)
   (let ((beg (or (string-match (concat "^\\(%" format "\\)") string)
@@ -358,8 +354,7 @@
     (if (null beg) string ;no conversion
       (concat
        (substring string 0 (match-beginning 1)) repl
-       (substring string (match-end 1)))))
-)
+       (substring string (match-end 1))))))
 
 ;;;###autoload
 (defun YaTeX-replace-format (string format repl)
@@ -369,8 +364,7 @@
     (while (not (string=
 		 ans (setq string (YaTeX-replace-format-sub ans format repl))))
       (setq ans string))
-    string)
-)
+    string))
 
 ;;;###autoload
 (defun YaTeX-replace-format-args (string &rest args)
@@ -381,8 +375,7 @@
       (setq string
 	    (YaTeX-replace-format string (int-to-string argp) (car args)))
       (setq args (cdr args) argp (1+ argp))))
-  string
-)
+  string)
 
 ;;;###autoload
 (defun rindex (string char)
@@ -448,8 +441,16 @@
 	    (switch-to-buffer (get-buffer-create buffer))
 	    (or select (select-window window)))
 	   (t nil)))
-	 )))
-)
+	 ))))
+
+(cond
+ ((fboundp 'screen-height)
+  (fset 'YaTeX-screen-height 'screen-height)
+  (fset 'YaTeX-screen-width 'screen-width))
+ ((fboundp 'frame-height)
+  (fset 'YaTeX-screen-height 'frame-height)
+  (fset 'YaTeX-screen-width 'frame-width))
+ (t (error "I don't know how to run windows.el on this Emacs...")))
 
 ;;;###autoload
 (defun split-window-calculate-height (height)
@@ -462,15 +463,14 @@
        (selected-window)
        (max
 	(min
-	 (- (screen-height)
+	 (- (YaTeX-screen-height)
 	    (if (numberp height)
 		(+ height 2)
-	      (/ (* (screen-height)
+	      (/ (* (YaTeX-screen-height)
 		    (string-to-int height))
 		 100)))
-	 (- (screen-height) window-min-height 1))
-	window-min-height)))
-)
+	 (- (YaTeX-screen-height) window-min-height 1))
+	window-min-height))))
 
 ;;;###autoload
 (defun YaTeX-window-list ()
@@ -478,8 +478,7 @@
     (while (not (eq curw (setq win (next-window win))))
       (or (eq win (minibuffer-window))
 	  (setq wlist (cons win wlist))))
-    wlist)
-)
+    wlist))
 
 ;;;###autoload
 (defun substitute-all-key-definition (olddef newdef keymap)
@@ -497,8 +496,7 @@
   "Return (buffer-substring (match-beginning n) (match-beginning m))."
   (if (match-beginning n)
       (buffer-substring (match-beginning n)
-			(match-end (or m n))))
-)
+			(match-end (or m n)))))
 
 ;;;###autoload
 (defun YaTeX-minibuffer-complete ()
@@ -555,8 +553,7 @@
 	    (if (eq (try-completion compl minibuffer-completion-table) t)
 		(exit-minibuffer)
 	      (funcall displist)))))
-    (store-match-data md))
-)
+    (store-match-data md)))
 
 (defun YaTeX-minibuffer-quick-complete ()
   "Set 'quick to 't and call YaTeX-minibuffer-complete.
@@ -577,8 +574,7 @@
 		     (string-match pattern (buffer-file-name)))
 		(and (symbolp pattern) major-mode (eq major-mode pattern)))
 	    (eval job))
-	(setq list (cdr list)))))
-)
+	(setq list (cdr list))))))
 
 (defun goto-buffer-window (buffer)
   "Select window which is bound to BUFFER.
@@ -604,8 +600,7 @@
 	     (let ((w (win:get-buffer-window buffer)))
 	       (and w (win:switch-window w))))
 	(select-window (get-buffer-window buffer)))
-       (t (switch-to-buffer buffer))))
-)
+       (t (switch-to-buffer buffer)))))
 
 ;; Here starts the functions which support gmhist-vs-Emacs19 compatible
 ;; reading with history.
@@ -644,6 +639,18 @@
     (read-with-history-in hsym prompt init))
    (t (read-string prompt init))))
 
+;;;###autoload
+(fset 'YaTeX-rassoc
+      (if (and nil (fboundp 'rassoc) (subrp (symbol-function 'rassoc)))
+	  (symbol-function 'rassoc)
+	(lambda (key list)
+	  (let ((l list))
+	    (catch 'found
+	      (while l
+		(if (equal key (cdr (car l)))
+		    (throw 'found (car l)))
+		(setq l (cdr l))))))))
+
 ;;;
 ;; Interface function for windows.el
 ;;;
@@ -719,8 +726,7 @@
 		    (throw 'begin t)))))
 	  (buffer-substring
 	   (progn (skip-chars-forward open) (1+ (point)))
-	   (progn (skip-chars-forward close) (point))))))
-)
+	   (progn (skip-chars-forward close) (point)))))))
 
 (defun YaTeX-end-environment ()
   "Close opening environment"
@@ -744,8 +750,7 @@
 	    (sit-for (if YaTeX-dos 2 1))
 	  (message "Matches with %s at line %d"
 		   (YaTeX-replace-format-args YaTeX-struct-begin env "" "")
-		   (count-lines (point-min) (point)))))))
-)
+		   (count-lines (point-min) (point))))))))
 
 ;;;VER2
 (defun YaTeX-insert-struc (what env)
@@ -755,8 +760,7 @@
 	     YaTeX-struct-begin env (YaTeX-addin env))))
    ((eq what 'end)
     (insert (YaTeX-replace-format-args YaTeX-struct-end env)))
-   (t nil))
-)
+   (t nil)))
 
 ;;; Function for menu support
 (defun YaTeX-define-menu (keymap bindlist)
--- a/yatexmth.el	Mon Oct 26 12:05:32 1998 +0000
+++ b/yatexmth.el	Thu Jul 15 04:58:26 1999 +0000
@@ -1,8 +1,8 @@
 ;;; -*- Emacs-Lisp -*-
 ;;; YaTeX math-mode-specific functions.
 ;;; yatexmth.el
-;;; (c )1993-1998 by HIROSE Yuuji [yuuji@ae.keio.ac.jp]
-;;; Last modified Wed Sep 30 21:26:29 1998 on firestorm
+;;; (c )1993-1999 by HIROSE Yuuji [yuuji@gentei.org]
+;;; Last modified Thu Apr 29 17:39:10 1999 on firestorm
 ;;; $Id$
 
 ;;; [Customization guide]
@@ -226,6 +226,7 @@
    ("v||"	"Downarrow"	"||\n\\/")
    ("|->"	"mapsto"	("|->"		"|→"))
    ("<-)"	"hookleftarrow"	("   ,\n<--+"	"   ヽ\n<--/"))
+   ("(->"	"hookrightarrow" ("`\n+-->"	"/\n\-->"))
    ("/-"	"leftharpoonup"	"/\n~~~")
    ("\\-"	"leftharpoondown" "__\n\\")
    ("-/"	"rightharpoondown"  "__\n/")
@@ -474,6 +475,7 @@
 	    ;; And math modes of AMS-LaTeX
 	    '("align" "align*" "split" "multline" "multline*" "gather"
 	      "gather*" "aligned*" "gathered" "gathered*" "alignat"
+	      "equation*" "cases" 
 	      "alignat*" "xalignat" "xalignat*" "xxalignat" "xxalignat*"))))
       (let*((p (point)) (nest 0) me0
 	    (delim (concat YaTeX-sectioning-regexp "\\|^$\\|^\C-l"))
@@ -733,6 +735,218 @@
 	  (setq list (cdr list)))
 	(setq lists (cdr lists))))))
 
+;;; ----- for AMS LaTeX (by matsu@math.s.chiba-u.ac.jp) -----
+(defvar YaTeX-ams-paren-modifier
+  '(("Biggl" . "Biggr") ("biggl" . "biggr")
+    ("Bigl" . "Bigr") ("bigl" . "bigr")
+    ("left" . "right") ("" . ""))
+  "Alist of modifier of parentheses.")
+
+(defvar YaTeX-left-paren "(\\|\\[\\|\\\\{")
+(defvar YaTeX-right-paren ")\\|\\]\\|\\\\}")
+(defvar YaTeX-paren
+  (concat YaTeX-left-paren "\\|" YaTeX-right-paren))
+
+(defun YaTeX-on-parenthesis-p ()
+  "If cursor is on an (AMS-LaTeX) parenthesis, return the parenthesis."
+  (interactive)
+  (let* ((list YaTeX-ams-paren-modifier)
+	 (longest 0) ;; the longest length of parenthesis command strings
+	 (flag t) ;; flag for whether on braces not following \
+	 (point (point))
+	 (move 0)
+	 (paren))
+    (while list
+      (setq longest
+	    (max longest (length (car (car list))) (length (cdr (car list)))))
+      (setq list (cdr list)))
+    (save-excursion
+      ;; search {} and, if it does not follow `\', set flag nil.
+      ;; if it is right after `\', set flag t and move to the position of \.
+      ;; mmmmm.
+      (if (looking-at "{\\|}")
+	  (if (not (equal (char-after (1- (point))) 92))
+	      (setq flag nil)
+	    (forward-char -1)))
+      ;; if flag is nil, do nothing.
+      (if (and flag (re-search-forward YaTeX-paren
+				       (+ (point) 3 longest) t))
+	  (progn
+	    (setq move (- (point) point))
+	    (setq paren (match-string 0))
+	    (setq list YaTeX-ams-paren-modifier)
+	    ;; criterion for whether on [] () \{\} or not.
+	    (if (string-match YaTeX-left-paren paren)
+		(while (and list flag)
+		  (let* ((mod (car (car list)))
+			 (mod-length 0) ;; length of modifier
+			 paren-regexp ;; regexp of paren.
+			 mod-regexp) ;; regexp of modifier.
+		    (if (> (length mod) 0)
+			(setq mod-regexp (concat "\\\\" mod)
+			      mod-length (1+ (length mod))))
+		    (cond ((string= paren "\\{")
+			   (setq paren-regexp (concat "\\" paren)))
+			  ((string= paren "[")
+			   (setq paren-regexp "\\["))
+			  (t (setq paren-regexp paren)))
+		    (save-excursion
+		      (if (and (>= (- (point) (point-min))
+				   (+ mod-length (length paren)))
+			       (not (forward-char
+				     (- 0 mod-length (length paren))))
+			       (looking-at (concat "\\(" mod-regexp "\\)\\("
+						   paren-regexp "\\)")))
+			  (setq flag nil)))
+		    (setq list (cdr list))))
+	      (while (and list flag)
+		(let* ((mod (cdr (car list)))
+		       (mod-length 0)
+		       paren-regexp
+		       mod-regexp)
+		  (if (> (length mod) 0)
+		      (setq mod-regexp (concat "\\\\" mod)
+			    mod-length (1+ (length mod))))
+		  (cond ((string= paren "\\}")
+			 (setq paren-regexp (concat "\\" paren)))
+			((string= paren "]")
+			 (setq paren-regexp "\\]"))
+			(t (setq paren-regexp paren)))
+		  (save-excursion
+		    (if (and (>= (- (point) (point-min))
+				 (+ mod-length (length paren)))
+			     (not (forward-char
+				   (- 0 mod-length (length paren))))
+			     (looking-at (concat "\\(" mod-regexp "\\)\\("
+						 paren-regexp "\\)")))
+			(setq flag nil)))
+		  (setq list (cdr list)))))
+	    (if (<= move (length (match-string 0)))
+		(match-string 0)))))))
+
+(defun YaTeX-goto-open-paren ()
+  "Jump to the exact position of open parenthesis"
+  (interactive)
+  (let ((paren)
+	(backslash-syntax (char-to-string (char-syntax ?\\))))
+    (if (setq paren (YaTeX-on-parenthesis-p))
+	(if (string-match "(\\|{\\|\\[" paren (1- (length paren)))
+	    (progn
+	      (re-search-forward "(\\|{\\|\\[" (+ (point) (length paren)) t)
+	      (backward-char))
+	  (re-search-forward ")\\|}\\|\\]" (+ (point) (length paren)) t)
+	  (unwind-protect
+	      (progn
+		(modify-syntax-entry ?\\ " ")
+		(backward-list))
+	    (modify-syntax-entry ?\\ backslash-syntax))))))
+
+(defun YaTeX-change-parentheses ()
+  "Change the size of parentheses, braces, and brackets of AMS-LaTeX."
+  (interactive)
+  (if (not (and YaTeX-use-AMS-LaTeX (YaTeX-on-parenthesis-p)))
+      nil
+    (let* ((mod (match-string 1)) ;; modifier
+	   (paren (if mod (match-string 2) (match-string 0))) ;; paren
+	   (mod-length (if (or (string= mod "\\left") (string= mod "\\right"))
+			   5            ;; 5 in case left or right
+			 (length mod))) ;; length of modifier
+	   (paren-length (length paren)) ;; length of paren
+	   (length (+ mod-length paren-length)) ;; length of whole string
+	   (big-p t) ;; flag whether new modifier is "[Bb]ig+" or not.
+	   size ;; left, big, Big etc.
+	   lr   ;; "l" or "r".
+	   char newsize newsize-length
+	   (backslash-syntax (char-to-string (char-syntax ?\\)))
+	   (case-fold-search))
+      ;; decide lr and size from mod and paren.
+      (cond ((string-match "\\(\\\\[Bb]ig+\\)[lr]" mod)
+	     (setq size (substring mod 1 (match-end 1))
+		   lr (substring mod (match-end 1) (match-end 0))))
+	    ((string-match "\\\\left" mod)
+	     (setq size "left-right" lr "l"))
+	    ((string-match "\\\\right" mod)
+	     (setq size "left-right" lr "r"))
+	    ((string-match "(\\|\\[\\|\\\\{" paren)
+	     (setq size "null" lr "l"))
+	    ((string-match ")\\|\\]\\|\\\\}" paren)
+	     (setq size "null" lr "r"))
+	    (t
+	     (setq size nil lr nil)))
+      (while (not newsize)
+	(message (format (concat "Change from %s: "
+				 "l(big) L(Big) h(bigg) H(Bigg) "
+				 "r(left-right) n(NONE) ") size))
+	(setq char (read-char)
+	      newsize (cond ((char-equal char ?l) "\\big")
+			    ((char-equal char ?L) "\\Big")
+			    ((char-equal char ?h) "\\bigg")
+			    ((char-equal char ?H) "\\Bigg")
+			    ((char-equal char ?r)
+			     (setq big-p nil) "\\left")
+			    ((char-equal char ?n)
+			     (setq big-p nil) "")
+			    (t nil))
+	      newsize-length (length newsize)))
+      (YaTeX-goto-open-paren)
+      (forward-char)
+      (delete-region (- (point) length) (- (point) paren-length))
+      (backward-char paren-length)
+      (insert-string newsize)
+      (if big-p (insert ?l))
+      (forward-char (1- paren-length))
+      (unwind-protect
+	  (progn
+	    (modify-syntax-entry ?\\ " ")
+	    (forward-list)
+	    (if (string= size "left-right") (setq length (1+ length)))
+	    (if (eq char ?r) (setq newsize "\\right"))
+	    (delete-region (- (point) length) (- (point) paren-length))
+	    (backward-char paren-length)
+	    (insert-string newsize)
+	    (if big-p (insert ?r))
+	    (forward-char paren-length)
+	    (if (string= lr "l") (backward-list)))
+	(modify-syntax-entry ?\\ backslash-syntax))
+      t)))
+
+(defun YaTeX-insert-amsparens-region (beg end char)
+  (interactive "r\ncWhich one ? l(big) L(Big) h(bigg) H(Bigg): ")
+  (let* ((case-fold-search)
+	 (st (cond ((char-equal char ?l) "big")
+		   ((char-equal char ?L) "Big")
+		   ((char-equal char ?h) "bigg")
+		   ((char-equal char ?H) "Bigg"))))
+    (if st
+	(YaTeX-insert-braces-region
+	 beg end (concat "\\" st "l(") (concat "\\" st "r)"))
+      (YaTeX-insert-braces-region beg end "(" ")"))))
+
+(defun YaTeX-insert-amsbraces-region (beg end char)
+  (interactive "r\ncWhich one ? l(big) L(Big) h(bigg) H(Bigg): ")
+  (let* ((case-fold-search)
+	 (st (cond ((char-equal char ?l) "big")
+		   ((char-equal char ?L) "Big")
+		   ((char-equal char ?h) "bigg")
+		   ((char-equal char ?H) "Bigg"))))
+    (if st
+	(YaTeX-insert-braces-region
+	 beg end (concat "\\" st "l\\{") (concat "\\" st "r\\}"))
+      (YaTeX-insert-braces-region beg end "\\{" "\\}"))))
+
+(defun YaTeX-insert-amsbrackets-region (beg end char)
+  (interactive "r\ncWhich one ? l(big) L(Big) h(bigg) H(Bigg): ")
+  (let* ((case-fold-search)
+	 (st (cond ((char-equal char ?l) "big")
+		   ((char-equal char ?L) "Big")
+		   ((char-equal char ?h) "bigg")
+		   ((char-equal char ?H) "Bigg"))))
+    (if st
+	(YaTeX-insert-braces-region
+	 beg end (concat "\\" st "l[") (concat "\\" st "r]"))
+      (YaTeX-insert-braces-region beg end "[" "]"))))
+
+
 ;;
 (provide 'yatexmth)
 
--- a/yatexprc.el	Mon Oct 26 12:05:32 1998 +0000
+++ b/yatexprc.el	Thu Jul 15 04:58:26 1999 +0000
@@ -1,16 +1,16 @@
 ;;; -*- Emacs-Lisp -*-
 ;;; YaTeX process handler.
 ;;; yatexprc.el
-;;; (c )1993-1997 by HIROSE Yuuji.[yuuji@ae.keio.ac.jp]
-;;; Last modified Mon Mar  9 11:44:29 1998 on crx
+;;; (c )1993-1999 by HIROSE Yuuji.[yuuji@gentei.org]
+;;; Last modified Tue Jul 13 13:47:46 1999 on firestorm
 ;;; $Id$
 
 ;(require 'yatex)
 (require 'yatexlib)
 
 (defvar YaTeX-typeset-process nil
-  "Process identifier for jlatex"
-)
+  "Process identifier for jlatex")
+
 (defvar YaTeX-typeset-buffer "*YaTeX-typesetting*"
   "Process buffer for jlatex")
 
@@ -44,8 +44,7 @@
   (modify-syntax-entry ?\{ "w" YaTeX-typeset-buffer-syntax)
   (modify-syntax-entry ?\} "w" YaTeX-typeset-buffer-syntax)
   (modify-syntax-entry ?\[ "w" YaTeX-typeset-buffer-syntax)
-  (modify-syntax-entry ?\] "w" YaTeX-typeset-buffer-syntax)
-)
+  (modify-syntax-entry ?\] "w" YaTeX-typeset-buffer-syntax))
 
 (defun YaTeX-typeset (command buffer &optional prcname modename)
   "Execute jlatex (or other) to LaTeX typeset."
@@ -55,7 +54,7 @@
 	  (map YaTeX-typesetting-mode-map)
 	  (outcode
 	   (cond ((eq major-mode 'yatex-mode) YaTeX-coding-system)
-		 ((eq major-mode 'yahtml-mode) yahtml-coding-system))))
+		 ((eq major-mode 'yahtml-mode) yahtml-kanji-code))))
       (if (and YaTeX-typeset-process
 	       (eq (process-status YaTeX-typeset-process) 'run))
 	  ;; if tex command is halting.
@@ -118,8 +117,7 @@
 	(recenter -1))
       (select-window window)
       (switch-to-buffer cb)
-      (YaTeX-remove-nonstopmode)))
-)
+      (YaTeX-remove-nonstopmode))))
 
 (defun YaTeX-typeset-sentinel (proc mes)
   (cond ((null (buffer-name (process-buffer proc)))
@@ -160,12 +158,10 @@
              (set-buffer-modified-p (buffer-modified-p))
 	     )
 	   (select-window owin)
-	   (set-buffer obuf))))
-)
+	   (set-buffer obuf)))))
 
 (defvar YaTeX-texput-file "texput.tex"
-  "*File name for temporary file of typeset-region."
-)
+  "*File name for temporary file of typeset-region.")
 
 (defun YaTeX-typeset-region ()
   "Paste the region to the file `texput.tex' and execute typesetter.
@@ -247,9 +243,7 @@
       (switch-to-buffer buffer)		;for Emacs-19
       (put 'dvi2-command 'region t)
       (put 'dvi2-command 'file buffer)
-      (put 'dvi2-command 'offset lineinfo)
-      ))
-)
+      (put 'dvi2-command 'offset lineinfo))))
 
 (defun YaTeX-typeset-buffer ()
   "Typeset whole buffer.
@@ -303,8 +297,7 @@
 	  (exchange-point-and-mark)))
       (switch-to-buffer cb))		;for 19
     (YaTeX-typeset cmd YaTeX-typeset-buffer)
-    (put 'dvi2-command 'region nil))
-)
+    (put 'dvi2-command 'region nil)))
 
 (defvar YaTeX-call-command-history nil
   "Holds history list of YaTeX-call-command-on-file.")
@@ -316,15 +309,13 @@
     "Call command: "
     (concat base-cmd " " (YaTeX-get-preview-file-name))
     'YaTeX-call-command-history)
-   buffer)
-)
+   buffer))
 
 (defun YaTeX-bibtex-buffer (cmd)
   "Pass the bibliography data of editing file to bibtex."
   (interactive)
   (YaTeX-save-buffers)
-  (YaTeX-call-command-on-file cmd "*YaTeX-bibtex*" )
-)
+  (YaTeX-call-command-on-file cmd "*YaTeX-bibtex*" ))
 
 (defun YaTeX-kill-typeset-process (proc)
   "Kill process PROC after sending signal to PROC.
@@ -347,8 +338,7 @@
     (if (eq (process-status proc) 'run)
 	(progn
 	  (interrupt-process proc)
-	  (delete-process proc)))))
-)
+	  (delete-process proc))))))
 
 (defun YaTeX-system (command buffer)
   "Execute some command on buffer.  Not a official function."
@@ -371,8 +361,7 @@
 	(set-process-buffer
 	 (start-process
 	  "system" buffer shell-file-name YaTeX-shell-command-option command)
-	 (get-buffer buffer)))))
-)
+	 (get-buffer buffer))))))
 
 (defvar YaTeX-preview-command-history nil
   "Holds minibuffer history of preview command.")
@@ -413,6 +402,12 @@
 		      (concat preview-command " " preview-file))
 	(send-string-to-terminal "\e[>5l") ;show cursor
 	(redraw-display))
+       ((and (string-match "dviout" preview-command)	;maybe on `kon' 
+	     (stringp (getenv "TERM"))
+	     (string-match "^kon" (getenv "TERM")))
+	(call-process shell-file-name "con" "*dvi-preview*" nil
+		      YaTeX-shell-command-option
+		      (concat preview-command " " preview-file)))
        (t				;if UNIX
 	(set-process-buffer
 	 (start-process "preview" "*dvi-preview*" shell-file-name
@@ -421,8 +416,7 @@
 	 (get-buffer pbuffer))
 	(message
 	 (concat "Starting " preview-command
-		 " to preview " preview-file))))))
-)
+		 " to preview " preview-file)))))))
 
 (defvar YaTeX-xdvi-remote-program "xdvi")
 (defun YaTeX-xdvi-remote-search (&optional region-mode)
@@ -447,8 +441,7 @@
 	     "xdvi" pb YaTeX-xdvi-remote-program
 	     "-remote"  (format "SloppySearch(%s) " str)
 	     (concat (YaTeX-get-preview-file-name) ".dvi")))
-      (message "Searching `%s'...Done" str)))
-)
+      (message "Searching `%s'...Done" str))))
 
 (defun YaTeX-set-virtual-error-position (file-sym line-sym)
   "Replace the value of FILE-SYM, LINE-SYM by virtual error position."
@@ -508,8 +501,7 @@
     (recenter (/ (window-height) 2))
     (sit-for 1)
     (goto-char (match-beginning 0))
-    (select-window error-win))
-)
+    (select-window error-win)))
 
 (defun YaTeX-jump-error-line ()
   "Jump to corresponding line on latex command's error message."
@@ -531,8 +523,7 @@
       (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 ()
   "Send string to current typeset process."
@@ -550,8 +541,7 @@
 	(insert "\n")
 	(set-marker (process-mark YaTeX-typeset-process) (point))
 	(insert " "))
-    (ding))
-)
+    (ding)))
 
 (defun YaTeX-view-error ()
   (interactive)
@@ -564,8 +554,7 @@
       ;;(goto-char (point-max))
       ;;(forward-line -1)
       ;;(recenter -1)
-      (select-window win)))
-)
+      (select-window win))))
 
 (defun YaTeX-get-error-file (default)
   "Get current processing file from typesetting log."
@@ -589,8 +578,7 @@
 	     (progn (forward-char 1) (point))
 	     (progn (skip-chars-forward "^ \n" (point-end-of-line))
 		    (point))))
-      (if (string= "" s) default s)))
-)
+      (if (string= "" s) default s))))
       
 (defun YaTeX-put-nonstopmode ()
   (if (and (eq major-mode 'yatex-mode) YaTeX-need-nonstop)
@@ -600,9 +588,7 @@
 	  (YaTeX-visit-main t)
 	  (goto-char (point-min))
 	  (insert "\\nonstopmode{}%_YaTeX_%\n")
-	  (if (buffer-file-name) (basic-save-buffer))))
-    )
-)
+	  (if (buffer-file-name) (basic-save-buffer))))))
 
 (defun YaTeX-remove-nonstopmode ()
   (if (and (eq major-mode 'yatex-mode) YaTeX-need-nonstop) ;for speed
@@ -613,8 +599,7 @@
 	(narrow-to-region (point-min) (point))
 	(goto-char (point-min))
 	(delete-matching-lines "^\\\\nonstopmode\\{\\}%_YaTeX_%$")
-	(widen)))
-)
+	(widen))))
 
 (defun YaTeX-get-preview-file-name ()
   "Get file name to preview by inquiring YaTeX-get-latex-command"
@@ -627,9 +612,7 @@
 				(buffer-file-name))
 			       0 -4))
       (setq period (rindex fname ?.))
-      (setq fname (substring fname 0 (if (eq -1 period) nil period)))
-      ))
-)
+      (setq fname (substring fname 0 (if (eq -1 period) nil period))))))
 
 (defun YaTeX-get-latex-command (&optional switch)
   "Specify the latex-command name and its argument.
@@ -659,8 +642,7 @@
        (switch (if (string-match "\\s " magic) magic
 		 (concat magic " " parent)))
        (t (concat (substring magic 0 (string-match "\\s " magic)) " "))))
-     (t (concat tex-command " " (if switch parent)))))
-)
+     (t (concat tex-command " " (if switch parent))))))
 
 (defvar YaTeX-lpr-command-history nil
   "Holds command line history of YaTeX-lpr.")
@@ -720,9 +702,7 @@
 	 (start-process "print" "*dvi-printing*" shell-file-name
 			YaTeX-shell-command-option cmd)
 	 (get-buffer lbuffer))
-	(message "Starting printing command: %s..." cmd)))
-      ))
-)
+	(message "Starting printing command: %s..." cmd))))))
 
 (defun YaTeX-main-file-p ()
   "Return if current buffer is main LaTeX source."
@@ -736,8 +716,7 @@
       (let ((latex-main-id
 	     (concat "^\\s *" YaTeX-ec-regexp "document\\(style\\|class\\)")))
 	(or (re-search-backward latex-main-id nil t)
-	    (re-search-forward latex-main-id nil t))))))
-)
+	    (re-search-forward latex-main-id nil t)))))))
 
 (defun YaTeX-visit-main (&optional setbuf)
   "Switch buffer to main LaTeX source.
@@ -767,9 +746,7 @@
 	  (setq YaTeX-parent-file main-file)
 	  (YaTeX-switch-to-buffer main-file setbuf))
        )))
-  nil
-)
-
+  nil)
 
 (defun YaTeX-guess-parent (command-line)
   (setq command-line
@@ -780,16 +757,14 @@
 	(concat (if (string-match "\\(.*\\)\\." command-line)
 		    (substring command-line (match-beginning 1) (match-end 1))
 		  command-line)
-		".tex"))
-)
+		".tex")))
 
 (defun YaTeX-visit-main-other-window ()
   "Switch to buffer main LaTeX source in other window."
   (interactive)
   (if (YaTeX-main-file-p) (message "I think this is main LaTeX source.")
       (YaTeX-switch-to-buffer-other-window
-       (concat (YaTeX-get-preview-file-name) ".tex")))
-)
+       (concat (YaTeX-get-preview-file-name) ".tex"))))
 
 (defun YaTeX-get-builtin (key)
   "Read source built-in command of %# usage."
@@ -801,8 +776,7 @@
 	(buffer-substring
 	 (progn (skip-chars-forward " 	" (point-end-of-line))(point))
 	 (point-end-of-line))
-      nil))
-)
+      nil)))
 
 (defun YaTeX-save-buffers ()
   "Save buffers whose major-mode is equal to current major-mode."
@@ -816,7 +790,6 @@
 			  (buffer-modified-p buf)
 			  (y-or-n-p (format "Save %s" (buffer-name buf))))
 		     (save-buffer buf)))
-	      (buffer-list))))
-)
+	      (buffer-list)))))
 
 (provide 'yatexprc)

yatex.org