changeset 53:5f4b18da14b3

Fix functions relating YaTeX-beginning-of-environment or YaTeX-end-of-environment. Line indentation by TAB much improved. Functions that work at enclosing environments, YaTeX-enclose-<ENVNAME>, introduced. Functions for enclosing verbatim and equations are supplied. SPC, DEL, +, - in YaTeX-hierarchy buffer. Compensate odd highlighting of hilit19.
author yuuji
date Thu, 02 Feb 1995 17:18:29 +0000
parents 5d94deabb9f9
children 2d45e43fb35f
files docs/yatex.ref docs/yatexe.tex docs/yatexj.tex help/YATEXHLP.jp yatex.el yatex.new yatex19.el yatexadd.el yatexenv.el yatexhie.el yatexhlp.el yatexlib.el yatexmth.el yatexprc.el yatexsec.el
diffstat 15 files changed, 635 insertions(+), 141 deletions(-) [+]
line wrap: on
line diff
--- a/docs/yatex.ref	Sun Jan 22 14:20:46 1995 +0000
+++ b/docs/yatex.ref	Thu Feb 02 17:18:29 1995 +0000
@@ -117,7 +117,8 @@
 	
 	◆itemの桁揃え			[prefix] i
 
-	  \item を使う環境中のみ有効です。
+	  \item を使う環境中のみ有効です。\item の項目全体をハングインデ
+	ントします。
 
 	◆LaTeXコマンド変更		[prefix] c
 
@@ -152,6 +153,9 @@
 	  「おまかせ改行」は tabular, array, itemize, enumerate, list,
 	description 環境で有効です。
 
+
+	◆インクルード構造ブラウズ	[prefix] d
+
 							       広瀬雄二
 						    yuuji@ae.keio.ac.jp
 						pcs39334@asciinet.or.jp
--- a/docs/yatexe.tex	Sun Jan 22 14:20:46 1995 +0000
+++ b/docs/yatexe.tex	Thu Feb 02 17:18:29 1995 +0000
@@ -36,10 +36,11 @@
 * Cursor jump::                 Jumping to related position
 * Changing and Deleting::       Changing/deleting certain unit of text
 * Filling::                     Filling an item or paragraph
-* Updation of @code{\includeonly}::  Maintaining @code{\includeonly}
-* What column?::                Column position guide in tabular
+* Updation of includeonly::     Free from maintaining includeonly
+* What column?::                Guidance to tabular column
 * Intelligent newline::         Guess requisites of new line
 * Online help::                 On-line documentation of LaTeX
+* Browsing file hierarchy::     Walking through file hierarchy
 * Cooperation with other packages::  Work well with gmhist, min-out
 * Customizations::              How to breed `Wild Bird'
 * Etcetera::                    YaTeX is acquisitive.
@@ -138,6 +139,7 @@
         (@kbd{C-c a}, @kbd{;}, @kbd{:})
 @item Online help for the popular La@TeX{} commands
       (@kbd{C-c ?}, @kbd{C-c /})(English help is not yet supported)
+@item Document files hierarchy browser (@kbd{C-c d})
 @end itemize
 
 @node Installation, Typesetting, Main features, Top
@@ -1180,7 +1182,7 @@
 character on a line changes the fill-prefix temporarily to the depth of
 the line.
 
-@node Updation of @code{\includeonly}, What column?, Filling, Top
+@node Updation of includeonly, What column?, Filling, Top
 @comment  node-name,  next,  previous,  up
 @chapter Updation of @code{\includeonly}
 @cindex includeonly
@@ -1299,7 +1301,7 @@
 useful.  See the definition of the function
 @code{YaTeX-intelligent-newline-itemize} as an example.
 
-@node Online help, Cooperation with other packages, Intelligent newline, Top
+@node Online help, Browsing file hierarchy, Intelligent newline, Top
 @comment  node-name,  next,  previous,  up
 @chapter Online help
 @cindex online help
@@ -1349,7 +1351,73 @@
 standard commands.   I might  want    to include it  in   the next
 distribution.
 
-@node Cooperation with other packages, Customizations, Online help, Top
+@node Browsing file hierarchy, Cooperation with other packages, Online help, Top
+@comment  node-name,  next,  previous,  up
+@chapter Browsing file hierarchy
+@cindex hierarchy
+@cindex browsing
+
+  When you are editing multi-file source, typing
+
+@table @kbd
+@item [prefix] d
+        @dots{} browse file hierarchy
+@end table
+
+@noindent
+asks you the parent-most file (which may be defaulted) and displays the
+documentation hierarchy in the next window.  In this buffer, the following
+commands are available.
+
+@table @kbd
+@item n
+        @dots{} move to the next line and show its contents
+@item p
+        @dots{} move to the previous line and show its contents
+@item N
+        @dots{} move to the next file in the same inclusion level
+@item P
+        @dots{} move to the previous file in the same inclusion level
+@item j
+        @dots{} move to the next line
+@item k
+        @dots{} move to the previous line
+@item u
+        @dots{} move to the parent file
+@item .
+        @dots{} show the current files contents in the next window
+@item SPC
+        @dots{} scroll up the current file window
+@item DEL, b
+        @dots{} scroll down the current file window
+@item <
+        @dots{} show the beginning of the current file
+@item >
+        @dots{} show the end of the current file
+@item >
+        @dots{} return to the previous postion after @kbd{<} or @kbd{>}
+@item RET, g
+        @dots{} open the current file in the next window
+@item mouse-2
+        @dots{} same as RET(available only with window system)
+@item o
+        @dots{} other window
+@item 1
+        @dots{} delete other windows
+@item -
+        @dots{} shrink hierarchy buffer window
+@item +
+        @dots{} enlarge hierarchy buffer window
+@item ?
+        @dots{} describe mode
+@item q
+        @dots{} quit
+@end table
+
+  Note that operations on the file contents in the next window do not work 
+correctly when you close the corresponding file.
+
+@node Cooperation with other packages, Customizations, Browsing file hierarchy, Top
 @comment  node-name,  next,  previous,  up
 @chapter Cooperation with other packages
 
@@ -1583,6 +1651,14 @@
 Alist of LaTeX's sectioning command vs its height.
 @end defvar
 
+@defvar YaTeX-hierarchy-ignore-heading-regexp
+@code{YaTeX-display-hierarchy} searches for sectioning command first, and
+comment line secondary as a file headings.  In latter case, ignore lines
+that match with regular expression of this variable.  Default value of
+this variable is RCS header expressions and mode specifying line `-*- xxxx 
+-*'.
+@end defvar
+
 @node Sample definitions, Hook variables, All customizable variables, Lisp variables
 @comment  node-name,  next,  previous,  up
 @subsection Sample definitions
--- a/docs/yatexj.tex	Sun Jan 22 14:20:46 1995 +0000
+++ b/docs/yatexj.tex	Thu Feb 02 17:18:29 1995 +0000
@@ -178,6 +178,8 @@
         (@kbd{C-c a}, @kbd{;}, @kbd{/})
 @item tabular/array環境のカラム位置ガイド
 @item 標準的 La@TeX{} コマンドのオンラインヘルプ(@kbd{C-c ?}, @kbd{C-c /})
+@item ドキュメントのインクルード構造の視覚的表示とバッファ切り替え
+(@kbd{C-c d})
 @end itemize
 
 @node Installation, Invocation, Main features, Top
@@ -1556,6 +1558,73 @@
 対する説明を書いたならばぜひ私までその説明をお送り下さい。次回の配布に含め
 たいと思います。
 
+@node Inclusion hierarchy browser
+@comment  node-name,  next,  previous,  up
+@chapter インクルード構造ブラウザ
+@cindex インクルード構造[いんくるうとこうそう]
+@cindex prefix d
+
+複数のファイルに分割しているドキュメントを書いている場合、
+
+@table @kbd
+@item [prefix] d
+        @dots{} インクルード構造ブラウズ
+@end table
+
+@noindent
+を押すと、そのドキュメントの親ファイルを聞いて来ます。ここで全てのファイル
+の親となるファイル(デフォルトが示されているので大抵はRETのみ)を入力すると
+インクルードしている全てのファイルを解析し、インクルード状況を視覚的に表示
+します。このバッファでは以下のキー操作が有効です。
+
+@table @kbd
+@item n
+        @dots{} 次の行に移動し対応するファイルを隣のバッファに表示
+@item p
+        @dots{} 上の行に移動し対応するファイルを隣のバッファに表示
+@item N
+        @dots{} 同じインクルードレベルの次のファイルに移動
+@item P
+        @dots{} 同じインクルードレベルの前のファイルに移動
+@item j
+        @dots{} 次の行に移動
+@item k
+        @dots{} 上の行に移動
+@item u
+        @dots{} 一代親にあたるファイルに移動
+@item .
+        @dots{} カーソル位置のファイルを隣のバッファに表示
+@item SPC
+        @dots{} 隣のバッファの対応ファイルをスクロールアップ
+@item DEL, b
+        @dots{} 隣のバッファの対応ファイルをスクロールダウン
+@item <
+        @dots{} 隣のバッファの対応ファイルの先頭を表示
+@item >
+        @dots{} 隣のバッファの対応ファイルの末尾を表示
+@item '
+        @dots{} (@kbd{<}や@kbd{>}の後で)元の表示位置に戻る
+@item RET, g
+        @dots{} カーソル位置のファイルを隣のバッファでオープン
+@item mouse-2
+        @dots{} RETと同じ(ウィンドウ使用時のみ)
+@item o
+        @dots{} 隣のウィンドウに移動
+@item 1
+        @dots{} 他のウィンドウを消す
+@item -
+        @dots{} ブラウズウィンドウを小さくする
+@item +
+        @dots{} ブラウズウィンドウを大きくする
+@item ?
+        @dots{} ヘルプ表示
+@item q
+        @dots{} 表示前の状態に戻る
+@end table
+
+  ただし、隣のウィンドウのファイルの内容を表示する機能に関しては、対応する
+ファイルをクローズしてしまうとうまく働きませんのでご注意ください。
+
 @node Cooperation with other packages, Customizations, Online help, Top
 @comment  node-name,  next,  previous,  up
 @chapter 他パッケージとの連携
@@ -1785,6 +1854,17 @@
 によっては hilit19 のドキュメント)を参照せよ。
 @end defvar
 
+@defvar YaTeX-sectioning-level
+LaTeXのセクション単位宣言コマンドとその論理的高さのalist。
+@end defvar
+
+@defvar YaTeX-hierarchy-ignore-heading-regexp
+Hierarchy バッファは通常ファイルヘッダとして、LaTeXのセクション宣言コマン
+ドの引数を検索し、それがなければコメント行を探すが、その際にヘッダとしては
+意味を持たないパターンをこの変数に設定する。デフォルトでは RCS ヘッダとモー
+ド指定行(-*- xxx -*-)が設定されている。
+@end defvar
+
 @node Sample definitions, Hook variables, All customizable variables, Lisp variables
 @comment  node-name,  next,  previous,  up
 @subsection カスタマイズ変数設定例
--- a/help/YATEXHLP.jp	Sun Jan 22 14:20:46 1995 +0000
+++ b/help/YATEXHLP.jp	Thu Feb 02 17:18:29 1995 +0000
@@ -1306,12 +1306,18 @@
 藤枝和宏さん(JAIST)
 	野鳥/雷鳥の Mailing List を設立して頂きました。
 
-松本憲彦さん(東京学芸大学)
+松本憲彦さん(東京学芸大)
 	マニュアルのバグを指摘して頂きました。
 
-小宮山康子さん(成蹊大学)
+小宮山康子さん(成蹊大)
 	\item[] などの補完後 [] の中にカーソルを置く要望を頂きました。
 
+竹中浩さん(東京大)
+	M-q (YaTeX-fill-paragraph) のバグを報告して頂きました。
+
+佐藤圭さん(慶應大)
+	ネストした同種のitemize環境でのindentationの不具合を指摘して頂き
+	ました。
 yatex
 (setq auto-mode-alist (cons '("\\.tex$" . yatex-mode) auto-mode-alist))
 <refer YaTeX>
Binary file yatex.el has changed
--- a/yatex.new	Sun Jan 22 14:20:46 1995 +0000
+++ b/yatex.new	Thu Feb 02 17:18:29 1995 +0000
@@ -1,12 +1,27 @@
 	What's new in YaTeX
 	yatex.el 各バージョンの変更点について
 
+1.57	同じ環境がネストしている時の M-C-a, M-C-e のバグ修正。
+	\beginの行をTABでreindentした時は\endも同じ桁に揃える。
+	リジョンを環境で括った時の中身の処理を行う関数
+	YaTeX-enclose-<環境名> をサポート。equation で括った時に中身の $ 
+	を全て消去し、verbatimで括った時はなにもしないようにした。
+	\item 行でTABした時にカーソル位置を保存。
+	\item を補完した次の section 型コマンドのデフォルトを label に。
+	hierarchyバッファでの SPC, DEL, +, - の追加。
+	fill すると kill-ring を壊してしまうのを修正。
+	数式環境でのインデントのサポート(やだなあ)。
+	中括弧がネストしたり、引数が複数ある section 型コマンドも正しく 
+	hilit するようにし、% の hilit も適正化した。
+	インデントが変わらない時のTABでも修正フラグが立っていたのを修正。
+
 1.56	[prefix] d の YaTeX-display-hierarchy を追加。
 	変数 indent-line-function に YaTeX-indent-line を設定した。
 	YaTeX-generate-simple の修正(1.51から今まで全然動かなかったのに…)。
 	NTT-jTeX を利用する時に文書をインデントしても良いように 
 	auto-fill や fill-paragraph を調整した。
 	maketitle 型コマンドが [] で終わっている時にはカーソルを括弧内に。
+	セクションコマンドの論理的高さに応じて色の濃度を変える(Mule2+X)。
 
 1.55	{}の上で [prefix] k した時に直前のコマンドが maketitle 型辞書に
 	属していれば {} のみ(フォント指定子があればそれも)を消すようにした。
--- a/yatex19.el	Sun Jan 22 14:20:46 1995 +0000
+++ b/yatex19.el	Thu Feb 02 17:18:29 1995 +0000
@@ -1,13 +1,14 @@
 ;;; -*- Emacs-Lisp -*-
 ;;; YaTeX facilities for Emacs 19
 ;;; (c )1994-1995 by HIROSE Yuuji.[yuuji@ae.keio.ac.jp]
-;;; Last modified Sun Jan 22 23:15:56 1995 on landcruiser
+;;; Last modified Thu Feb  2 23:44:30 1995 on figaro
 ;;; $Id$
 
 ;;; とりあえず hilit19 を使っている時に色が付くようにして
 ;;; メニューバーでごにょごにょできるようにしただけ。
 ;;; いったい誰がメニューバー使ってLaTeXソース書くんだろうか?
 ;;; まあいいや練習練習。後ろの方にちょっとコメントあり。
+;;; 真中辺にあるけど、hilit19.el 対応の方は結構本気。
 
 (require 'yatex)
 
@@ -207,28 +208,116 @@
    (sort (append env-table user-env-table)
 	 '(lambda (x y) (string< (car x) (car y))))))
 
+;; Other key bindings for window-system
+;(YaTeX-define-key [?\C- ] 'YaTeX-do-completion)
+(define-key YaTeX-mode-map [?\M-\C- ] 'YaTeX-mark-environment)
+
 ;; Highlightening
-;; ローカルなマクロを読み込んだ後 redraw すると
-;; ローカルマクロを keyword として光らせる(keywordじゃまずいかな…)。
-(defvar YaTeX-hilit-patterns-alist nil
-  "*Hiliting pattern alist for LaTeX text.
-Default value is equal to latex-mode's one.")
-(defvar YaTeX-hilit-pattern-adjustment-default
-  (list
-   ;;\def が define なんだから new* も define でしょう。
-   '("\\\\\\(re\\)?new\\(environment\\|command\\){" "}" define)
-   '("\\\\new\\(length\\|theorem\\|counter\\){" "}" define)
-   ;;セクションコマンドが単なるキーワードってことはないでしょう。
-   ;;(list
-    ;;(concat "\\\\\\(" YaTeX-sectioning-regexp "\\){") "}"
-    ;;'sectioning)
-   ;;eqnarray などの数式環境が入ってないみたい…
-   '("\\\\begin{\\(eqnarray\\*?\\|equation\\*?\\)}"
-     "\\\\end{\\(eqnarray\\*?\\|equation\\*?\\)}"
-     formula))
-  "Adjustment for hilit19's LaTeX hilit pattern.")
+;; メニューに比べてこっちは結構本気でやってます。
+;; だって文書構造がとっても分かり易いんだもん。
+;; みんなも hilit19.el を使おう!
+;;
+;; さて、まずは対応する {} をピカピカ範囲とするような関数を作る。
+;; これは hilit-LaTeX.el を参考にした。でも、ちゃんと section 型コマンドの
+;; 引数を数えて正しい位置までピカピカさせるよ〜ん!
+
+(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))
+	(setq cmd (substring (YaTeX-match-string 0) 1 -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))))))
+
+(defun YaTeX-19-region-large-type (pattern)
+  "Return list of large-type contents.
+Assumes PATTERN begins with `{'."
+  (if (re-search-forward pattern nil t)
+      (let ((m0 (match-beginning 0)))
+	(goto-char m0)
+	(skip-chars-forward "^ \t\n")
+	(skip-chars-forward " \t\n")
+	(cons (point)
+	      (progn (goto-char m0) (forward-list 1)
+		     (1- (point)))))))
+
+;; 些細なことだが % の前の文字もピカリとさせてしまうようで… >hilit19
+;; ↓この関数は下の hilit-set-mode-patterns の "[^\\]\\(%\\).*$" に
+;; 依存している
+(defun YaTeX-19-region-comment (pattern)
+  "Return list of comment start and end point."
+  (if (re-search-forward pattern nil t)
+      (cons (match-beginning 1) (match-end 0))))
+
+(defvar YaTeX-hilit-patterns-alist
+  '(
+    ;; comments
+    (YaTeX-19-region-comment "[^\\]\\(%\\).*$" comment)
+    
+    (YaTeX-19-region-section-type "\\\\footnote\\(mark\\|text\\)?{" keyword)
+    ("\\\\[a-z]+box" 0 keyword)
+    (YaTeX-19-region-section-type "\\\\\\(v\\|h\\)space\\(\*\\)?{" keyword)
+    
+    ;; (re-)define new commands/environments/counters
+    (YaTeX-19-region-section-type
+     "\\\\\\(re\\)?new\\(environment\\|command\\|theorem\\){" defun)
+    (YaTeX-19-region-section-type
+     "\\\\\\(re\\)?new\\(length\\|counter\\){" define)
+
+    ;; various declarations/definitions
+    (YaTeX-19-region-section-type
+     "\\\\\\(set\\|setto\\|addto\\)\\(length\\|width\\|counter\\){"
+     define)
+    (YaTeX-19-region-section-type
+     "\\\\\\(title\\|author\\|date\\|thanks\\){" define)
+
+    ("\\\\documentstyle\\(\\[.*\\]\\)?{" "}" decl)
+    ("\\\\\\(begin\\|end\\|nofiles\\|includeonly\\){" "}" decl)
+    ("\\\\\\(raggedright\\|makeindex\\|makeglossary\\|maketitle\\)\\b" 0 decl)
+    ("\\\\\\(pagestyle\\|thispagestyle\\|pagenumbering\\){" "}" decl)
+    ("\\\\\\(normalsize\\|small\\|footnotesize\\|scriptsize\\|tiny\\|large\\|Large\\|LARGE\\|huge\\|Huge\\)\\b" 0 decl)
+    ("\\\\\\(appendix\\|tableofcontents\\|listoffigures\\|listoftables\\)\\b"
+     0 decl)
+    ("\\\\\\(bf\\|em\\|it\\|rm\\|sf\\|sl\\|ss\\|tt\\)\\b" 0 decl)
+
+    ;; label-like things
+    ;;this should be customized by YaTeX-item-regexp
+    ("\\\\\\(sub\\)*item\\b\\(\\[[^]]*\\]\\)?" 0 label)
+    (YaTeX-19-region-section-type
+     "\\\\caption\\(\\[[^]]*\\]\\)?{" label)
+
+    ;; formulas
+    ("[^\\]\\\\("  "\\\\)" formula)                   ; \( \)
+    ("[^\\]\\\\\\[" "\\\\\\]" formula)                ; \[ \]
+    ("\\\\begin{\\(eqn\\|equation\\)" "\\\\end{\\(eqn\\|equation\\)" formula)
+    ("[^\\$]\\($\\($[^$]*\\$\\|[^$]*\\)\\$\\)" 1 formula) ; '$...$' or '$$...$$'
+
+    ;; things that bring in external files
+    ("\\\\\\(include\\|input\\|bibliography\\){" "}" include)
+
+    ;; "wysiwyg" emphasis -- these don't work with nested expressions
+    ;; ("{\\\\\\(em\\|it\\|sl\\)" "}" italic)
+    (YaTeX-19-region-large-type "{\\\\bf" bold)
+
+    ("``" "''" string)
+
+    ;; things that do some sort of cross-reference
+    (YaTeX-19-region-section-type
+     "\\\\\\(\\(no\\)?cite\\|\\(page\\)?ref\\|label\\|index\\|glossary\\){"
+     crossref)
+    )
+  "*Hiliting pattern alist for LaTeX text.")
+
+;;(defvar YaTeX-hilit-pattern-adjustment-default nil)
+;; ↑いらなくなった。
 (defvar YaTeX-hilit-pattern-adjustment-private nil
-  "*Private variable, same purpose as YaTeX-hilit-pattern-adjustment-default.")
+  "*Adjustment hilit-pattern-alist for default yatex-mode's pattern.")
 (defvar YaTeX-hilit-sectioning-face
   '(yellow/dodgerblue yellow/cornflowerblue)
   "*Hilightening face for sectioning unit.  '(FaceForLight FaceForDark)")
@@ -240,54 +329,55 @@
 
 ;;; セクションコマンドを、構造レベルの高さに応じて色の濃度を変える
 ;;; 背景が黒でないと何が嬉しいのか分からないに違いない.
-(let*((sectface
-       (car (if (eq hilit-background-mode 'dark) 
-		(cdr YaTeX-hilit-sectioning-face)
-	      YaTeX-hilit-sectioning-face)))
-      (sectcol (symbol-name sectface))
-      sect-pat-alist)
-  (if (string-match "/" sectcol)
-      (let (colorvalue fR fG fB bR bG bB list pat fg bg level from face)
-	(require 'yatexsec)
-	(setq fg (substring sectcol 0 (string-match "/" sectcol))
-	      bg (substring sectcol (1+ (string-match "/" sectcol)))
-	      colorvalue (x-color-values fg)
-	      fR (/ (nth 0 colorvalue) 256)
-	      fG (/ (nth 1 colorvalue) 256)
-	      fB (/ (nth 2 colorvalue) 256)
-	      colorvalue (x-color-values bg)
-	      bR (/ (nth 0 colorvalue) 256)
-	      bG (/ (nth 1 colorvalue) 256)
-	      bB (/ (nth 2 colorvalue) 256)
-	      list YaTeX-sectioning-level)
-	(while list
-	  (setq pat (concat YaTeX-ec-regexp (car (car list)) "\\*?{")
-		level (cdr (car list))
-		fg (format "hex-%02x%02x%02x"
-			   (- fR (/ (* level fR) 40))	;40 musn't be constant
-			   (- fG (/ (* level fG) 40))
-			   (- fB (/ (* level fB) 40)))
-		bg (format "hex-%02x%02x%02x"
-			   (- bR (/ (* level bR) 15))	;20 musn't be constant
-			   (- bG (/ (* level bG) 15))
-			   (- bB (/ (* level bB) 15)))
-		from (intern (format "sectioning-%d" level))
-		face (intern (concat fg "/" bg)))
-	  (hilit-translate from face)
-	  (setq sect-pat-alist
-		(cons (list pat "}" face)
-		      sect-pat-alist))
-	  (setq list (cdr list)))
-	(setq YaTeX-sectioning-patterns-alist sect-pat-alist))))
+;;; もしかして白地の時は構造レベルに応じて色を明るくしたほうが良いのか?
+(cond
+ ((and (featurep 'hilit19) (fboundp 'x-color-values))
+  (let*((sectface
+	 (car (if (eq hilit-background-mode 'dark)
+		  (cdr YaTeX-hilit-sectioning-face)
+		YaTeX-hilit-sectioning-face)))
+	(sectcol (symbol-name sectface))
+	sect-pat-alist)
+    (if (string-match "/" sectcol)
+	(let (colorvalue fR fG fB bR bG bB list pat fg bg level from face)
+	  (require 'yatexsec)
+	  (setq fg (substring sectcol 0 (string-match "/" sectcol))
+		bg (substring sectcol (1+ (string-match "/" sectcol)))
+		colorvalue (x-color-values fg)
+		fR (/ (nth 0 colorvalue) 256)
+		fG (/ (nth 1 colorvalue) 256)
+		fB (/ (nth 2 colorvalue) 256)
+		colorvalue (x-color-values bg)
+		bR (/ (nth 0 colorvalue) 256)
+		bG (/ (nth 1 colorvalue) 256)
+		bB (/ (nth 2 colorvalue) 256)
+		list YaTeX-sectioning-level)
+	  (while list
+	    (setq pat (concat YaTeX-ec-regexp (car (car list)) "\\*?{")
+		  level (cdr (car list))
+		  fg (format "hex-%02x%02x%02x"
+			     (- fR (/ (* level fR) 40)) ;40 musn't be constant
+			     (- fG (/ (* level fG) 40))
+			     (- fB (/ (* level fB) 40)))
+		  bg (format "hex-%02x%02x%02x"
+			     (- bR (/ (* level bR) 15)) ;20 musn't be constant
+			     (- bG (/ (* level bG) 15))
+			     (- bB (/ (* level bB) 15)))
+		  from (intern (format "sectioning-%d" level))
+		  face (intern (concat fg "/" bg)))
+	    (hilit-translate from face)
+	    (setq sect-pat-alist
+		  (cons;;(list pat "}" face)
+		   (list 'YaTeX-19-region-section-type pat face)
+		   sect-pat-alist))
+	    (setq list (cdr list)))
+	  (setq YaTeX-sectioning-patterns-alist sect-pat-alist))))))
 
-(defun YaTeX-19-collect-macro ()
+;; ローカルなマクロを読み込んだ後 redraw すると
+;; ローカルマクロを keyword として光らせる(keywordじゃまずいかな…)。
+(defun YaTeX-19-collect-macros ()
   (cond
    ((and (featurep 'hilit19) (fboundp 'hilit-translate))
-    (or YaTeX-hilit-patterns-alist
-	(let ((alist (cdr (assq 'latex-mode hilit-patterns-alist))))
-	  (setcar (assoc "\\\\item\\(\\[[^]]*\\]\\)?" alist)
-		  (concat YaTeX-item-regexp "\\b\\(\\[[^]]*\\]\\)?"))
-	  (setq YaTeX-hilit-patterns-alist alist)))
     (let ((get-face
 	   (function
 	    (lambda (table)
@@ -306,17 +396,18 @@
 		 (append
 		  YaTeX-sectioning-patterns-alist
 		  YaTeX-hilit-pattern-adjustment-private
-		  YaTeX-hilit-pattern-adjustment-default
+		  ;;YaTeX-hilit-pattern-adjustment-default
 		  YaTeX-hilit-patterns-alist
 		  (list
 		   (list
+		    'YaTeX-19-region-section-type
 		    (concat "\\\\\\("
 			    (mapconcat
 			     (function (lambda (s) (regexp-quote (car s))))
 			     (append user-section-table tmp-section-table)
 			     "\\|")
 			    "\\){")
-		    "}" 'keyword)
+		    'keyword)
 		   (list
 		    (concat "\\\\\\("
 			    (mapconcat
@@ -326,17 +417,64 @@
 			    "\\)\\b")
 		    0 'macro))))
 	   hilit-patterns-alist)))))
-(YaTeX-19-collect-macro)
+;;(YaTeX-19-collect-macros)	;causes an error
 (defun YaTeX-hilit-recenter (arg)
   "Collect current local macro and hilit-recenter."
   (interactive "P")
-  (YaTeX-19-collect-macro)
+  (YaTeX-19-collect-macros)
   (hilit-recenter arg))
 (if (fboundp 'hilit-recenter)		;Replace hilit-recenter with
     (mapcar (function (lambda (key)	;YaTeX-hilit-recenter in yatex-mode
 			(define-key YaTeX-mode-map key 'YaTeX-hilit-recenter)))
 	    (where-is-internal 'hilit-recenter)))
 
+(defun YaTeX-switch-to-new-window ()
+  (let ((c 0) (i 1) (free (make-string win:max-configs ? )))
+    (while (< i win:max-configs)
+      (or (aref win:configs i) (aset free i (+ i win:base-key)))
+      (setq i (1+ i)))
+    (while (not (string-match (char-to-string c) free))
+      (message "Which window to create? [%s]: " free)
+      (setq c (read-char)))
+    (message "Creating window [%c]" c)
+    (set-buffer (get-buffer-create "*scratch*"))
+    (win:switch-window (- c win:base-key))))
+
+(defun YaTeX-visit-main-other-frame ()
+  "Visit main file in other frame.
+WARNING, This code is not perfect."
+  (interactive)
+  (if (YaTeX-main-file-p) (message "I think this is main LaTeX source.")
+    (let (parent)
+      (save-excursion (YaTeX-visit-main t) (setq parent (current-buffer)))
+      (cond
+       ((get-buffer-window parent t)
+	(goto-buffer-window parent))
+       ((and (featurep 'windows) win:use-frame)
+	(YaTeX-switch-to-new-window)
+	(switch-to-buffer parent))
+       (t (switch-to-buffer-other-frame (buffer-name parent)))))))
+
+(defun YaTeX-goto-corresponding-*-other-frame (arg)
+  "Go to corresponding object in other frame."
+  (interactive "P")
+  (let (b p)
+    (save-window-excursion
+      (save-excursion
+	(YaTeX-goto-corresponding-* arg)
+	(setq b (current-buffer) p (point))))
+    (cond
+     ((get-buffer-window b t)
+      (goto-buffer-window b)
+      (goto-char p))
+     ((and (featurep 'windows) win:use-frame)
+      (YaTeX-switch-to-new-window)
+      (switch-to-buffer b)
+      (goto-char p))
+     (t (switch-to-buffer-other-frame (buffer-name b))
+	(goto-char p))))
+)
+
 ;;; reverseVideo にして hilit-background-mode を 'dark
 ;;; にしている人は数式などが暗くなりすぎて見づらいかもしれない。
 ;;; 次のコードを hilit19 をロードしている場所の直後に置くとちょっ
--- a/yatexadd.el	Sun Jan 22 14:20:46 1995 +0000
+++ b/yatexadd.el	Thu Feb 02 17:18:29 1995 +0000
@@ -1,8 +1,8 @@
 ;;; -*- Emacs-Lisp -*-
 ;;; YaTeX add-in functions.
-;;; yatexadd.el rev.12
+;;; yatexadd.el rev.13
 ;;; (c )1991-1995 by HIROSE Yuuji.[yuuji@ae.keio.ac.jp]
-;;; Last modified Sun Jan 22 23:15:48 1995 on landcruiser
+;;; Last modified Thu Jan 26 03:31:20 1995 on figaro
 ;;; $Id$
 
 ;;;
@@ -286,7 +286,10 @@
       (concat "[" label "]")))
 )
 
-(defun YaTeX:item () " ")
+(defun YaTeX:item ()
+  (YaTeX-indent-line)
+  (setq section-name "label")
+  " ")
 (fset 'YaTeX:item\[\] 'YaTeX:item)
 (fset 'YaTeX:subitem 'YaTeX:item)
 (fset 'YaTeX:subsubitem 'YaTeX:item)
--- a/yatexenv.el	Sun Jan 22 14:20:46 1995 +0000
+++ b/yatexenv.el	Thu Feb 02 17:18:29 1995 +0000
@@ -2,7 +2,7 @@
 ;;; YaTeX environment-specific functions.
 ;;; yatexenv.el
 ;;; (c ) 1994 by HIROSE Yuuji.[yuuji@ae.keio.ac.jp]
-;;; Last modified Thu Nov 24 04:33:18 1994 on 98fa
+;;; Last modified Thu Feb  2 16:11:12 1995 on pajero
 ;;; $Id$
 
 ;;;
@@ -165,30 +165,19 @@
 ;; Functions for itemize/enumerate/list environments
 ;;;
 
-(defun YaTeX-indent-for-item ()
-  (let (col (p (point)) begenv)
-    (save-excursion
-      (YaTeX-beginning-of-environment t)
-      (setq begenv (point-end-of-line))
-      (goto-char p)
-      (if (YaTeX-search-active-backward "\\item" YaTeX-comment-prefix begenv t)
-	  (setq col (current-column))))
-    (if col (indent-to col) (YaTeX-indent-line)))
-)
-
 (defvar YaTeX-item-for-insert "\\item ")
 (defun YaTeX-intelligent-newline-itemize ()
   "Insert '\\item '."
-  (YaTeX-indent-for-item)
   (insert YaTeX-item-for-insert)
+  (YaTeX-indent-line)
 )
 (fset 'YaTeX-intelligent-newline-enumerate 'YaTeX-intelligent-newline-itemize)
 (fset 'YaTeX-intelligent-newline-list 'YaTeX-intelligent-newline-itemize)
 
 (defun YaTeX-intelligent-newline-description ()
-  (YaTeX-indent-for-item)
   (insert "\\item[] ")
   (forward-char -2)
+  (YaTeX-indent-line)
 )
 
 
@@ -211,3 +200,103 @@
     (if (and env func (fboundp func))
 	(funcall func)))
 )
+
+;;;
+;; Environment-specific line indenting functions
+;;;
+;;;###autoload
+(defun YaTeX-indent-line-equation ()
+  "Indent a line in equation family."
+  (let ((p (point)) (l-r 0) right-p peol depth (mp YaTeX-environment-indent))
+    (if (save-excursion
+	  (beginning-of-line)
+	  (skip-chars-forward " \t")
+	  (looking-at "\\\\right\\b"))
+	(progn (YaTeX-reindent
+		(save-excursion (YaTeX-goto-corresponding-leftright)
+				(current-column))))
+      (save-excursion
+	(forward-line -1)
+	(while (and (not (bobp)) (YaTeX-on-comment-p))
+	  (forward-line -1))
+	;;(beginning-of-line)	;must be unnecessary
+	(skip-chars-forward " \t")
+	(if (eolp) (error "Math-environment can't have a null line!!"))
+	(setq depth (current-column)
+	      peol (point-end-of-line))
+	(while (re-search-forward
+		"\\\\\\(\\(left\\)\\|\\(right\\)\\)\\b" peol t)
+	  (setq l-r (+ l-r (if (match-beginning 2) 1 -1))))
+	(cond
+	 ((progn (beginning-of-line)
+		 (re-search-forward "\\\\\\\\\\s *$" (point-end-of-line) t))
+	  ;;If previous line has `\\', this indentation is always normal.
+	  (setq depth (+ (YaTeX-current-indentation) mp)))
+	 ((> l-r 0)
+	  (beginning-of-line)
+	  (search-forward "\\left" peol)
+	  (goto-char (1+ (match-beginning 0)))
+	  (setq depth (current-column)))
+	 ((< l-r 0)
+	  (goto-char (match-beginning 0))	;should be \right
+	  (YaTeX-goto-corresponding-leftright)
+	  (beginning-of-line)
+	  (skip-chars-forward " \t")
+	  (setq depth (+ (current-column) mp))) ;+mp is good?
+	 (t				;if \left - \right = 0
+	  (cond
+	   ((re-search-forward "\\\\\\\\\\s *$" peol t)
+	    (setq depth (+ (YaTeX-current-indentation) mp)))
+	   ((re-search-forward "\\\\end{" peol t)
+	    nil)			;same indentation as previous line's
+	   ((re-search-forward "\\\\begin{" peol t)
+	    (setq depth (+ depth mp)))
+	   (t
+	    (or (bobp) (forward-line -1))
+	    (cond
+	     ((re-search-forward
+	       "\\\\\\\\\\s *$\\|\\\\begin{" (point-end-of-line) t)
+	      (setq depth (+ depth mp)))
+	     )))))
+	(goto-char p))
+      (YaTeX-reindent depth))))
+
+;;;###autoload
+(defun YaTeX-goto-corresponding-leftright ()
+  "Go to corresponding \left or \right.
+Note that this function assumes the corresponding \left\right
+is on another line."
+  (let ((YaTeX-struct-begin "\\left%1")
+	(YaTeX-struct-end "\\right%1")
+	(YaTeX-struct-name-regexp "[][(){}.|]"))
+    (YaTeX-goto-corresponding-environment t)))
+
+;;;
+;; Functions for formatting region being enclosed with environment
+;;;
+; These functions must take two argument; region-beginning, region-end.
+
+(defun YaTeX-enclose-equation (beg end)
+  (goto-char beg)
+  (save-restriction
+    (let (m0 bsl)
+      (narrow-to-region beg end)
+      (while (YaTeX-re-search-active-forward
+	      "\\(\\$\\)" YaTeX-comment-prefix nil t)
+	(goto-char (setq m0 (match-beginning 0)))
+	(setq bsl 0)
+	(if (and (not (bobp)) (= (char-after (1- (point))) ?\\ ))
+	    (while (progn (forward-char -1) (= (char-after (point)) ?\\ ))
+	      (setq bsl (1+ bsl))))
+	(goto-char m0)
+	(if (= 0 (% bsl 2))
+	    (delete-char 1)
+	  (forward-char 1))))))
+
+(fset 'YaTeX-enclose-eqnarray 'YaTeX-enclose-equation)
+(fset 'YaTeX-enclose-eqnarray* 'YaTeX-enclose-equation)
+
+(defun YaTeX-enclose-verbatim (beg end)) ;do nothing when enclose verbatim
+(fset 'YaTeX-enclose-verbatim* 'YaTeX-enclose-verbatim)
+
+(provide 'yatexenv)
--- a/yatexhie.el	Sun Jan 22 14:20:46 1995 +0000
+++ b/yatexhie.el	Thu Feb 02 17:18:29 1995 +0000
@@ -2,21 +2,22 @@
 ;;; YaTeX hierarchy browser.
 ;;; yatexhie.el
 ;;; (c )1995 by HIROSE Yuuji [yuuji@ae.keio.ac.jp]
-;;; Last modified Sun Jan 22 23:15:25 1995 on landcruiser
+;;; Last modified Thu Feb  2 23:55:59 1995 on figaro
 ;;; $Id$
 
 ;; ----- Customizable variables -----
-(defvar YaTeX-hierarchy-inspect-mode t
-  "*Non-nil inspects the contents of file of cursor position.")
-
+(defvar YaTeX-hierarchy-ignore-heading-regexp
+  "\\$[A-Z][a-z]+: .* \\$\\|-\\*- .* -\\*-"
+  "*Regexp of lines to ignore as files' headline.")
 
 ;; ----- General variables -----
 (defvar YaTeX-default-TeX-extensions "\\.\\(tex\\|sty\\)")
 (defvar YaTeX-hierarchy-current-main nil)
 (defvar YaTeX-hierarchy-buffer-message
   (concat
-   "n)ext p)rev N)extsamelev P)revsamelev u)p K)ill-buffer RET)select"
-   (if (and YaTeX-emacs-19 window-system) " Mouse2)select" "")))
+   "n)ext p)rev N)extsame P)revsame u)p K)illbuf RET)select"
+   (if (and YaTeX-emacs-19 window-system) " Mouse2)select" "")
+   " ?)help"))
 (defvar YaTeX-hierarchy-saved-wc nil "Saved window configuration.")
 
 ;; ----- Functions for parsing hierarchy -----
@@ -81,23 +82,30 @@
   (save-excursion
     (set-buffer (find-file-noselect file))
     (save-excursion
-      (goto-char (point-min))
-      (cond
-       ((and
-	 (YaTeX-re-search-active-forward
-	  (concat YaTeX-ec-regexp YaTeX-sectioning-regexp)
-	  YaTeX-comment-prefix nil t)
-	 (re-search-forward "{\\([^}]+\\)}" nil t))
-	(goto-char (match-beginning 1))
-	(skip-chars-forward " \t\n")
-	(buffer-substring (point)
-			  (min (point-end-of-line)
-			       (match-end 1))))
-       ((re-search-forward "^ *%\\([^#]\\)" nil t)
-	(goto-char (match-beginning 1))
-	(skip-chars-forward " \t")
-	(buffer-substring (point) (point-end-of-line)))
-       (t "")))))
+      (let (p)
+	(goto-char (point-min))
+	(cond
+	 ((re-search-forward
+	   (concat YaTeX-ec-regexp YaTeX-sectioning-regexp) nil t)
+	  (search-forward "{")
+	  (forward-char -1)
+	  (setq p (condition-case nil
+		      (progn (forward-list 1) (1- (point)))
+		    (error (point-end-of-line))))
+	  (goto-char (1+ (match-beginning 0)))
+	  (skip-chars-forward " \t\n")
+	  (buffer-substring (point) (min (point-end-of-line) p)))
+	 ((catch 'found
+	    (while (re-search-forward "^ *%\\([^#]\\)" nil t)
+	      (or (re-search-forward
+		   YaTeX-hierarchy-ignore-heading-regexp
+		   (point-end-of-line) t)
+		  (throw 'found t))))
+	  (beginning-of-line)
+	  (search-forward "%")
+	  (skip-chars-forward "% \t")
+	  (buffer-substring (point) (point-end-of-line)))
+	 (t ""))))))
 
 (defun YaTeX-display-a-hierachy (hier level)
   "Put a HIER of document hierarchy.
@@ -177,12 +185,19 @@
 
 \\[YaTeX-hierarchy-next]	next line
 \\[YaTeX-hierarchy-prev]	previous line
-\\[YaTeX-hierarchy-forward]	move forward in same level
-\\[YaTeX-hierarchy-backward]	move backward in same level
+\\[YaTeX-hierarchy-forward]	move forward in the same level
+\\[YaTeX-hierarchy-backward]	move backward in the same level
 \\[YaTeX-hierarchy-up-document]	move to parent file
 \\[delete-other-windows]	delete other windows
 \\[other-window]	other window
-\\[YaTeX-hierarchy-show]	show buffer contents in the next window
+\\[shrink-window]	shrink window
+\\[enlarge-window]	enlarge window
+\\[YaTeX-hierarchy-show]	show file contents in the next window
+\\[YaTeX-hierarchy-scroll-up]	scroll up file contents buffer
+\\[YaTeX-hierarchy-scroll-down]	scroll down file contents buffer
+\\[YaTeX-hierarchy-top]	show the top of file contents
+\\[YaTeX-hierarchy-bottom]	show the bottom of file contents
+\\[YaTeX-hierarchy-lastpos]	return to the previous position
 \\[YaTeX-hierarchy-select]	select file
 \\[YaTeX-hierarchy-mouse-select]	select
 "
@@ -214,7 +229,7 @@
   (interactive "p")
   (forward-line arg)
   (skip-chars-forward "- +\\|")
-  (if (and (/= arg 0) YaTeX-hierarchy-inspect-mode (not quiet))
+  (if (and (/= arg 0) (not quiet))
       (YaTeX-hierarchy-select t))
   (message YaTeX-hierarchy-buffer-message))
 
@@ -278,7 +293,9 @@
   (interactive "p")
   (YaTeX-hierarchy-next 0)		;move to file name column
   (if (bolp) (error "Not on file name line"))
-  (let ((file (buffer-substring (point) (point-end-of-line))))
+  (let ((file (buffer-substring
+	       (point)
+	       (progn (skip-chars-forward "^ \t") (point)))))
     (YaTeX-hierarchy-next arg)
     (cond
      ((get-buffer file)
@@ -321,13 +338,51 @@
       (set-window-configuration (car YaTeX-hierarchy-saved-wc))
     (bury-buffer nil)))
 
-(defun YaTeX-hierarchy-toggle-inspection (arg)
-  "Toggle inspection mode of YaTeX-hierarchy buffer."
+(defun YaTeX-hierarchy-scroll-up (arg &optional action)
+  "Scroll up file contents of YaTeX-hierarchy."
   (interactive "P")
-  (setq YaTeX-hierarchy-inspect-mode
-	(or arg (not YaTeX-hierarchy-inspect-mode)))
-  (message "YaTeX hierarchy inspection mode %s"
-	   (if YaTeX-hierarchy-inspect-mode "ON" "OFF")))
+  (YaTeX-hierarchy-next 0 t)
+  (let*((bufname (buffer-substring
+		  (point)
+		  (save-excursion (skip-chars-forward "^ \t") (point))))
+	(buf (get-buffer bufname))
+	(cw (selected-window)))
+    (cond
+     ((and buf (get-buffer-window buf))
+      (select-window (get-buffer-window buf)))
+     ((and buf (YaTeX-showup-buffer buf nil t)) t)
+     (t (YaTeX-hierarchy-select nil)))
+    (unwind-protect
+	(cond
+	 ((eq action 'down)	(scroll-down arg))
+	 ((eq action 'top)	(beginning-of-buffer))
+	 ((eq action 'bottom)	(end-of-buffer))
+	 ((eq action 'last)	(exchange-point-and-mark))
+	 (t (scroll-up arg)))
+      (select-window cw))))
+
+(defun YaTeX-hierarchy-scroll-down (arg)
+  "Scroll down file contents of YaTeX-hierarchy."
+  (interactive "P")
+  (YaTeX-hierarchy-scroll-up arg 'down))
+
+(defun YaTeX-hierarchy-top ()
+  "Show the top of YaTeX-hierarchy inspection buffer's."
+  (interactive)
+  (YaTeX-hierarchy-scroll-up nil 'top)
+)
+
+(defun YaTeX-hierarchy-bottom ()
+  "Show the top of YaTeX-hierarchy inspection buffer's."
+  (interactive)
+  (YaTeX-hierarchy-scroll-up nil 'bottom)
+)
+
+(defun YaTeX-hierarchy-lastpos ()
+  "Go to last position in YaTeX-hierarchy buffer."
+  (interactive)
+  (YaTeX-hierarchy-scroll-up nil 'last)
+)
 
 ;; ----- Setting up keymap -----
 (defvar YaTeX-hierarchy-mode-map nil "Keymap used in YaTeX-hierarchy-mode.")
@@ -347,9 +402,17 @@
   (define-key YaTeX-hierarchy-mode-map "K"	'YaTeX-hierarchy-kill-buffer)
   (define-key YaTeX-hierarchy-mode-map "1"	'delete-other-windows)
   (define-key YaTeX-hierarchy-mode-map "o"	'other-window)
+  (define-key YaTeX-hierarchy-mode-map "-"	'shrink-window)
+  (define-key YaTeX-hierarchy-mode-map "+"	'enlarge-window)
   (define-key YaTeX-hierarchy-mode-map "."	'YaTeX-hierarchy-show)
+  (define-key YaTeX-hierarchy-mode-map " "	'YaTeX-hierarchy-scroll-up)
+  (define-key YaTeX-hierarchy-mode-map "b"	'YaTeX-hierarchy-scroll-down)
+  (define-key YaTeX-hierarchy-mode-map "\C-?"	'YaTeX-hierarchy-scroll-down)
   (define-key YaTeX-hierarchy-mode-map "\C-m"	'YaTeX-hierarchy-select)
-  (define-key YaTeX-hierarchy-mode-map ";" 'YaTeX-hierarchy-toggle-inspection)
+  (define-key YaTeX-hierarchy-mode-map "<"	'YaTeX-hierarchy-top)
+  (define-key YaTeX-hierarchy-mode-map ">"	'YaTeX-hierarchy-bottom)
+  (define-key YaTeX-hierarchy-mode-map "'"	'YaTeX-hierarchy-lastpos)
+  (define-key YaTeX-hierarchy-mode-map "g"	'YaTeX-hierarchy-select)
   (define-key YaTeX-hierarchy-mode-map "q"	'YaTeX-hierarchy-quit)
   (define-key YaTeX-hierarchy-mode-map "?"	'describe-mode)
   (if (and YaTeX-emacs-19 window-system)
--- a/yatexhlp.el	Sun Jan 22 14:20:46 1995 +0000
+++ b/yatexhlp.el	Thu Feb 02 17:18:29 1995 +0000
@@ -2,7 +2,7 @@
 ;;; YaTeX helper with LaTeX commands and macros.
 ;;; yatexhlp.el
 ;;; (c )1994 by HIROSE Yuuji.[yuuji@ae.keio.ac.jp]
-;;; Last modified Sat Nov 12 04:20:26 1994 on VFR
+;;; Last modified Mon Jan 23 10:17:11 1995 on pajero
 ;;; $Id$
 
 (let ((help-file (concat "YATEXHLP."
@@ -151,7 +151,7 @@
   (if (and (= (current-column) 1) (= (preceding-char) ?.) (eolp))
       (let ((cbuf (current-buffer)))
 	(beginning-of-line)
-	(kill-line 1)
+	(delete-region (point) (progn (forward-line 1) (point)))
 	(save-excursion
 	  (YaTeX-help-add-entry
 	   YaTeX-help-command-current YaTeX-help-file-current))
--- a/yatexlib.el	Sun Jan 22 14:20:46 1995 +0000
+++ b/yatexlib.el	Thu Feb 02 17:18:29 1995 +0000
@@ -2,7 +2,7 @@
 ;;; YaTeX library of general functions.
 ;;; yatexlib.el
 ;;; (c )1994-1995 by HIROSE Yuuji.[yuuji@ae.keio.ac.jp]
-;;; Last modified Sun Jan 22 23:15:03 1995 on landcruiser
+;;; Last modified Thu Jan 26 11:15:29 1995 on pajero
 ;;; $Id$
 
 ;;;###autoload
@@ -128,7 +128,7 @@
 that gives the maximum value by the FUNC.  FUNC should take an argument
 of its window object.  Non-nil for optional third argument SELECT selects
 that window.  This function never selects minibuffer window."
-  (or (and (if YaTeX-emacs-19
+  (or (and (if (and YaTeX-emacs-19 select)
 	       (get-buffer-window buffer t)
 	     (get-buffer-window buffer))
 	   (progn
@@ -355,4 +355,14 @@
     (read-with-history-in hsym prompt init))
    (t (read-string prompt init))))
 
+;;;
+;; Interface function for windows.el
+;;;
+;;;###autoload
+(defun YaTeX-switch-to-window ()
+  "Switch to windows.el's window decided by last pressed key."
+  (interactive)
+  (or (featurep 'windows) (error "Why don't you use `windows.el'?"))
+  (win-switch-to-window 1 (- last-command-char win:base-key)))
+
 (provide 'yatexlib)
--- a/yatexmth.el	Sun Jan 22 14:20:46 1995 +0000
+++ b/yatexmth.el	Thu Feb 02 17:18:29 1995 +0000
@@ -1,8 +1,8 @@
 ;;; -*- Emacs-Lisp -*-
 ;;; YaTeX math-mode-specific functions.
-;;; yatexmth.el rev.3
+;;; yatexmth.el rev.4
 ;;; (c )1993-1995 by HIROSE Yuuji [yuuji@ae.keio.ac.jp]
-;;; Last modified Sun Jan 22 23:14:51 1995 on landcruiser
+;;; Last modified Fri Jan 27 23:57:40 1995 on VFR
 ;;; $Id$
 
 ;;; [Customization guide]
@@ -228,6 +228,9 @@
    ("\\-"	"leftharpoondown" "__\n\\")
    ("-/"	"rightharpoondown"  "__\n/")
    ("-\\"	"rightharpoonup" "~~\n\\")
+   ;;left and right
+   ("left"	"left"		"(leftmark)")
+   ("right"	"right"		"(rightmark)")
    ;other marks
    ("Z"		"aleph"		"|\\|")
    ("|\\|"	"aleph"		"|\\|")
@@ -671,7 +674,9 @@
       (delete-region beg (point))
       (call-interactively (global-key-binding this-key)))
      ((eq result 'select)
-      (message "Done."))
+      (message "Done.")
+      (setq YaTeX-current-completion-type 'maketitle)
+      (insert (YaTeX-addin single-command)))
      ((eq result 'exit)
       (delete-region beg (point))
       (YaTeX-toggle-math-mode))
--- a/yatexprc.el	Sun Jan 22 14:20:46 1995 +0000
+++ b/yatexprc.el	Thu Feb 02 17:18:29 1995 +0000
@@ -2,7 +2,7 @@
 ;;; YaTeX process handler.
 ;;; yatexprc.el
 ;;; (c )1993-1995 by HIROSE Yuuji.[yuuji@ae.keio.ac.jp]
-;;; Last modified Sun Jan 22 23:14:44 1995 on landcruiser
+;;; Last modified Sat Jan 28 01:01:44 1995 on VFR
 ;;; $Id$
 
 (require 'yatex)
@@ -632,7 +632,11 @@
     (setq cmd
 	  (read-string-with-history
 	   "Edit command line: "
-	   (format cmd (YaTeX-get-preview-file-name))
+	   (format cmd
+		   (if (get 'dvi2-command 'region)
+		       (substring YaTeX-texput-file
+				  0 (rindex YaTeX-texput-file ?.))
+		     (YaTeX-get-preview-file-name)))
 	   'YaTeX-lpr-command-history))
     (save-excursion
       (YaTeX-visit-main t) ;;change execution directory
--- a/yatexsec.el	Sun Jan 22 14:20:46 1995 +0000
+++ b/yatexsec.el	Thu Feb 02 17:18:29 1995 +0000
@@ -2,7 +2,7 @@
 ;;; YaTeX sectioning browser.
 ;;; yatexsec.el
 ;;; (c ) 1994 by HIROSE Yuuji [yuuji@ae.keio.ac.jp]
-;;; Last modified Fri Nov 25 04:46:42 1994 on VFR
+;;; Last modified Tue Jan 24 23:19:14 1995 on VFR
 ;;; $Id$
 
 (defvar YaTeX-sectioning-level
@@ -152,7 +152,8 @@
   (interactive "p")
   (if (eq (selected-window) (minibuffer-window))
       (let*((command (buffer-string))
-	    (aster (equal (substring command -1) "*"))
+	    (aster (and (string< "" command)
+			(equal (substring command -1) "*")))
 	    (command (if aster (substring command 0 -1) command))
 	    (alist YaTeX-sectioning-level)
 	    (level 0))

yatex.org