yatex
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 diff
1.1 --- a/docs/yatex.ref Sun Jan 22 14:20:46 1995 +0000 1.2 +++ b/docs/yatex.ref Thu Feb 02 17:18:29 1995 +0000 1.3 @@ -117,7 +117,8 @@ 1.4 1.5 ◆itemの桁揃え [prefix] i 1.6 1.7 - \item を使う環境中のみ有効です。 1.8 + \item を使う環境中のみ有効です。\item の項目全体をハングインデ 1.9 + ントします。 1.10 1.11 ◆LaTeXコマンド変更 [prefix] c 1.12 1.13 @@ -152,6 +153,9 @@ 1.14 「おまかせ改行」は tabular, array, itemize, enumerate, list, 1.15 description 環境で有効です。 1.16 1.17 + 1.18 + ◆インクルード構造ブラウズ [prefix] d 1.19 + 1.20 広瀬雄二 1.21 yuuji@ae.keio.ac.jp 1.22 pcs39334@asciinet.or.jp
2.1 --- a/docs/yatexe.tex Sun Jan 22 14:20:46 1995 +0000 2.2 +++ b/docs/yatexe.tex Thu Feb 02 17:18:29 1995 +0000 2.3 @@ -36,10 +36,11 @@ 2.4 * Cursor jump:: Jumping to related position 2.5 * Changing and Deleting:: Changing/deleting certain unit of text 2.6 * Filling:: Filling an item or paragraph 2.7 -* Updation of @code{\includeonly}:: Maintaining @code{\includeonly} 2.8 -* What column?:: Column position guide in tabular 2.9 +* Updation of includeonly:: Free from maintaining includeonly 2.10 +* What column?:: Guidance to tabular column 2.11 * Intelligent newline:: Guess requisites of new line 2.12 * Online help:: On-line documentation of LaTeX 2.13 +* Browsing file hierarchy:: Walking through file hierarchy 2.14 * Cooperation with other packages:: Work well with gmhist, min-out 2.15 * Customizations:: How to breed `Wild Bird' 2.16 * Etcetera:: YaTeX is acquisitive. 2.17 @@ -138,6 +139,7 @@ 2.18 (@kbd{C-c a}, @kbd{;}, @kbd{:}) 2.19 @item Online help for the popular La@TeX{} commands 2.20 (@kbd{C-c ?}, @kbd{C-c /})(English help is not yet supported) 2.21 +@item Document files hierarchy browser (@kbd{C-c d}) 2.22 @end itemize 2.23 2.24 @node Installation, Typesetting, Main features, Top 2.25 @@ -1180,7 +1182,7 @@ 2.26 character on a line changes the fill-prefix temporarily to the depth of 2.27 the line. 2.28 2.29 -@node Updation of @code{\includeonly}, What column?, Filling, Top 2.30 +@node Updation of includeonly, What column?, Filling, Top 2.31 @comment node-name, next, previous, up 2.32 @chapter Updation of @code{\includeonly} 2.33 @cindex includeonly 2.34 @@ -1299,7 +1301,7 @@ 2.35 useful. See the definition of the function 2.36 @code{YaTeX-intelligent-newline-itemize} as an example. 2.37 2.38 -@node Online help, Cooperation with other packages, Intelligent newline, Top 2.39 +@node Online help, Browsing file hierarchy, Intelligent newline, Top 2.40 @comment node-name, next, previous, up 2.41 @chapter Online help 2.42 @cindex online help 2.43 @@ -1349,7 +1351,73 @@ 2.44 standard commands. I might want to include it in the next 2.45 distribution. 2.46 2.47 -@node Cooperation with other packages, Customizations, Online help, Top 2.48 +@node Browsing file hierarchy, Cooperation with other packages, Online help, Top 2.49 +@comment node-name, next, previous, up 2.50 +@chapter Browsing file hierarchy 2.51 +@cindex hierarchy 2.52 +@cindex browsing 2.53 + 2.54 + When you are editing multi-file source, typing 2.55 + 2.56 +@table @kbd 2.57 +@item [prefix] d 2.58 + @dots{} browse file hierarchy 2.59 +@end table 2.60 + 2.61 +@noindent 2.62 +asks you the parent-most file (which may be defaulted) and displays the 2.63 +documentation hierarchy in the next window. In this buffer, the following 2.64 +commands are available. 2.65 + 2.66 +@table @kbd 2.67 +@item n 2.68 + @dots{} move to the next line and show its contents 2.69 +@item p 2.70 + @dots{} move to the previous line and show its contents 2.71 +@item N 2.72 + @dots{} move to the next file in the same inclusion level 2.73 +@item P 2.74 + @dots{} move to the previous file in the same inclusion level 2.75 +@item j 2.76 + @dots{} move to the next line 2.77 +@item k 2.78 + @dots{} move to the previous line 2.79 +@item u 2.80 + @dots{} move to the parent file 2.81 +@item . 2.82 + @dots{} show the current files contents in the next window 2.83 +@item SPC 2.84 + @dots{} scroll up the current file window 2.85 +@item DEL, b 2.86 + @dots{} scroll down the current file window 2.87 +@item < 2.88 + @dots{} show the beginning of the current file 2.89 +@item > 2.90 + @dots{} show the end of the current file 2.91 +@item > 2.92 + @dots{} return to the previous postion after @kbd{<} or @kbd{>} 2.93 +@item RET, g 2.94 + @dots{} open the current file in the next window 2.95 +@item mouse-2 2.96 + @dots{} same as RET(available only with window system) 2.97 +@item o 2.98 + @dots{} other window 2.99 +@item 1 2.100 + @dots{} delete other windows 2.101 +@item - 2.102 + @dots{} shrink hierarchy buffer window 2.103 +@item + 2.104 + @dots{} enlarge hierarchy buffer window 2.105 +@item ? 2.106 + @dots{} describe mode 2.107 +@item q 2.108 + @dots{} quit 2.109 +@end table 2.110 + 2.111 + Note that operations on the file contents in the next window do not work 2.112 +correctly when you close the corresponding file. 2.113 + 2.114 +@node Cooperation with other packages, Customizations, Browsing file hierarchy, Top 2.115 @comment node-name, next, previous, up 2.116 @chapter Cooperation with other packages 2.117 2.118 @@ -1583,6 +1651,14 @@ 2.119 Alist of LaTeX's sectioning command vs its height. 2.120 @end defvar 2.121 2.122 +@defvar YaTeX-hierarchy-ignore-heading-regexp 2.123 +@code{YaTeX-display-hierarchy} searches for sectioning command first, and 2.124 +comment line secondary as a file headings. In latter case, ignore lines 2.125 +that match with regular expression of this variable. Default value of 2.126 +this variable is RCS header expressions and mode specifying line `-*- xxxx 2.127 +-*'. 2.128 +@end defvar 2.129 + 2.130 @node Sample definitions, Hook variables, All customizable variables, Lisp variables 2.131 @comment node-name, next, previous, up 2.132 @subsection Sample definitions
3.1 --- a/docs/yatexj.tex Sun Jan 22 14:20:46 1995 +0000 3.2 +++ b/docs/yatexj.tex Thu Feb 02 17:18:29 1995 +0000 3.3 @@ -178,6 +178,8 @@ 3.4 (@kbd{C-c a}, @kbd{;}, @kbd{/}) 3.5 @item tabular/array環境のカラム位置ガイド 3.6 @item 標準的 La@TeX{} コマンドのオンラインヘルプ(@kbd{C-c ?}, @kbd{C-c /}) 3.7 +@item ドキュメントのインクルード構造の視覚的表示とバッファ切り替え 3.8 +(@kbd{C-c d}) 3.9 @end itemize 3.10 3.11 @node Installation, Invocation, Main features, Top 3.12 @@ -1556,6 +1558,73 @@ 3.13 対する説明を書いたならばぜひ私までその説明をお送り下さい。次回の配布に含め 3.14 たいと思います。 3.15 3.16 +@node Inclusion hierarchy browser 3.17 +@comment node-name, next, previous, up 3.18 +@chapter インクルード構造ブラウザ 3.19 +@cindex インクルード構造[いんくるうとこうそう] 3.20 +@cindex prefix d 3.21 + 3.22 +複数のファイルに分割しているドキュメントを書いている場合、 3.23 + 3.24 +@table @kbd 3.25 +@item [prefix] d 3.26 + @dots{} インクルード構造ブラウズ 3.27 +@end table 3.28 + 3.29 +@noindent 3.30 +を押すと、そのドキュメントの親ファイルを聞いて来ます。ここで全てのファイル 3.31 +の親となるファイル(デフォルトが示されているので大抵はRETのみ)を入力すると 3.32 +インクルードしている全てのファイルを解析し、インクルード状況を視覚的に表示 3.33 +します。このバッファでは以下のキー操作が有効です。 3.34 + 3.35 +@table @kbd 3.36 +@item n 3.37 + @dots{} 次の行に移動し対応するファイルを隣のバッファに表示 3.38 +@item p 3.39 + @dots{} 上の行に移動し対応するファイルを隣のバッファに表示 3.40 +@item N 3.41 + @dots{} 同じインクルードレベルの次のファイルに移動 3.42 +@item P 3.43 + @dots{} 同じインクルードレベルの前のファイルに移動 3.44 +@item j 3.45 + @dots{} 次の行に移動 3.46 +@item k 3.47 + @dots{} 上の行に移動 3.48 +@item u 3.49 + @dots{} 一代親にあたるファイルに移動 3.50 +@item . 3.51 + @dots{} カーソル位置のファイルを隣のバッファに表示 3.52 +@item SPC 3.53 + @dots{} 隣のバッファの対応ファイルをスクロールアップ 3.54 +@item DEL, b 3.55 + @dots{} 隣のバッファの対応ファイルをスクロールダウン 3.56 +@item < 3.57 + @dots{} 隣のバッファの対応ファイルの先頭を表示 3.58 +@item > 3.59 + @dots{} 隣のバッファの対応ファイルの末尾を表示 3.60 +@item ' 3.61 + @dots{} (@kbd{<}や@kbd{>}の後で)元の表示位置に戻る 3.62 +@item RET, g 3.63 + @dots{} カーソル位置のファイルを隣のバッファでオープン 3.64 +@item mouse-2 3.65 + @dots{} RETと同じ(ウィンドウ使用時のみ) 3.66 +@item o 3.67 + @dots{} 隣のウィンドウに移動 3.68 +@item 1 3.69 + @dots{} 他のウィンドウを消す 3.70 +@item - 3.71 + @dots{} ブラウズウィンドウを小さくする 3.72 +@item + 3.73 + @dots{} ブラウズウィンドウを大きくする 3.74 +@item ? 3.75 + @dots{} ヘルプ表示 3.76 +@item q 3.77 + @dots{} 表示前の状態に戻る 3.78 +@end table 3.79 + 3.80 + ただし、隣のウィンドウのファイルの内容を表示する機能に関しては、対応する 3.81 +ファイルをクローズしてしまうとうまく働きませんのでご注意ください。 3.82 + 3.83 @node Cooperation with other packages, Customizations, Online help, Top 3.84 @comment node-name, next, previous, up 3.85 @chapter 他パッケージとの連携 3.86 @@ -1785,6 +1854,17 @@ 3.87 によっては hilit19 のドキュメント)を参照せよ。 3.88 @end defvar 3.89 3.90 +@defvar YaTeX-sectioning-level 3.91 +LaTeXのセクション単位宣言コマンドとその論理的高さのalist。 3.92 +@end defvar 3.93 + 3.94 +@defvar YaTeX-hierarchy-ignore-heading-regexp 3.95 +Hierarchy バッファは通常ファイルヘッダとして、LaTeXのセクション宣言コマン 3.96 +ドの引数を検索し、それがなければコメント行を探すが、その際にヘッダとしては 3.97 +意味を持たないパターンをこの変数に設定する。デフォルトでは RCS ヘッダとモー 3.98 +ド指定行(-*- xxx -*-)が設定されている。 3.99 +@end defvar 3.100 + 3.101 @node Sample definitions, Hook variables, All customizable variables, Lisp variables 3.102 @comment node-name, next, previous, up 3.103 @subsection カスタマイズ変数設定例
4.1 --- a/help/YATEXHLP.jp Sun Jan 22 14:20:46 1995 +0000 4.2 +++ b/help/YATEXHLP.jp Thu Feb 02 17:18:29 1995 +0000 4.3 @@ -1306,12 +1306,18 @@ 4.4 藤枝和宏さん(JAIST) 4.5 野鳥/雷鳥の Mailing List を設立して頂きました。 4.6 4.7 -松本憲彦さん(東京学芸大学) 4.8 +松本憲彦さん(東京学芸大) 4.9 マニュアルのバグを指摘して頂きました。 4.10 4.11 -小宮山康子さん(成蹊大学) 4.12 +小宮山康子さん(成蹊大) 4.13 \item[] などの補完後 [] の中にカーソルを置く要望を頂きました。 4.14 4.15 +竹中浩さん(東京大) 4.16 + M-q (YaTeX-fill-paragraph) のバグを報告して頂きました。 4.17 + 4.18 +佐藤圭さん(慶應大) 4.19 + ネストした同種のitemize環境でのindentationの不具合を指摘して頂き 4.20 + ました。 4.21 yatex 4.22 (setq auto-mode-alist (cons '("\\.tex$" . yatex-mode) auto-mode-alist)) 4.23 <refer YaTeX>
5.1 Binary file yatex.el has changed
6.1 --- a/yatex.new Sun Jan 22 14:20:46 1995 +0000 6.2 +++ b/yatex.new Thu Feb 02 17:18:29 1995 +0000 6.3 @@ -1,12 +1,27 @@ 6.4 What's new in YaTeX 6.5 yatex.el 各バージョンの変更点について 6.6 6.7 +1.57 同じ環境がネストしている時の M-C-a, M-C-e のバグ修正。 6.8 + \beginの行をTABでreindentした時は\endも同じ桁に揃える。 6.9 + リジョンを環境で括った時の中身の処理を行う関数 6.10 + YaTeX-enclose-<環境名> をサポート。equation で括った時に中身の $ 6.11 + を全て消去し、verbatimで括った時はなにもしないようにした。 6.12 + \item 行でTABした時にカーソル位置を保存。 6.13 + \item を補完した次の section 型コマンドのデフォルトを label に。 6.14 + hierarchyバッファでの SPC, DEL, +, - の追加。 6.15 + fill すると kill-ring を壊してしまうのを修正。 6.16 + 数式環境でのインデントのサポート(やだなあ)。 6.17 + 中括弧がネストしたり、引数が複数ある section 型コマンドも正しく 6.18 + hilit するようにし、% の hilit も適正化した。 6.19 + インデントが変わらない時のTABでも修正フラグが立っていたのを修正。 6.20 + 6.21 1.56 [prefix] d の YaTeX-display-hierarchy を追加。 6.22 変数 indent-line-function に YaTeX-indent-line を設定した。 6.23 YaTeX-generate-simple の修正(1.51から今まで全然動かなかったのに…)。 6.24 NTT-jTeX を利用する時に文書をインデントしても良いように 6.25 auto-fill や fill-paragraph を調整した。 6.26 maketitle 型コマンドが [] で終わっている時にはカーソルを括弧内に。 6.27 + セクションコマンドの論理的高さに応じて色の濃度を変える(Mule2+X)。 6.28 6.29 1.55 {}の上で [prefix] k した時に直前のコマンドが maketitle 型辞書に 6.30 属していれば {} のみ(フォント指定子があればそれも)を消すようにした。
7.1 --- a/yatex19.el Sun Jan 22 14:20:46 1995 +0000 7.2 +++ b/yatex19.el Thu Feb 02 17:18:29 1995 +0000 7.3 @@ -1,13 +1,14 @@ 7.4 ;;; -*- Emacs-Lisp -*- 7.5 ;;; YaTeX facilities for Emacs 19 7.6 ;;; (c )1994-1995 by HIROSE Yuuji.[yuuji@ae.keio.ac.jp] 7.7 -;;; Last modified Sun Jan 22 23:15:56 1995 on landcruiser 7.8 +;;; Last modified Thu Feb 2 23:44:30 1995 on figaro 7.9 ;;; $Id$ 7.10 7.11 ;;; とりあえず hilit19 を使っている時に色が付くようにして 7.12 ;;; メニューバーでごにょごにょできるようにしただけ。 7.13 ;;; いったい誰がメニューバー使ってLaTeXソース書くんだろうか? 7.14 ;;; まあいいや練習練習。後ろの方にちょっとコメントあり。 7.15 +;;; 真中辺にあるけど、hilit19.el 対応の方は結構本気。 7.16 7.17 (require 'yatex) 7.18 7.19 @@ -207,28 +208,116 @@ 7.20 (sort (append env-table user-env-table) 7.21 '(lambda (x y) (string< (car x) (car y)))))) 7.22 7.23 +;; Other key bindings for window-system 7.24 +;(YaTeX-define-key [?\C- ] 'YaTeX-do-completion) 7.25 +(define-key YaTeX-mode-map [?\M-\C- ] 'YaTeX-mark-environment) 7.26 + 7.27 ;; Highlightening 7.28 -;; ローカルなマクロを読み込んだ後 redraw すると 7.29 -;; ローカルマクロを keyword として光らせる(keywordじゃまずいかな…)。 7.30 -(defvar YaTeX-hilit-patterns-alist nil 7.31 - "*Hiliting pattern alist for LaTeX text. 7.32 -Default value is equal to latex-mode's one.") 7.33 -(defvar YaTeX-hilit-pattern-adjustment-default 7.34 - (list 7.35 - ;;\def が define なんだから new* も define でしょう。 7.36 - '("\\\\\\(re\\)?new\\(environment\\|command\\){" "}" define) 7.37 - '("\\\\new\\(length\\|theorem\\|counter\\){" "}" define) 7.38 - ;;セクションコマンドが単なるキーワードってことはないでしょう。 7.39 - ;;(list 7.40 - ;;(concat "\\\\\\(" YaTeX-sectioning-regexp "\\){") "}" 7.41 - ;;'sectioning) 7.42 - ;;eqnarray などの数式環境が入ってないみたい… 7.43 - '("\\\\begin{\\(eqnarray\\*?\\|equation\\*?\\)}" 7.44 - "\\\\end{\\(eqnarray\\*?\\|equation\\*?\\)}" 7.45 - formula)) 7.46 - "Adjustment for hilit19's LaTeX hilit pattern.") 7.47 +;; メニューに比べてこっちは結構本気でやってます。 7.48 +;; だって文書構造がとっても分かり易いんだもん。 7.49 +;; みんなも hilit19.el を使おう! 7.50 +;; 7.51 +;; さて、まずは対応する {} をピカピカ範囲とするような関数を作る。 7.52 +;; これは hilit-LaTeX.el を参考にした。でも、ちゃんと section 型コマンドの 7.53 +;; 引数を数えて正しい位置までピカピカさせるよ〜ん! 7.54 + 7.55 +(defun YaTeX-19-region-section-type (pattern) 7.56 + "Return list of starting and end point of section-type commands of PATTERN." 7.57 + (if (re-search-forward pattern nil t) 7.58 + (let ((m0 (match-beginning 0)) cmd (argc 1)) 7.59 + (setq cmd (substring (YaTeX-match-string 0) 1 -1) 7.60 + argc (or (car (cdr (YaTeX-lookup-table cmd 'section))) argc)) 7.61 + (cons m0 7.62 + (progn (skip-chars-backward "^{") (forward-char -2) 7.63 + (while (> argc 0) 7.64 + (skip-chars-forward "^{") 7.65 + (forward-list 1) 7.66 + (setq argc (1- argc))) 7.67 + (point)))))) 7.68 + 7.69 +(defun YaTeX-19-region-large-type (pattern) 7.70 + "Return list of large-type contents. 7.71 +Assumes PATTERN begins with `{'." 7.72 + (if (re-search-forward pattern nil t) 7.73 + (let ((m0 (match-beginning 0))) 7.74 + (goto-char m0) 7.75 + (skip-chars-forward "^ \t\n") 7.76 + (skip-chars-forward " \t\n") 7.77 + (cons (point) 7.78 + (progn (goto-char m0) (forward-list 1) 7.79 + (1- (point))))))) 7.80 + 7.81 +;; 些細なことだが % の前の文字もピカリとさせてしまうようで… >hilit19 7.82 +;; ↓この関数は下の hilit-set-mode-patterns の "[^\\]\\(%\\).*$" に 7.83 +;; 依存している 7.84 +(defun YaTeX-19-region-comment (pattern) 7.85 + "Return list of comment start and end point." 7.86 + (if (re-search-forward pattern nil t) 7.87 + (cons (match-beginning 1) (match-end 0)))) 7.88 + 7.89 +(defvar YaTeX-hilit-patterns-alist 7.90 + '( 7.91 + ;; comments 7.92 + (YaTeX-19-region-comment "[^\\]\\(%\\).*$" comment) 7.93 + 7.94 + (YaTeX-19-region-section-type "\\\\footnote\\(mark\\|text\\)?{" keyword) 7.95 + ("\\\\[a-z]+box" 0 keyword) 7.96 + (YaTeX-19-region-section-type "\\\\\\(v\\|h\\)space\\(\*\\)?{" keyword) 7.97 + 7.98 + ;; (re-)define new commands/environments/counters 7.99 + (YaTeX-19-region-section-type 7.100 + "\\\\\\(re\\)?new\\(environment\\|command\\|theorem\\){" defun) 7.101 + (YaTeX-19-region-section-type 7.102 + "\\\\\\(re\\)?new\\(length\\|counter\\){" define) 7.103 + 7.104 + ;; various declarations/definitions 7.105 + (YaTeX-19-region-section-type 7.106 + "\\\\\\(set\\|setto\\|addto\\)\\(length\\|width\\|counter\\){" 7.107 + define) 7.108 + (YaTeX-19-region-section-type 7.109 + "\\\\\\(title\\|author\\|date\\|thanks\\){" define) 7.110 + 7.111 + ("\\\\documentstyle\\(\\[.*\\]\\)?{" "}" decl) 7.112 + ("\\\\\\(begin\\|end\\|nofiles\\|includeonly\\){" "}" decl) 7.113 + ("\\\\\\(raggedright\\|makeindex\\|makeglossary\\|maketitle\\)\\b" 0 decl) 7.114 + ("\\\\\\(pagestyle\\|thispagestyle\\|pagenumbering\\){" "}" decl) 7.115 + ("\\\\\\(normalsize\\|small\\|footnotesize\\|scriptsize\\|tiny\\|large\\|Large\\|LARGE\\|huge\\|Huge\\)\\b" 0 decl) 7.116 + ("\\\\\\(appendix\\|tableofcontents\\|listoffigures\\|listoftables\\)\\b" 7.117 + 0 decl) 7.118 + ("\\\\\\(bf\\|em\\|it\\|rm\\|sf\\|sl\\|ss\\|tt\\)\\b" 0 decl) 7.119 + 7.120 + ;; label-like things 7.121 + ;;this should be customized by YaTeX-item-regexp 7.122 + ("\\\\\\(sub\\)*item\\b\\(\\[[^]]*\\]\\)?" 0 label) 7.123 + (YaTeX-19-region-section-type 7.124 + "\\\\caption\\(\\[[^]]*\\]\\)?{" label) 7.125 + 7.126 + ;; formulas 7.127 + ("[^\\]\\\\(" "\\\\)" formula) ; \( \) 7.128 + ("[^\\]\\\\\\[" "\\\\\\]" formula) ; \[ \] 7.129 + ("\\\\begin{\\(eqn\\|equation\\)" "\\\\end{\\(eqn\\|equation\\)" formula) 7.130 + ("[^\\$]\\($\\($[^$]*\\$\\|[^$]*\\)\\$\\)" 1 formula) ; '$...$' or '$$...$$' 7.131 + 7.132 + ;; things that bring in external files 7.133 + ("\\\\\\(include\\|input\\|bibliography\\){" "}" include) 7.134 + 7.135 + ;; "wysiwyg" emphasis -- these don't work with nested expressions 7.136 + ;; ("{\\\\\\(em\\|it\\|sl\\)" "}" italic) 7.137 + (YaTeX-19-region-large-type "{\\\\bf" bold) 7.138 + 7.139 + ("``" "''" string) 7.140 + 7.141 + ;; things that do some sort of cross-reference 7.142 + (YaTeX-19-region-section-type 7.143 + "\\\\\\(\\(no\\)?cite\\|\\(page\\)?ref\\|label\\|index\\|glossary\\){" 7.144 + crossref) 7.145 + ) 7.146 + "*Hiliting pattern alist for LaTeX text.") 7.147 + 7.148 +;;(defvar YaTeX-hilit-pattern-adjustment-default nil) 7.149 +;; ↑いらなくなった。 7.150 (defvar YaTeX-hilit-pattern-adjustment-private nil 7.151 - "*Private variable, same purpose as YaTeX-hilit-pattern-adjustment-default.") 7.152 + "*Adjustment hilit-pattern-alist for default yatex-mode's pattern.") 7.153 (defvar YaTeX-hilit-sectioning-face 7.154 '(yellow/dodgerblue yellow/cornflowerblue) 7.155 "*Hilightening face for sectioning unit. '(FaceForLight FaceForDark)") 7.156 @@ -240,54 +329,55 @@ 7.157 7.158 ;;; セクションコマンドを、構造レベルの高さに応じて色の濃度を変える 7.159 ;;; 背景が黒でないと何が嬉しいのか分からないに違いない. 7.160 -(let*((sectface 7.161 - (car (if (eq hilit-background-mode 'dark) 7.162 - (cdr YaTeX-hilit-sectioning-face) 7.163 - YaTeX-hilit-sectioning-face))) 7.164 - (sectcol (symbol-name sectface)) 7.165 - sect-pat-alist) 7.166 - (if (string-match "/" sectcol) 7.167 - (let (colorvalue fR fG fB bR bG bB list pat fg bg level from face) 7.168 - (require 'yatexsec) 7.169 - (setq fg (substring sectcol 0 (string-match "/" sectcol)) 7.170 - bg (substring sectcol (1+ (string-match "/" sectcol))) 7.171 - colorvalue (x-color-values fg) 7.172 - fR (/ (nth 0 colorvalue) 256) 7.173 - fG (/ (nth 1 colorvalue) 256) 7.174 - fB (/ (nth 2 colorvalue) 256) 7.175 - colorvalue (x-color-values bg) 7.176 - bR (/ (nth 0 colorvalue) 256) 7.177 - bG (/ (nth 1 colorvalue) 256) 7.178 - bB (/ (nth 2 colorvalue) 256) 7.179 - list YaTeX-sectioning-level) 7.180 - (while list 7.181 - (setq pat (concat YaTeX-ec-regexp (car (car list)) "\\*?{") 7.182 - level (cdr (car list)) 7.183 - fg (format "hex-%02x%02x%02x" 7.184 - (- fR (/ (* level fR) 40)) ;40 musn't be constant 7.185 - (- fG (/ (* level fG) 40)) 7.186 - (- fB (/ (* level fB) 40))) 7.187 - bg (format "hex-%02x%02x%02x" 7.188 - (- bR (/ (* level bR) 15)) ;20 musn't be constant 7.189 - (- bG (/ (* level bG) 15)) 7.190 - (- bB (/ (* level bB) 15))) 7.191 - from (intern (format "sectioning-%d" level)) 7.192 - face (intern (concat fg "/" bg))) 7.193 - (hilit-translate from face) 7.194 - (setq sect-pat-alist 7.195 - (cons (list pat "}" face) 7.196 - sect-pat-alist)) 7.197 - (setq list (cdr list))) 7.198 - (setq YaTeX-sectioning-patterns-alist sect-pat-alist)))) 7.199 +;;; もしかして白地の時は構造レベルに応じて色を明るくしたほうが良いのか? 7.200 +(cond 7.201 + ((and (featurep 'hilit19) (fboundp 'x-color-values)) 7.202 + (let*((sectface 7.203 + (car (if (eq hilit-background-mode 'dark) 7.204 + (cdr YaTeX-hilit-sectioning-face) 7.205 + YaTeX-hilit-sectioning-face))) 7.206 + (sectcol (symbol-name sectface)) 7.207 + sect-pat-alist) 7.208 + (if (string-match "/" sectcol) 7.209 + (let (colorvalue fR fG fB bR bG bB list pat fg bg level from face) 7.210 + (require 'yatexsec) 7.211 + (setq fg (substring sectcol 0 (string-match "/" sectcol)) 7.212 + bg (substring sectcol (1+ (string-match "/" sectcol))) 7.213 + colorvalue (x-color-values fg) 7.214 + fR (/ (nth 0 colorvalue) 256) 7.215 + fG (/ (nth 1 colorvalue) 256) 7.216 + fB (/ (nth 2 colorvalue) 256) 7.217 + colorvalue (x-color-values bg) 7.218 + bR (/ (nth 0 colorvalue) 256) 7.219 + bG (/ (nth 1 colorvalue) 256) 7.220 + bB (/ (nth 2 colorvalue) 256) 7.221 + list YaTeX-sectioning-level) 7.222 + (while list 7.223 + (setq pat (concat YaTeX-ec-regexp (car (car list)) "\\*?{") 7.224 + level (cdr (car list)) 7.225 + fg (format "hex-%02x%02x%02x" 7.226 + (- fR (/ (* level fR) 40)) ;40 musn't be constant 7.227 + (- fG (/ (* level fG) 40)) 7.228 + (- fB (/ (* level fB) 40))) 7.229 + bg (format "hex-%02x%02x%02x" 7.230 + (- bR (/ (* level bR) 15)) ;20 musn't be constant 7.231 + (- bG (/ (* level bG) 15)) 7.232 + (- bB (/ (* level bB) 15))) 7.233 + from (intern (format "sectioning-%d" level)) 7.234 + face (intern (concat fg "/" bg))) 7.235 + (hilit-translate from face) 7.236 + (setq sect-pat-alist 7.237 + (cons;;(list pat "}" face) 7.238 + (list 'YaTeX-19-region-section-type pat face) 7.239 + sect-pat-alist)) 7.240 + (setq list (cdr list))) 7.241 + (setq YaTeX-sectioning-patterns-alist sect-pat-alist)))))) 7.242 7.243 -(defun YaTeX-19-collect-macro () 7.244 +;; ローカルなマクロを読み込んだ後 redraw すると 7.245 +;; ローカルマクロを keyword として光らせる(keywordじゃまずいかな…)。 7.246 +(defun YaTeX-19-collect-macros () 7.247 (cond 7.248 ((and (featurep 'hilit19) (fboundp 'hilit-translate)) 7.249 - (or YaTeX-hilit-patterns-alist 7.250 - (let ((alist (cdr (assq 'latex-mode hilit-patterns-alist)))) 7.251 - (setcar (assoc "\\\\item\\(\\[[^]]*\\]\\)?" alist) 7.252 - (concat YaTeX-item-regexp "\\b\\(\\[[^]]*\\]\\)?")) 7.253 - (setq YaTeX-hilit-patterns-alist alist))) 7.254 (let ((get-face 7.255 (function 7.256 (lambda (table) 7.257 @@ -306,17 +396,18 @@ 7.258 (append 7.259 YaTeX-sectioning-patterns-alist 7.260 YaTeX-hilit-pattern-adjustment-private 7.261 - YaTeX-hilit-pattern-adjustment-default 7.262 + ;;YaTeX-hilit-pattern-adjustment-default 7.263 YaTeX-hilit-patterns-alist 7.264 (list 7.265 (list 7.266 + 'YaTeX-19-region-section-type 7.267 (concat "\\\\\\(" 7.268 (mapconcat 7.269 (function (lambda (s) (regexp-quote (car s)))) 7.270 (append user-section-table tmp-section-table) 7.271 "\\|") 7.272 "\\){") 7.273 - "}" 'keyword) 7.274 + 'keyword) 7.275 (list 7.276 (concat "\\\\\\(" 7.277 (mapconcat 7.278 @@ -326,17 +417,64 @@ 7.279 "\\)\\b") 7.280 0 'macro)))) 7.281 hilit-patterns-alist))))) 7.282 -(YaTeX-19-collect-macro) 7.283 +;;(YaTeX-19-collect-macros) ;causes an error 7.284 (defun YaTeX-hilit-recenter (arg) 7.285 "Collect current local macro and hilit-recenter." 7.286 (interactive "P") 7.287 - (YaTeX-19-collect-macro) 7.288 + (YaTeX-19-collect-macros) 7.289 (hilit-recenter arg)) 7.290 (if (fboundp 'hilit-recenter) ;Replace hilit-recenter with 7.291 (mapcar (function (lambda (key) ;YaTeX-hilit-recenter in yatex-mode 7.292 (define-key YaTeX-mode-map key 'YaTeX-hilit-recenter))) 7.293 (where-is-internal 'hilit-recenter))) 7.294 7.295 +(defun YaTeX-switch-to-new-window () 7.296 + (let ((c 0) (i 1) (free (make-string win:max-configs ? ))) 7.297 + (while (< i win:max-configs) 7.298 + (or (aref win:configs i) (aset free i (+ i win:base-key))) 7.299 + (setq i (1+ i))) 7.300 + (while (not (string-match (char-to-string c) free)) 7.301 + (message "Which window to create? [%s]: " free) 7.302 + (setq c (read-char))) 7.303 + (message "Creating window [%c]" c) 7.304 + (set-buffer (get-buffer-create "*scratch*")) 7.305 + (win:switch-window (- c win:base-key)))) 7.306 + 7.307 +(defun YaTeX-visit-main-other-frame () 7.308 + "Visit main file in other frame. 7.309 +WARNING, This code is not perfect." 7.310 + (interactive) 7.311 + (if (YaTeX-main-file-p) (message "I think this is main LaTeX source.") 7.312 + (let (parent) 7.313 + (save-excursion (YaTeX-visit-main t) (setq parent (current-buffer))) 7.314 + (cond 7.315 + ((get-buffer-window parent t) 7.316 + (goto-buffer-window parent)) 7.317 + ((and (featurep 'windows) win:use-frame) 7.318 + (YaTeX-switch-to-new-window) 7.319 + (switch-to-buffer parent)) 7.320 + (t (switch-to-buffer-other-frame (buffer-name parent))))))) 7.321 + 7.322 +(defun YaTeX-goto-corresponding-*-other-frame (arg) 7.323 + "Go to corresponding object in other frame." 7.324 + (interactive "P") 7.325 + (let (b p) 7.326 + (save-window-excursion 7.327 + (save-excursion 7.328 + (YaTeX-goto-corresponding-* arg) 7.329 + (setq b (current-buffer) p (point)))) 7.330 + (cond 7.331 + ((get-buffer-window b t) 7.332 + (goto-buffer-window b) 7.333 + (goto-char p)) 7.334 + ((and (featurep 'windows) win:use-frame) 7.335 + (YaTeX-switch-to-new-window) 7.336 + (switch-to-buffer b) 7.337 + (goto-char p)) 7.338 + (t (switch-to-buffer-other-frame (buffer-name b)) 7.339 + (goto-char p)))) 7.340 +) 7.341 + 7.342 ;;; reverseVideo にして hilit-background-mode を 'dark 7.343 ;;; にしている人は数式などが暗くなりすぎて見づらいかもしれない。 7.344 ;;; 次のコードを hilit19 をロードしている場所の直後に置くとちょっ
8.1 --- a/yatexadd.el Sun Jan 22 14:20:46 1995 +0000 8.2 +++ b/yatexadd.el Thu Feb 02 17:18:29 1995 +0000 8.3 @@ -1,8 +1,8 @@ 8.4 ;;; -*- Emacs-Lisp -*- 8.5 ;;; YaTeX add-in functions. 8.6 -;;; yatexadd.el rev.12 8.7 +;;; yatexadd.el rev.13 8.8 ;;; (c )1991-1995 by HIROSE Yuuji.[yuuji@ae.keio.ac.jp] 8.9 -;;; Last modified Sun Jan 22 23:15:48 1995 on landcruiser 8.10 +;;; Last modified Thu Jan 26 03:31:20 1995 on figaro 8.11 ;;; $Id$ 8.12 8.13 ;;; 8.14 @@ -286,7 +286,10 @@ 8.15 (concat "[" label "]"))) 8.16 ) 8.17 8.18 -(defun YaTeX:item () " ") 8.19 +(defun YaTeX:item () 8.20 + (YaTeX-indent-line) 8.21 + (setq section-name "label") 8.22 + " ") 8.23 (fset 'YaTeX:item\[\] 'YaTeX:item) 8.24 (fset 'YaTeX:subitem 'YaTeX:item) 8.25 (fset 'YaTeX:subsubitem 'YaTeX:item)
9.1 --- a/yatexenv.el Sun Jan 22 14:20:46 1995 +0000 9.2 +++ b/yatexenv.el Thu Feb 02 17:18:29 1995 +0000 9.3 @@ -2,7 +2,7 @@ 9.4 ;;; YaTeX environment-specific functions. 9.5 ;;; yatexenv.el 9.6 ;;; (c ) 1994 by HIROSE Yuuji.[yuuji@ae.keio.ac.jp] 9.7 -;;; Last modified Thu Nov 24 04:33:18 1994 on 98fa 9.8 +;;; Last modified Thu Feb 2 16:11:12 1995 on pajero 9.9 ;;; $Id$ 9.10 9.11 ;;; 9.12 @@ -165,30 +165,19 @@ 9.13 ;; Functions for itemize/enumerate/list environments 9.14 ;;; 9.15 9.16 -(defun YaTeX-indent-for-item () 9.17 - (let (col (p (point)) begenv) 9.18 - (save-excursion 9.19 - (YaTeX-beginning-of-environment t) 9.20 - (setq begenv (point-end-of-line)) 9.21 - (goto-char p) 9.22 - (if (YaTeX-search-active-backward "\\item" YaTeX-comment-prefix begenv t) 9.23 - (setq col (current-column)))) 9.24 - (if col (indent-to col) (YaTeX-indent-line))) 9.25 -) 9.26 - 9.27 (defvar YaTeX-item-for-insert "\\item ") 9.28 (defun YaTeX-intelligent-newline-itemize () 9.29 "Insert '\\item '." 9.30 - (YaTeX-indent-for-item) 9.31 (insert YaTeX-item-for-insert) 9.32 + (YaTeX-indent-line) 9.33 ) 9.34 (fset 'YaTeX-intelligent-newline-enumerate 'YaTeX-intelligent-newline-itemize) 9.35 (fset 'YaTeX-intelligent-newline-list 'YaTeX-intelligent-newline-itemize) 9.36 9.37 (defun YaTeX-intelligent-newline-description () 9.38 - (YaTeX-indent-for-item) 9.39 (insert "\\item[] ") 9.40 (forward-char -2) 9.41 + (YaTeX-indent-line) 9.42 ) 9.43 9.44 9.45 @@ -211,3 +200,103 @@ 9.46 (if (and env func (fboundp func)) 9.47 (funcall func))) 9.48 ) 9.49 + 9.50 +;;; 9.51 +;; Environment-specific line indenting functions 9.52 +;;; 9.53 +;;;###autoload 9.54 +(defun YaTeX-indent-line-equation () 9.55 + "Indent a line in equation family." 9.56 + (let ((p (point)) (l-r 0) right-p peol depth (mp YaTeX-environment-indent)) 9.57 + (if (save-excursion 9.58 + (beginning-of-line) 9.59 + (skip-chars-forward " \t") 9.60 + (looking-at "\\\\right\\b")) 9.61 + (progn (YaTeX-reindent 9.62 + (save-excursion (YaTeX-goto-corresponding-leftright) 9.63 + (current-column)))) 9.64 + (save-excursion 9.65 + (forward-line -1) 9.66 + (while (and (not (bobp)) (YaTeX-on-comment-p)) 9.67 + (forward-line -1)) 9.68 + ;;(beginning-of-line) ;must be unnecessary 9.69 + (skip-chars-forward " \t") 9.70 + (if (eolp) (error "Math-environment can't have a null line!!")) 9.71 + (setq depth (current-column) 9.72 + peol (point-end-of-line)) 9.73 + (while (re-search-forward 9.74 + "\\\\\\(\\(left\\)\\|\\(right\\)\\)\\b" peol t) 9.75 + (setq l-r (+ l-r (if (match-beginning 2) 1 -1)))) 9.76 + (cond 9.77 + ((progn (beginning-of-line) 9.78 + (re-search-forward "\\\\\\\\\\s *$" (point-end-of-line) t)) 9.79 + ;;If previous line has `\\', this indentation is always normal. 9.80 + (setq depth (+ (YaTeX-current-indentation) mp))) 9.81 + ((> l-r 0) 9.82 + (beginning-of-line) 9.83 + (search-forward "\\left" peol) 9.84 + (goto-char (1+ (match-beginning 0))) 9.85 + (setq depth (current-column))) 9.86 + ((< l-r 0) 9.87 + (goto-char (match-beginning 0)) ;should be \right 9.88 + (YaTeX-goto-corresponding-leftright) 9.89 + (beginning-of-line) 9.90 + (skip-chars-forward " \t") 9.91 + (setq depth (+ (current-column) mp))) ;+mp is good? 9.92 + (t ;if \left - \right = 0 9.93 + (cond 9.94 + ((re-search-forward "\\\\\\\\\\s *$" peol t) 9.95 + (setq depth (+ (YaTeX-current-indentation) mp))) 9.96 + ((re-search-forward "\\\\end{" peol t) 9.97 + nil) ;same indentation as previous line's 9.98 + ((re-search-forward "\\\\begin{" peol t) 9.99 + (setq depth (+ depth mp))) 9.100 + (t 9.101 + (or (bobp) (forward-line -1)) 9.102 + (cond 9.103 + ((re-search-forward 9.104 + "\\\\\\\\\\s *$\\|\\\\begin{" (point-end-of-line) t) 9.105 + (setq depth (+ depth mp))) 9.106 + ))))) 9.107 + (goto-char p)) 9.108 + (YaTeX-reindent depth)))) 9.109 + 9.110 +;;;###autoload 9.111 +(defun YaTeX-goto-corresponding-leftright () 9.112 + "Go to corresponding \left or \right. 9.113 +Note that this function assumes the corresponding \left\right 9.114 +is on another line." 9.115 + (let ((YaTeX-struct-begin "\\left%1") 9.116 + (YaTeX-struct-end "\\right%1") 9.117 + (YaTeX-struct-name-regexp "[][(){}.|]")) 9.118 + (YaTeX-goto-corresponding-environment t))) 9.119 + 9.120 +;;; 9.121 +;; Functions for formatting region being enclosed with environment 9.122 +;;; 9.123 +; These functions must take two argument; region-beginning, region-end. 9.124 + 9.125 +(defun YaTeX-enclose-equation (beg end) 9.126 + (goto-char beg) 9.127 + (save-restriction 9.128 + (let (m0 bsl) 9.129 + (narrow-to-region beg end) 9.130 + (while (YaTeX-re-search-active-forward 9.131 + "\\(\\$\\)" YaTeX-comment-prefix nil t) 9.132 + (goto-char (setq m0 (match-beginning 0))) 9.133 + (setq bsl 0) 9.134 + (if (and (not (bobp)) (= (char-after (1- (point))) ?\\ )) 9.135 + (while (progn (forward-char -1) (= (char-after (point)) ?\\ )) 9.136 + (setq bsl (1+ bsl)))) 9.137 + (goto-char m0) 9.138 + (if (= 0 (% bsl 2)) 9.139 + (delete-char 1) 9.140 + (forward-char 1)))))) 9.141 + 9.142 +(fset 'YaTeX-enclose-eqnarray 'YaTeX-enclose-equation) 9.143 +(fset 'YaTeX-enclose-eqnarray* 'YaTeX-enclose-equation) 9.144 + 9.145 +(defun YaTeX-enclose-verbatim (beg end)) ;do nothing when enclose verbatim 9.146 +(fset 'YaTeX-enclose-verbatim* 'YaTeX-enclose-verbatim) 9.147 + 9.148 +(provide 'yatexenv)
10.1 --- a/yatexhie.el Sun Jan 22 14:20:46 1995 +0000 10.2 +++ b/yatexhie.el Thu Feb 02 17:18:29 1995 +0000 10.3 @@ -2,21 +2,22 @@ 10.4 ;;; YaTeX hierarchy browser. 10.5 ;;; yatexhie.el 10.6 ;;; (c )1995 by HIROSE Yuuji [yuuji@ae.keio.ac.jp] 10.7 -;;; Last modified Sun Jan 22 23:15:25 1995 on landcruiser 10.8 +;;; Last modified Thu Feb 2 23:55:59 1995 on figaro 10.9 ;;; $Id$ 10.10 10.11 ;; ----- Customizable variables ----- 10.12 -(defvar YaTeX-hierarchy-inspect-mode t 10.13 - "*Non-nil inspects the contents of file of cursor position.") 10.14 - 10.15 +(defvar YaTeX-hierarchy-ignore-heading-regexp 10.16 + "\\$[A-Z][a-z]+: .* \\$\\|-\\*- .* -\\*-" 10.17 + "*Regexp of lines to ignore as files' headline.") 10.18 10.19 ;; ----- General variables ----- 10.20 (defvar YaTeX-default-TeX-extensions "\\.\\(tex\\|sty\\)") 10.21 (defvar YaTeX-hierarchy-current-main nil) 10.22 (defvar YaTeX-hierarchy-buffer-message 10.23 (concat 10.24 - "n)ext p)rev N)extsamelev P)revsamelev u)p K)ill-buffer RET)select" 10.25 - (if (and YaTeX-emacs-19 window-system) " Mouse2)select" ""))) 10.26 + "n)ext p)rev N)extsame P)revsame u)p K)illbuf RET)select" 10.27 + (if (and YaTeX-emacs-19 window-system) " Mouse2)select" "") 10.28 + " ?)help")) 10.29 (defvar YaTeX-hierarchy-saved-wc nil "Saved window configuration.") 10.30 10.31 ;; ----- Functions for parsing hierarchy ----- 10.32 @@ -81,23 +82,30 @@ 10.33 (save-excursion 10.34 (set-buffer (find-file-noselect file)) 10.35 (save-excursion 10.36 - (goto-char (point-min)) 10.37 - (cond 10.38 - ((and 10.39 - (YaTeX-re-search-active-forward 10.40 - (concat YaTeX-ec-regexp YaTeX-sectioning-regexp) 10.41 - YaTeX-comment-prefix nil t) 10.42 - (re-search-forward "{\\([^}]+\\)}" nil t)) 10.43 - (goto-char (match-beginning 1)) 10.44 - (skip-chars-forward " \t\n") 10.45 - (buffer-substring (point) 10.46 - (min (point-end-of-line) 10.47 - (match-end 1)))) 10.48 - ((re-search-forward "^ *%\\([^#]\\)" nil t) 10.49 - (goto-char (match-beginning 1)) 10.50 - (skip-chars-forward " \t") 10.51 - (buffer-substring (point) (point-end-of-line))) 10.52 - (t ""))))) 10.53 + (let (p) 10.54 + (goto-char (point-min)) 10.55 + (cond 10.56 + ((re-search-forward 10.57 + (concat YaTeX-ec-regexp YaTeX-sectioning-regexp) nil t) 10.58 + (search-forward "{") 10.59 + (forward-char -1) 10.60 + (setq p (condition-case nil 10.61 + (progn (forward-list 1) (1- (point))) 10.62 + (error (point-end-of-line)))) 10.63 + (goto-char (1+ (match-beginning 0))) 10.64 + (skip-chars-forward " \t\n") 10.65 + (buffer-substring (point) (min (point-end-of-line) p))) 10.66 + ((catch 'found 10.67 + (while (re-search-forward "^ *%\\([^#]\\)" nil t) 10.68 + (or (re-search-forward 10.69 + YaTeX-hierarchy-ignore-heading-regexp 10.70 + (point-end-of-line) t) 10.71 + (throw 'found t)))) 10.72 + (beginning-of-line) 10.73 + (search-forward "%") 10.74 + (skip-chars-forward "% \t") 10.75 + (buffer-substring (point) (point-end-of-line))) 10.76 + (t "")))))) 10.77 10.78 (defun YaTeX-display-a-hierachy (hier level) 10.79 "Put a HIER of document hierarchy. 10.80 @@ -177,12 +185,19 @@ 10.81 10.82 \\[YaTeX-hierarchy-next] next line 10.83 \\[YaTeX-hierarchy-prev] previous line 10.84 -\\[YaTeX-hierarchy-forward] move forward in same level 10.85 -\\[YaTeX-hierarchy-backward] move backward in same level 10.86 +\\[YaTeX-hierarchy-forward] move forward in the same level 10.87 +\\[YaTeX-hierarchy-backward] move backward in the same level 10.88 \\[YaTeX-hierarchy-up-document] move to parent file 10.89 \\[delete-other-windows] delete other windows 10.90 \\[other-window] other window 10.91 -\\[YaTeX-hierarchy-show] show buffer contents in the next window 10.92 +\\[shrink-window] shrink window 10.93 +\\[enlarge-window] enlarge window 10.94 +\\[YaTeX-hierarchy-show] show file contents in the next window 10.95 +\\[YaTeX-hierarchy-scroll-up] scroll up file contents buffer 10.96 +\\[YaTeX-hierarchy-scroll-down] scroll down file contents buffer 10.97 +\\[YaTeX-hierarchy-top] show the top of file contents 10.98 +\\[YaTeX-hierarchy-bottom] show the bottom of file contents 10.99 +\\[YaTeX-hierarchy-lastpos] return to the previous position 10.100 \\[YaTeX-hierarchy-select] select file 10.101 \\[YaTeX-hierarchy-mouse-select] select 10.102 " 10.103 @@ -214,7 +229,7 @@ 10.104 (interactive "p") 10.105 (forward-line arg) 10.106 (skip-chars-forward "- +\\|") 10.107 - (if (and (/= arg 0) YaTeX-hierarchy-inspect-mode (not quiet)) 10.108 + (if (and (/= arg 0) (not quiet)) 10.109 (YaTeX-hierarchy-select t)) 10.110 (message YaTeX-hierarchy-buffer-message)) 10.111 10.112 @@ -278,7 +293,9 @@ 10.113 (interactive "p") 10.114 (YaTeX-hierarchy-next 0) ;move to file name column 10.115 (if (bolp) (error "Not on file name line")) 10.116 - (let ((file (buffer-substring (point) (point-end-of-line)))) 10.117 + (let ((file (buffer-substring 10.118 + (point) 10.119 + (progn (skip-chars-forward "^ \t") (point))))) 10.120 (YaTeX-hierarchy-next arg) 10.121 (cond 10.122 ((get-buffer file) 10.123 @@ -321,13 +338,51 @@ 10.124 (set-window-configuration (car YaTeX-hierarchy-saved-wc)) 10.125 (bury-buffer nil))) 10.126 10.127 -(defun YaTeX-hierarchy-toggle-inspection (arg) 10.128 - "Toggle inspection mode of YaTeX-hierarchy buffer." 10.129 +(defun YaTeX-hierarchy-scroll-up (arg &optional action) 10.130 + "Scroll up file contents of YaTeX-hierarchy." 10.131 (interactive "P") 10.132 - (setq YaTeX-hierarchy-inspect-mode 10.133 - (or arg (not YaTeX-hierarchy-inspect-mode))) 10.134 - (message "YaTeX hierarchy inspection mode %s" 10.135 - (if YaTeX-hierarchy-inspect-mode "ON" "OFF"))) 10.136 + (YaTeX-hierarchy-next 0 t) 10.137 + (let*((bufname (buffer-substring 10.138 + (point) 10.139 + (save-excursion (skip-chars-forward "^ \t") (point)))) 10.140 + (buf (get-buffer bufname)) 10.141 + (cw (selected-window))) 10.142 + (cond 10.143 + ((and buf (get-buffer-window buf)) 10.144 + (select-window (get-buffer-window buf))) 10.145 + ((and buf (YaTeX-showup-buffer buf nil t)) t) 10.146 + (t (YaTeX-hierarchy-select nil))) 10.147 + (unwind-protect 10.148 + (cond 10.149 + ((eq action 'down) (scroll-down arg)) 10.150 + ((eq action 'top) (beginning-of-buffer)) 10.151 + ((eq action 'bottom) (end-of-buffer)) 10.152 + ((eq action 'last) (exchange-point-and-mark)) 10.153 + (t (scroll-up arg))) 10.154 + (select-window cw)))) 10.155 + 10.156 +(defun YaTeX-hierarchy-scroll-down (arg) 10.157 + "Scroll down file contents of YaTeX-hierarchy." 10.158 + (interactive "P") 10.159 + (YaTeX-hierarchy-scroll-up arg 'down)) 10.160 + 10.161 +(defun YaTeX-hierarchy-top () 10.162 + "Show the top of YaTeX-hierarchy inspection buffer's." 10.163 + (interactive) 10.164 + (YaTeX-hierarchy-scroll-up nil 'top) 10.165 +) 10.166 + 10.167 +(defun YaTeX-hierarchy-bottom () 10.168 + "Show the top of YaTeX-hierarchy inspection buffer's." 10.169 + (interactive) 10.170 + (YaTeX-hierarchy-scroll-up nil 'bottom) 10.171 +) 10.172 + 10.173 +(defun YaTeX-hierarchy-lastpos () 10.174 + "Go to last position in YaTeX-hierarchy buffer." 10.175 + (interactive) 10.176 + (YaTeX-hierarchy-scroll-up nil 'last) 10.177 +) 10.178 10.179 ;; ----- Setting up keymap ----- 10.180 (defvar YaTeX-hierarchy-mode-map nil "Keymap used in YaTeX-hierarchy-mode.") 10.181 @@ -347,9 +402,17 @@ 10.182 (define-key YaTeX-hierarchy-mode-map "K" 'YaTeX-hierarchy-kill-buffer) 10.183 (define-key YaTeX-hierarchy-mode-map "1" 'delete-other-windows) 10.184 (define-key YaTeX-hierarchy-mode-map "o" 'other-window) 10.185 + (define-key YaTeX-hierarchy-mode-map "-" 'shrink-window) 10.186 + (define-key YaTeX-hierarchy-mode-map "+" 'enlarge-window) 10.187 (define-key YaTeX-hierarchy-mode-map "." 'YaTeX-hierarchy-show) 10.188 + (define-key YaTeX-hierarchy-mode-map " " 'YaTeX-hierarchy-scroll-up) 10.189 + (define-key YaTeX-hierarchy-mode-map "b" 'YaTeX-hierarchy-scroll-down) 10.190 + (define-key YaTeX-hierarchy-mode-map "\C-?" 'YaTeX-hierarchy-scroll-down) 10.191 (define-key YaTeX-hierarchy-mode-map "\C-m" 'YaTeX-hierarchy-select) 10.192 - (define-key YaTeX-hierarchy-mode-map ";" 'YaTeX-hierarchy-toggle-inspection) 10.193 + (define-key YaTeX-hierarchy-mode-map "<" 'YaTeX-hierarchy-top) 10.194 + (define-key YaTeX-hierarchy-mode-map ">" 'YaTeX-hierarchy-bottom) 10.195 + (define-key YaTeX-hierarchy-mode-map "'" 'YaTeX-hierarchy-lastpos) 10.196 + (define-key YaTeX-hierarchy-mode-map "g" 'YaTeX-hierarchy-select) 10.197 (define-key YaTeX-hierarchy-mode-map "q" 'YaTeX-hierarchy-quit) 10.198 (define-key YaTeX-hierarchy-mode-map "?" 'describe-mode) 10.199 (if (and YaTeX-emacs-19 window-system)
11.1 --- a/yatexhlp.el Sun Jan 22 14:20:46 1995 +0000 11.2 +++ b/yatexhlp.el Thu Feb 02 17:18:29 1995 +0000 11.3 @@ -2,7 +2,7 @@ 11.4 ;;; YaTeX helper with LaTeX commands and macros. 11.5 ;;; yatexhlp.el 11.6 ;;; (c )1994 by HIROSE Yuuji.[yuuji@ae.keio.ac.jp] 11.7 -;;; Last modified Sat Nov 12 04:20:26 1994 on VFR 11.8 +;;; Last modified Mon Jan 23 10:17:11 1995 on pajero 11.9 ;;; $Id$ 11.10 11.11 (let ((help-file (concat "YATEXHLP." 11.12 @@ -151,7 +151,7 @@ 11.13 (if (and (= (current-column) 1) (= (preceding-char) ?.) (eolp)) 11.14 (let ((cbuf (current-buffer))) 11.15 (beginning-of-line) 11.16 - (kill-line 1) 11.17 + (delete-region (point) (progn (forward-line 1) (point))) 11.18 (save-excursion 11.19 (YaTeX-help-add-entry 11.20 YaTeX-help-command-current YaTeX-help-file-current))
12.1 --- a/yatexlib.el Sun Jan 22 14:20:46 1995 +0000 12.2 +++ b/yatexlib.el Thu Feb 02 17:18:29 1995 +0000 12.3 @@ -2,7 +2,7 @@ 12.4 ;;; YaTeX library of general functions. 12.5 ;;; yatexlib.el 12.6 ;;; (c )1994-1995 by HIROSE Yuuji.[yuuji@ae.keio.ac.jp] 12.7 -;;; Last modified Sun Jan 22 23:15:03 1995 on landcruiser 12.8 +;;; Last modified Thu Jan 26 11:15:29 1995 on pajero 12.9 ;;; $Id$ 12.10 12.11 ;;;###autoload 12.12 @@ -128,7 +128,7 @@ 12.13 that gives the maximum value by the FUNC. FUNC should take an argument 12.14 of its window object. Non-nil for optional third argument SELECT selects 12.15 that window. This function never selects minibuffer window." 12.16 - (or (and (if YaTeX-emacs-19 12.17 + (or (and (if (and YaTeX-emacs-19 select) 12.18 (get-buffer-window buffer t) 12.19 (get-buffer-window buffer)) 12.20 (progn 12.21 @@ -355,4 +355,14 @@ 12.22 (read-with-history-in hsym prompt init)) 12.23 (t (read-string prompt init)))) 12.24 12.25 +;;; 12.26 +;; Interface function for windows.el 12.27 +;;; 12.28 +;;;###autoload 12.29 +(defun YaTeX-switch-to-window () 12.30 + "Switch to windows.el's window decided by last pressed key." 12.31 + (interactive) 12.32 + (or (featurep 'windows) (error "Why don't you use `windows.el'?")) 12.33 + (win-switch-to-window 1 (- last-command-char win:base-key))) 12.34 + 12.35 (provide 'yatexlib)
13.1 --- a/yatexmth.el Sun Jan 22 14:20:46 1995 +0000 13.2 +++ b/yatexmth.el Thu Feb 02 17:18:29 1995 +0000 13.3 @@ -1,8 +1,8 @@ 13.4 ;;; -*- Emacs-Lisp -*- 13.5 ;;; YaTeX math-mode-specific functions. 13.6 -;;; yatexmth.el rev.3 13.7 +;;; yatexmth.el rev.4 13.8 ;;; (c )1993-1995 by HIROSE Yuuji [yuuji@ae.keio.ac.jp] 13.9 -;;; Last modified Sun Jan 22 23:14:51 1995 on landcruiser 13.10 +;;; Last modified Fri Jan 27 23:57:40 1995 on VFR 13.11 ;;; $Id$ 13.12 13.13 ;;; [Customization guide] 13.14 @@ -228,6 +228,9 @@ 13.15 ("\\-" "leftharpoondown" "__\n\\") 13.16 ("-/" "rightharpoondown" "__\n/") 13.17 ("-\\" "rightharpoonup" "~~\n\\") 13.18 + ;;left and right 13.19 + ("left" "left" "(leftmark)") 13.20 + ("right" "right" "(rightmark)") 13.21 ;other marks 13.22 ("Z" "aleph" "|\\|") 13.23 ("|\\|" "aleph" "|\\|") 13.24 @@ -671,7 +674,9 @@ 13.25 (delete-region beg (point)) 13.26 (call-interactively (global-key-binding this-key))) 13.27 ((eq result 'select) 13.28 - (message "Done.")) 13.29 + (message "Done.") 13.30 + (setq YaTeX-current-completion-type 'maketitle) 13.31 + (insert (YaTeX-addin single-command))) 13.32 ((eq result 'exit) 13.33 (delete-region beg (point)) 13.34 (YaTeX-toggle-math-mode))
14.1 --- a/yatexprc.el Sun Jan 22 14:20:46 1995 +0000 14.2 +++ b/yatexprc.el Thu Feb 02 17:18:29 1995 +0000 14.3 @@ -2,7 +2,7 @@ 14.4 ;;; YaTeX process handler. 14.5 ;;; yatexprc.el 14.6 ;;; (c )1993-1995 by HIROSE Yuuji.[yuuji@ae.keio.ac.jp] 14.7 -;;; Last modified Sun Jan 22 23:14:44 1995 on landcruiser 14.8 +;;; Last modified Sat Jan 28 01:01:44 1995 on VFR 14.9 ;;; $Id$ 14.10 14.11 (require 'yatex) 14.12 @@ -632,7 +632,11 @@ 14.13 (setq cmd 14.14 (read-string-with-history 14.15 "Edit command line: " 14.16 - (format cmd (YaTeX-get-preview-file-name)) 14.17 + (format cmd 14.18 + (if (get 'dvi2-command 'region) 14.19 + (substring YaTeX-texput-file 14.20 + 0 (rindex YaTeX-texput-file ?.)) 14.21 + (YaTeX-get-preview-file-name))) 14.22 'YaTeX-lpr-command-history)) 14.23 (save-excursion 14.24 (YaTeX-visit-main t) ;;change execution directory
15.1 --- a/yatexsec.el Sun Jan 22 14:20:46 1995 +0000 15.2 +++ b/yatexsec.el Thu Feb 02 17:18:29 1995 +0000 15.3 @@ -2,7 +2,7 @@ 15.4 ;;; YaTeX sectioning browser. 15.5 ;;; yatexsec.el 15.6 ;;; (c ) 1994 by HIROSE Yuuji [yuuji@ae.keio.ac.jp] 15.7 -;;; Last modified Fri Nov 25 04:46:42 1994 on VFR 15.8 +;;; Last modified Tue Jan 24 23:19:14 1995 on VFR 15.9 ;;; $Id$ 15.10 15.11 (defvar YaTeX-sectioning-level 15.12 @@ -152,7 +152,8 @@ 15.13 (interactive "p") 15.14 (if (eq (selected-window) (minibuffer-window)) 15.15 (let*((command (buffer-string)) 15.16 - (aster (equal (substring command -1) "*")) 15.17 + (aster (and (string< "" command) 15.18 + (equal (substring command -1) "*"))) 15.19 (command (if aster (substring command 0 -1) command)) 15.20 (alist YaTeX-sectioning-level) 15.21 (level 0))