yatex

changeset 57:18f4939986e6

(j)LaTeX2e supported yatex19.el fixed a lot
author yuuji
date Sat, 02 Dec 1995 18:35:28 +0000
parents a9653fbd1c1c
children 3a7c0c2bf16d
files docs/qanda.eng docs/yatexe.tex docs/yatexj.tex help/YATEXHLP.jp yahtml.el yatex.el yatex.new yatex19.el yatexadd.el yatexmth.el yatexprc.el
diffstat 11 files changed, 563 insertions(+), 100 deletions(-) [+]
line diff
     1.1 --- a/docs/qanda.eng	Thu Jun 29 13:46:57 1995 +0000
     1.2 +++ b/docs/qanda.eng	Sat Dec 02 18:35:28 1995 +0000
     1.3 @@ -191,6 +191,14 @@
     1.4  	\begin{itemize} within the environment.   Now it's  too shallow?
     1.5  	Umm... time for me to take a break.
     1.6  	
     1.7 +*Is it possible to include personal template file template.tex handily?
     1.8 +	
     1.9 +	Try Emacs-19's standard package `autoinsert.el' please.  Or its
    1.10 +	upper compatible package auto-insert-tkld might also be good.
    1.11 +	You can get auto-insert-tkld via anonymous ftp
    1.12 +	ftp://ftp.ae.keio.ac.jp/pub/emacs-lisp/util/
    1.13 +	ftp://archive.cis.ohio-state.edu/pub/gnu/elisp-archive/
    1.14 +	
    1.15  [About Emacs-19/Mule2]
    1.16  ======================
    1.17  *Equations are too dark to read when I use hilit19.
    1.18 @@ -295,7 +303,7 @@
    1.19  	Naoki;  katsura@prc.tsukuba.ac.jp) is  "fj  Wild  Bird Society".
    1.20  	Send a mail like
    1.21  	
    1.22 -		To: yatex-control@harvest.jaist.ac.jp
    1.23 +		To: yatex-control@jaist.ac.jp
    1.24  		Subject: append
    1.25  		-----
    1.26  		Hi!  See any birds fly by?
     2.1 --- a/docs/yatexe.tex	Thu Jun 29 13:46:57 1995 +0000
     2.2 +++ b/docs/yatexe.tex	Sat Dec 02 18:35:28 1995 +0000
     2.3 @@ -1673,6 +1673,20 @@
     2.4  Simplyfy messages of various completions(@code{nil})$B!#(B
     2.5  @end defvar
     2.6  
     2.7 +@defvar YaTeX-hilit-sectioning-face
     2.8 +When hilit19 and yatex19 is active, YaTeX colors the sectioning commands.
     2.9 +This variable specifies the foreground and background color of
    2.10 +@code{\part} macro.  The default value is @code{'(yellow/dodgerblue
    2.11 +yellow/slateblue)}.  The first element of this list is for the screen when
    2.12 +@code{hilit-background-mode} is @code{'light}, and the second element is
    2.13 +for @code{'dark}.  You should specify both color as `forecolor/backcolor'.
    2.14 +@end defvar
    2.15 +
    2.16 +@defvar YaTeX-hilit-sectioning-attenuation-rate
    2.17 +When color mode, this variable specifies how much attenuate the color
    2.18 +density of @code{\subparagraph} compared with that of @code{\chapter}.
    2.19 +See also $B!#(B@code{YaTeX-hilit-sectioning-face}.
    2.20 +@end defvar
    2.21  
    2.22  
    2.23  @node Sample definitions, Hook variables, All customizable variables, Lisp variables
    2.24 @@ -2128,8 +2142,8 @@
    2.25  (up to Mar.1995 at least)  And there is mailing list for YaTeX.
    2.26  Although the common language is Japanese, questions in English will be
    2.27  welcome.  To join the ML, send the mail whose subject is `append' to
    2.28 -the address `yatex-control@@harvest.jaist.ac.jp'.  If you have some
    2.29 -question, please ask to `yatex-request@@harvest.jaist.ac.jp'.
    2.30 +the address `yatex-control@@jaist.ac.jp'.  If you have some
    2.31 +question, please ask to `yatex-request@@jaist.ac.jp'.
    2.32  
    2.33    The specification of this software will be surely modified
    2.34  (depending on my feelings) without notice :-p.
     3.1 --- a/docs/yatexj.tex	Thu Jun 29 13:46:57 1995 +0000
     3.2 +++ b/docs/yatexj.tex	Sat Dec 02 18:35:28 1995 +0000
     3.3 @@ -1879,6 +1879,20 @@
     3.4  各種補完時のメッセージ出力を簡素化する(@code{nil})。
     3.5  @end defvar
     3.6  
     3.7 +@defvar YaTeX-hilit-sectioning-face
     3.8 +色付けが有効な時の @code{\part} の色
     3.9 +(@code{'(yellow/dodgerblue yellow/slateblue)})。
    3.10 +リストの第一要素は @code{hilit-background-mode} が @code{'light} の時の、
    3.11 +第二要素は @code{'dark} の時の @code{\chapter} の色で、文字色/背景色 のよ
    3.12 +うに指定する。
    3.13 +@end defvar
    3.14 +
    3.15 +@defvar YaTeX-hilit-sectioning-attenuation-rate
    3.16 +色付けが有効な時の、@code{\subparagraph} の色を @code{\chapter} の濃度の何
    3.17 +%薄くしたものにするか(@code{'(15 40)}。@code{YaTeX-hilit-sectioning-face}
    3.18 +の項参照。
    3.19 +@end defvar
    3.20 +
    3.21  @node Sample definitions, Hook variables, All customizable variables, Lisp variables
    3.22  @comment  node-name,  next,  previous,  up
    3.23  @subsection カスタマイズ変数設定例
     4.1 --- a/help/YATEXHLP.jp	Thu Jun 29 13:46:57 1995 +0000
     4.2 +++ b/help/YATEXHLP.jp	Sat Dec 02 18:35:28 1995 +0000
     4.3 @@ -1083,6 +1083,12 @@
     4.4  出力される、\bibitem[LABEL]{NAME}の書式では、\cite{NAME}で参照され、
     4.5  [LABEL] のような引用記号が出力される。
     4.6  
     4.7 +cite
     4.8 +\cite{NAME}			\cite[LABEL]{NAME}
     4.9 +\cite{NAME}の書式では、NAMEで参照され、[1],[2] のような形で引用記号が
    4.10 +出力される、\cite[LABEL]{NAME}の書式では、[1,LABEL] のような引用記号
    4.11 +が出力される。
    4.12 +
    4.13  footnote
    4.14  \footnote{NOTE}
    4.15  NOTEという内容の脚注を生成する。
    4.16 @@ -1319,13 +1325,15 @@
    4.17  
    4.18  竹中浩さん(東京大)
    4.19  	M-q (YaTeX-fill-paragraph) のバグを報告して頂きました。
    4.20 +	YaTeX-insert-amper をcontributeして頂きました。
    4.21  
    4.22  佐藤圭さん(慶應大)
    4.23  	ネストした同種のitemize環境でのindentationの不具合を指摘して頂き
    4.24  	ました。
    4.25  
    4.26  石川洋介さん(富士通)
    4.27 -	Mule2で斜体フォントを使用するための手順を教えて頂きました。
    4.28 +	Mule2で斜体フォントを使用するための手順、auto-insertの存在を教え
    4.29 +	て頂きました。
    4.30  
    4.31  井上浩一さん(九州大学)
    4.32  	MuleでフォーマットしたinfoファイルをNemacs用にコンバートする方法
    4.33 @@ -1335,6 +1343,10 @@
    4.34  	font-lock の使い方を調査するといって、まだ何も教えてくれません。
    4.35  	早くしてください:-)。
    4.36  
    4.37 +吉田尚志さん(慶應大)
    4.38 +	label/ref補完で、labelやrefで始まる単語全てを候補にいれてしまう
    4.39 +	バグを報告して頂きました。
    4.40 +
    4.41  yatex
    4.42  (setq auto-mode-alist (cons '("\\.tex$" . yatex-mode) auto-mode-alist))
    4.43  <refer YaTeX>
     5.1 --- a/yahtml.el	Thu Jun 29 13:46:57 1995 +0000
     5.2 +++ b/yahtml.el	Sat Dec 02 18:35:28 1995 +0000
     5.3 @@ -1,6 +1,6 @@
     5.4  ;;; -*- Emacs-Lisp -*-
     5.5  ;;; (c ) 1994 by HIROSE Yuuji [yuuji@ae.keio.ac.jp, pcs39334@ascii-net.or.jp]
     5.6 -;;; Last modified Mon Apr 24 22:52:17 1995 on pajero
     5.7 +;;; Last modified Mon Nov 20 11:26:38 1995 on inspire
     5.8  ;;; This is PURELY tentative.
     5.9  ;;; $Id$
    5.10  
    5.11 @@ -10,11 +10,16 @@
    5.12  ;;; completing featureas are available: ([prefix] means `C-c' by default)
    5.13  ;;;
    5.14  ;;;  * [prefix] b X	Complete environments such as `H1' which
    5.15 -;;;			normally requires newline.
    5.16 +;;;			normally requires closing tag `</H1>
    5.17 +;;;			<a href=foo> ... </a> is also classified into
    5.18 +;;;			this group
    5.19  ;;;  * [prefix] s	Complete declarative notations such as
    5.20 -;;;			`<a href="foo.html"> .... </a>'
    5.21 +;;;			`<img src="foo.gif">'
    5.22 +;;;			`<input name="var" ...>'
    5.23  ;;;  * [prefix] l	Complete typeface-changing commands such as
    5.24  ;;;			`<i> ... </i>' or `<samp> ... </samp>'
    5.25 +;;;  * [prefix] m	Complete single commands such as
    5.26 +;;;			`<br>' or `<hr>'
    5.27  ;;;  * menu-bar yahtml	Complete all by selecting a menu item (Though I
    5.28  ;;;			hate menu, this is most useful)
    5.29  ;;;
    5.30 @@ -23,16 +28,87 @@
    5.31  
    5.32  
    5.33  (require 'yatex)
    5.34 -(defvar yahtml-prefix-map (copy-keymap YaTeX-prefix-map))
    5.35 -(defvar yahtml-mode-map nil
    5.36 -  "Keymap used in yahtml-mode.")
    5.37 +(defvar yahtml-prefix-map nil)
    5.38 +(defvar yahtml-mode-map nil "Keymap used in yahtml-mode.")
    5.39 +
    5.40 +(defun yahtml-define-begend-key-normal (key env &optional map)
    5.41 +  "Define short cut yahtml-insert-begin-end key."
    5.42 +  (YaTeX-define-key
    5.43 +   key
    5.44 +   (list 'lambda '(arg) '(interactive "P")
    5.45 +	 (list 'yahtml-insert-begin-end env 'arg))
    5.46 +   map))
    5.47 +
    5.48 +(defun yahtml-define-begend-region-key (key env &optional map)
    5.49 +  "Define short cut yahtml-insert-begin-end-region key."
    5.50 +  (YaTeX-define-key key (list 'lambda nil '(interactive)
    5.51 +			      (list 'yahtml-insert-begin-end env t)) map))
    5.52 +
    5.53 +(defun yahtml-define-begend-key (key env &optional map)
    5.54 +  "Define short cut key for begin type completion both for
    5.55 +normal and region mode.  To customize yahtml, user should use this function."
    5.56 +  (yahtml-define-begend-key-normal key env map)
    5.57 +  (if YaTeX-inhibit-prefix-letter nil
    5.58 +    (yahtml-define-begend-region-key
    5.59 +     (concat (upcase (substring key 0 1)) (substring key 1)) env)))
    5.60 +
    5.61 +
    5.62  (if yahtml-mode-map nil
    5.63 -  (setq yahtml-mode-map (make-sparse-keymap))
    5.64 +  (setq yahtml-mode-map (make-sparse-keymap)
    5.65 +	yahtml-prefix-map (make-sparse-keymap))
    5.66    (define-key yahtml-mode-map YaTeX-prefix yahtml-prefix-map)
    5.67    (define-key yahtml-mode-map "\M-\C-@" 'YaTeX-mark-environment)
    5.68    (define-key yahtml-mode-map "\M-\C-a" 'YaTeX-beginning-of-environment)
    5.69 -  (define-key yahtml-mode-map "\M-\C-e" 'YaTeX-end-of-environment))
    5.70 +  (define-key yahtml-mode-map "\M-\C-e" 'YaTeX-end-of-environment)
    5.71 +  (define-key yahtml-mode-map "\C-i" 'YaTeX-indent-line)
    5.72 +  (define-key yahtml-mode-map YaTeX-prefix yahtml-prefix-map)
    5.73 +  (let ((map yahtml-prefix-map))
    5.74 +    (YaTeX-define-key "^" 'yahtml-visit-main map)
    5.75 +    (YaTeX-define-key "4^" 'yahtml-visit-main-other-window map)
    5.76 +    (YaTeX-define-key "4g" 'yahtml-goto-corresponding-*-other-window map)
    5.77 +    (YaTeX-define-key "44" 'YaTeX-switch-to-window map)
    5.78 +    (and YaTeX-emacs-19 window-system
    5.79 +	 (progn
    5.80 +	   (YaTeX-define-key "5^" 'yahtml-visit-main-other-frame map)
    5.81 +	   (YaTeX-define-key "5g" 'yahtml-goto-corresponding-*-other-frame map)
    5.82 +	   (YaTeX-define-key "55" 'YaTeX-switch-to-window map)))
    5.83 +    (YaTeX-define-key "v" 'YaTeX-version map)
    5.84 +    (YaTeX-define-key "}" 'YaTeX-insert-braces-region map)
    5.85 +    (YaTeX-define-key "]" 'YaTeX-insert-brackets-region map)
    5.86 +    (YaTeX-define-key ")" 'YaTeX-insert-parens-region map)
    5.87 +    (YaTeX-define-key "s" 'yahtml-insert-form map)
    5.88 +    (YaTeX-define-key "l" 'yahtml-insert-tag map)
    5.89 +    (YaTeX-define-key "m" 'yahtml-insert-single map)
    5.90 +    (YaTeX-define-key "n" '(lambda () (interactive) (insert "<br>\n")) map)
    5.91 +    (if YaTeX-no-begend-shortcut
    5.92 +	(progn
    5.93 +	  (YaTeX-define-key "B" 'yahtml-insert-begend-region map)
    5.94 +	  (YaTeX-define-key "b" 'yahtml-insert-begend map))
    5.95 +      (yahtml-define-begend-key "bh" "HTML" map)
    5.96 +      (yahtml-define-begend-key "bH" "HEAD" map)
    5.97 +      (yahtml-define-begend-key "bt" "TITLE" map)
    5.98 +      (yahtml-define-begend-key "bb" "BODY" map)
    5.99 +      (yahtml-define-begend-key "bd" "DL" map)
   5.100 +      (yahtml-define-begend-key "b1" "H1" map)
   5.101 +      (yahtml-define-begend-key "b2" "H2" map)
   5.102 +      (yahtml-define-begend-key "b3" "H3" map)
   5.103 +      (yahtml-define-begend-key "ba" "a" map)
   5.104 +      (yahtml-define-begend-key "bf" "form" map)
   5.105 +      (yahtml-define-begend-key "bs" "select" map)
   5.106 +      (YaTeX-define-key "b " 'yahtml-insert-begend map)
   5.107 +      (YaTeX-define-key "B " 'yahtml-insert-begend map)
   5.108 +      )
   5.109 +    (YaTeX-define-key "e" 'yahtml-end-environment map)
   5.110 +    (YaTeX-define-key ">" 'yahtml-comment-region map)
   5.111 +    (YaTeX-define-key "<" 'yahtml-uncomment-region map)
   5.112 +    (YaTeX-define-key "g" 'yahtml-goto-corresponding-* map)
   5.113 +    )
   5.114 +)
   5.115  
   5.116 +(defvar yahtml-paragraph-separate
   5.117 +  (concat
   5.118 +   "^$\\|<br>\\|<p>\\|^[ \t]*</?\\(h[1-6]\\|p\\|dl\\|dd\\|dt\\|li\\|body\\|html\\|head\\|title\\|ul\\|ol\\|dl\\|pre\\)>")
   5.119 +  "*Regexp of html paragraph separater")
   5.120  (defvar yahtml-syntax-table nil
   5.121    "*Syntax table for typesetting buffer")
   5.122  
   5.123 @@ -44,24 +120,37 @@
   5.124  )
   5.125  (defvar yahtml-command-regexp "[A-Za-z0-9]+"
   5.126    "Regexp of constituent of html commands.")
   5.127 +(defvar yahtml-kanji-code 2
   5.128 +  "Kanji coding system of html file; 1=sjis, 2=jis, 3=euc")
   5.129  
   5.130  ;;; Completion tables for `form'
   5.131 -(defvar yahtml-form-table '(("a") ("form")))
   5.132 +(defvar yahtml-form-table
   5.133 +  '(("img") ("input")))
   5.134  (defvar yahtml-user-form-table nil)
   5.135  (defvar yahtml-tmp-form-table nil)
   5.136  
   5.137  (defvar yahtml-env-table
   5.138 -  '(("html") ("head") ("title") ("body") ("dl")
   5.139 -    ("h1") ("h2") ("h3") ("h4") ("h5") ("h6")))
   5.140 +  '(("html") ("head") ("title") ("body") ("dl") ("a") ("form") ("select")
   5.141 +    ("h1") ("h2") ("h3") ("h4") ("h5") ("h6") ("ul")))
   5.142 +
   5.143 +(defvar yahtml-user-env-table nil)
   5.144 +(defvar yahtml-tmp-env-table nil)
   5.145  
   5.146  ;;; Completion tables for typeface designator
   5.147  (defvar yahtml-typeface-table
   5.148    '(("defn") ("em") ("cite") ("code") ("kbd") ("samp")
   5.149 -    ("strong") ("var") ("b") ("i") ("tt") ("u"))
   5.150 +    ("strong") ("var") ("b") ("i") ("tt") ("u") ("address"))
   5.151    "Default completion table of typeface designator")
   5.152  (defvar yahtml-user-typeface-table nil)
   5.153  (defvar yahtml-tmp-typeface-table nil)
   5.154  
   5.155 +(defvar yahtml-single-cmd-table
   5.156 +  '(("hr") ("br") ("option") ("p"))
   5.157 +  "Default completion table of HTML single command.")
   5.158 +(defvar yahtml-user-single-cmd-table nil)
   5.159 +(defvar yahtml-tmp-single-cmd-table nil)
   5.160 +(defvar yahtml-last-single-cmd nil)
   5.161 +
   5.162  (defvar yahtml-prefer-upcases nil)
   5.163  (cond
   5.164   (yahtml-prefer-upcases
   5.165 @@ -75,38 +164,42 @@
   5.166  	(mapcar (function (lambda (list) (list (upcase (car list)))))
   5.167  		yahtml-typeface-table))))
   5.168  
   5.169 +(defvar yahtml-struct-name-regexp
   5.170 +  "\\<\\(h[1-6]\\|[uod]l\\|body\\|title\\|head\\)")
   5.171 +
   5.172 +
   5.173  (defun yahtml-mode ()
   5.174    (interactive)
   5.175    (yatex-mode)
   5.176 +  (cond
   5.177 +   ((boundp 'MULE)
   5.178 +    (set-file-coding-system
   5.179 +     (cdr (assq yahtml-kanji-code YaTeX-kanji-code-alist))))
   5.180 +   ((boundp 'NEMACS)
   5.181 +    (make-local-variable 'kanji-fileio-code)
   5.182 +    (setq kanji-fileio-code yahtml-kanji-code)))
   5.183    (setq major-mode 'yahtml-mode
   5.184  	mode-name "yahtml")
   5.185    (make-local-variable 'YaTeX-ec) (setq YaTeX-ec "")
   5.186 -  (make-local-variable 'YaTeX-struct-begin) (setq YaTeX-struct-begin "<%1>")
   5.187 +  (make-local-variable 'YaTeX-struct-begin) (setq YaTeX-struct-begin "<%1%2>")
   5.188    (make-local-variable 'YaTeX-struct-end) (setq YaTeX-struct-end "</%1>")
   5.189 -  (mapcar 'make-local-variable
   5.190 -	  '(env-table user-env-table tmp-env-table))
   5.191 -  (setq env-table yahtml-env-table)
   5.192 -  (mapcar 'make-local-variable
   5.193 -	  '(singlecmd-table user-singlecmd-table tmp-singlecmd-table))
   5.194    (make-local-variable 'YaTeX-struct-name-regexp)
   5.195 -  (setq YaTeX-struct-name-regexp "[^/]+")
   5.196 +  (setq YaTeX-struct-name-regexp yahtml-struct-name-regexp)
   5.197    (make-local-variable 'YaTeX-prefix-map)
   5.198    (make-local-variable 'YaTeX-command-token-regexp)
   5.199    (setq YaTeX-command-token-regexp yahtml-command-regexp)
   5.200 -  (setq YaTeX-prefix-map yahtml-prefix-map)
   5.201 +  (make-local-variable 'YaTeX-environment-indent)
   5.202 +  (setq YaTeX-environment-indent 0)
   5.203 +  (make-local-variable 'fill-prefix)
   5.204 +  (setq fill-prefix nil)
   5.205 +  (make-local-variable 'paragraph-separate)
   5.206 +  (setq paragraph-separate yahtml-paragraph-separate
   5.207 +	paragraph-start  yahtml-paragraph-separate)
   5.208 +  (make-local-variable 'comment-start)
   5.209 +  (make-local-variable 'comment-end)
   5.210 +  (setq comment-start "<!-- " comment-end " -->")
   5.211    (set-syntax-table yahtml-syntax-table)
   5.212    (use-local-map yahtml-mode-map)
   5.213 -  (YaTeX-define-key "s" 'yahtml-insert-form)
   5.214 -  (YaTeX-define-key "l" 'yahtml-insert-tag)
   5.215 -  (if YaTeX-no-begend-shortcut nil
   5.216 -    (YaTeX-define-begend-key "bh" "HTML")
   5.217 -    (YaTeX-define-begend-key "bH" "HEAD")
   5.218 -    (YaTeX-define-begend-key "bt" "TITLE")
   5.219 -    (YaTeX-define-begend-key "bb" "BODY")
   5.220 -    (YaTeX-define-begend-key "bd" "DL")
   5.221 -    (YaTeX-define-begend-key "b1" "H1")
   5.222 -    (YaTeX-define-begend-key "b2" "H2")
   5.223 -    (YaTeX-define-begend-key "b3" "H3"))
   5.224    (run-hooks 'yahtml-mode-hook))
   5.225  
   5.226  (defun yahtml-define-menu (keymap bindlist)
   5.227 @@ -186,6 +279,17 @@
   5.228        (dl	"Description" .
   5.229  		(lambda () (interactive) (yahtml-insert-begin-end "DL" nil)))
   5.230        )))
   5.231 +  (setq yahtml-menu-map-item (make-sparse-keymap "item"))
   5.232 +  (yahtml-define-menu
   5.233 +   yahtml-menu-map-item
   5.234 +   (nreverse
   5.235 +    '((li	"Simple item" .
   5.236 +		(lambda () (interactive) (yahtml-insert-single "li")))
   5.237 +      (dt	"Define term" .
   5.238 +		(lambda () (interactive) (yahtml-insert-single "dt")))
   5.239 +      (dd	"Description of term" .
   5.240 +		(lambda () (interactive) (yahtml-insert-single "dd")))
   5.241 +      )))
   5.242    (define-key yahtml-mode-map [menu-bar yahtml]
   5.243      (cons "yahtml" yahtml-menu-map))
   5.244    (yahtml-define-menu
   5.245 @@ -196,6 +300,8 @@
   5.246  	   (cons "sectioning" yahtml-menu-map-sectioning))
   5.247       (cons (list 'list "Listing")
   5.248  	   (cons "Listing" yahtml-menu-map-listing))
   5.249 +     (cons (list 'item "Item")
   5.250 +	   (cons "Itemizing" yahtml-menu-map-item));;; 
   5.251       (cons (list 'logi "Logical tags")
   5.252  	   (cons "logical" yahtml-menu-map-logical))
   5.253       (cons (list 'type "Typeface tags")
   5.254 @@ -221,8 +327,39 @@
   5.255  		  yahtml-urls)))
   5.256      (message "Collecting global history...Done")))
   5.257  
   5.258 +;;; ----------- Completion ----------
   5.259 +(defvar yahtml-last-begend "html")
   5.260 +(defun yahtml-insert-begend (&optional region)
   5.261 +  "Insert <cmd> ... </cmd>."
   5.262 +  (interactive "P")
   5.263 +  (let ((cmd (YaTeX-cplread-with-learning
   5.264 +	      (format "Environment(default %s): " yahtml-last-begend)
   5.265 +	      'yahtml-env-table 'yahtml-user-env-table 'yahtml-tmp-env-table))
   5.266 +	(bolp (bolp)))
   5.267 +    (if (string< "" cmd) (setq yahtml-last-begend cmd))
   5.268 +    (setq cmd yahtml-last-begend)
   5.269 +    (if region
   5.270 +	(let ((beg (region-beginning))
   5.271 +	      (end (region-end))
   5.272 +	      (addin (yahtml-addin cmd)))
   5.273 +	  (goto-char end)
   5.274 +	  (insert (format "</%s>%s" cmd (if bolp "\n" "")))
   5.275 +	  (goto-char beg)
   5.276 +	  (insert (format "<%s%s>%s" cmd addin (if bolp "\n" ""))))
   5.277 +      (insert (format "<%s%s" cmd (yahtml-addin cmd)))
   5.278 +      (if bolp (progn (insert (format ">\n</%s>\n" cmd cmd))
   5.279 +			(forward-line -1))
   5.280 +	(insert ">")
   5.281 +	(save-excursion (insert (format "</%s>" cmd)))))))
   5.282 +
   5.283 +(defun yahtml-insert-begend-region ()
   5.284 +  "Call yahtml-insert-begend in the region mode."
   5.285 +  (interactive)
   5.286 +  (yahtml-insert-begend t))
   5.287 +
   5.288 +
   5.289  (defun yahtml-insert-form (&optional form)
   5.290 -  "Insert <FORM option=\"argument\">  </FORM>."
   5.291 +  "Insert <FORM option=\"argument\">."
   5.292     (interactive)
   5.293     (or form
   5.294         (setq form
   5.295 @@ -230,25 +367,71 @@
   5.296  	      "Form: "
   5.297  	       'yahtml-form-table 'yahtml-user-form-table
   5.298  	       'yahtml-tmp-form-table)))
   5.299 -   (let ((p (point)))
   5.300 -     (insert (format "<%s%s>\n" form (yahtml-addin (downcase form))))
   5.301 -     (indent-relative-maybe)
   5.302 -     (save-excursion (insert (format "</%s>" form)))
   5.303 +   (let ((p (point)) q)
   5.304 +     (insert (format "<%s%s>" form (yahtml-addin (downcase form))))
   5.305 +     ;;(indent-relative-maybe)
   5.306 +     (if (cdr (assoc form yahtml-form-table))
   5.307 +	 (save-excursion (insert (format "</%s>" form))))
   5.308       (if (search-backward "\"\"" p t) (forward-char 1))))
   5.309  
   5.310  (defun yahtml-addin (form)
   5.311    "Check add-in function's existence and call it if exists."
   5.312 -   (let ((addin (concat "yahtml::" form)))
   5.313 +   (let ((addin (concat "yahtml:" form)))
   5.314       (if (and (intern-soft addin) (fboundp (intern-soft addin)))
   5.315  	 (concat " " (funcall (intern addin)))
   5.316         "")))
   5.317  
   5.318 -(defun yahtml::a ()
   5.319 +(defun yahtml:a ()
   5.320    "Add-in function for <a>"
   5.321 +;  (or yahtml-urls (yahtml-collect-url-history))
   5.322 +;  (concat "href=\""
   5.323 +;	  (completing-read "href: " yahtml-urls)
   5.324 +;	  "\"")
   5.325 +  (concat "href=\"" (read-file-name "href: " "" nil nil "") "\"")
   5.326 +)
   5.327 +
   5.328 +(defun yahtml:img ()
   5.329 +  "Add-in function for <img>"
   5.330    (or yahtml-urls (yahtml-collect-url-history))
   5.331 -  (concat "href=\""
   5.332 -	  (completing-read "href: " yahtml-urls)
   5.333 -	  "\""))
   5.334 +  (let ((src (read-file-name "src: " "" nil t ""))
   5.335 +	(alg (completing-read "align: " '(("top") ("middle") ("bottom")))))
   5.336 +    (concat "src=\"" src "\""
   5.337 +	    (if (string< "" alg) (concat " align=\"" alg "\"")))))
   5.338 +
   5.339 +(defun yahtml:form ()
   5.340 +  "Add-in function `form' input format"
   5.341 +  (concat
   5.342 +   " method=" (completing-read "Method: " '(("POST") ("GET")) nil t)
   5.343 +   " action=\"" (read-string "Action: ") "\""
   5.344 +   ))
   5.345 +
   5.346 +(defun yahtml:select ()
   5.347 +  "Add-in function for `select' input format"
   5.348 +  (setq yahtml-last-single-cmd "option")
   5.349 +  (concat " name=\"" (read-string "name: ") "\""))
   5.350 +
   5.351 +(defvar yahtml-input-types
   5.352 +  '(("text") ("password") ("checkbox") ("radio") ("submit")
   5.353 +    ("reset") ("image") ("hidden")))
   5.354 +
   5.355 +(defun yahtml:input ()
   5.356 +  "Add-in function for `input' form"
   5.357 +  (let (name type value checked (size "") (maxlength ""))
   5.358 +    (setq name (read-string "name: ")
   5.359 +	  type (completing-read "type (default=text): "
   5.360 +				yahtml-input-types nil t)
   5.361 +	  value (read-string "value: "))
   5.362 +    (if (string-match "text\\|password\\|^$" type)
   5.363 +	(setq size (read-string "size: ")
   5.364 +	      maxlength (read-string "maxlength: ")))
   5.365 +    (concat
   5.366 +     "name=\"" name "\""
   5.367 +     (if (string< "" type) (concat " type=\"" type "\""))
   5.368 +     (if (string< "" value) (concat " value=\"" value "\""))
   5.369 +     (if (string< "" size) (concat " size=\"" size "\""))
   5.370 +     (if (string< "" maxlength) (concat " maxlength=\"" maxlength "\""))
   5.371 +    )))
   5.372 +	
   5.373  
   5.374  (defun yahtml-insert-begin-end (env &optional region-mode)
   5.375    "Insert <ENV> \\n </ENV> by calling YaTeX-insert-begin-end."
   5.376 @@ -256,19 +439,159 @@
   5.377    (setq env (funcall (if yahtml-prefer-upcases 'upcase 'downcase) env))
   5.378    (YaTeX-insert-begin-end env region-mode))
   5.379  
   5.380 -(defun yahtml-insert-tag (&optional tag)
   5.381 +(defun yahtml-insert-tag (tag)
   5.382    "Insert <TAG> </TAG> and put cursor inside of them."
   5.383 -  (interactive)
   5.384 -  (or tag
   5.385 -      (setq tag
   5.386 -	    (YaTeX-cplread-with-learning
   5.387 -	     "Tag: "
   5.388 -	     'yahtml-typeface-table 'yahtml-user-typeface-table
   5.389 -	     'yahtml-tmp-typeface-table)))
   5.390 +  (interactive
   5.391 +   (list
   5.392 +    (YaTeX-cplread-with-learning
   5.393 +     "Tag: "
   5.394 +     'yahtml-typeface-table 'yahtml-user-typeface-table
   5.395 +     'yahtml-tmp-typeface-table)))
   5.396    (setq tag (funcall (if yahtml-prefer-upcases 'upcase 'downcase) tag))
   5.397    (insert (format "<%s> " tag))
   5.398    (save-excursion (insert (format "</%s>" tag))))
   5.399  
   5.400 +(defun yahtml-insert-single (cmd)
   5.401 +  "Insert <CMD>."
   5.402 +  (interactive
   5.403 +   (list (YaTeX-cplread-with-learning
   5.404 +	  (format "Command%s: "
   5.405 +		  (if yahtml-last-single-cmd
   5.406 +		      (concat "(default " yahtml-last-single-cmd ")") ""))
   5.407 +	  'yahtml-single-cmd-table 'yahtml-user-single-cmd-table
   5.408 +	  'yahtml-tmp-single-cmd-table)))
   5.409 +  (setq cmd (funcall (if yahtml-prefer-upcases 'upcase 'downcase) cmd))
   5.410 +  (if (string< "" cmd) (setq yahtml-last-single-cmd cmd))
   5.411 +  (insert (format "<%s>" yahtml-last-single-cmd)))
   5.412 +
   5.413 +;;; ---------- Jump ----------
   5.414 +(defun yahtml-on-href-p ()
   5.415 +  "Check if point is on href clause."
   5.416 +  (let ((p (point)) cmd)
   5.417 +    (save-excursion
   5.418 +      (or (bobp) (skip-chars-backward "^ \t"))
   5.419 +      (and (looking-at "href\\s *=\\s *\"?\\([^\"]+\\)\"?")
   5.420 +	   (< p (match-end 0))
   5.421 +	   (YaTeX-match-string 1)))))
   5.422 +
   5.423 +(defun yahtml-goto-corresponding-href (&optional other)
   5.424 +  "Go to corresponding name."
   5.425 +  (let ((href (yahtml-on-href-p)) file name)
   5.426 +    (if href
   5.427 +	(cond
   5.428 +	 ((string-match "^http:" href)
   5.429 +	  (message "Sorry, jump across http is not supported."))
   5.430 +	 (t (setq file (substring href 0 (string-match "#" href)))
   5.431 +	    (if (string-match "#" href)
   5.432 +		(setq name (substring href (1+ (string-match "#" href)))))
   5.433 +	    (if (string< "" file)
   5.434 +		(progn
   5.435 +		  (if (string-match "/$" file)
   5.436 +		      (setq file (concat file "index.html")))
   5.437 +		  (if other (YaTeX-switch-to-buffer-other-window file)
   5.438 +		    (YaTeX-switch-to-buffer file))))
   5.439 +	    (if name
   5.440 +		(progn (set-mark-command nil) (yahtml-jump-to-name name)))
   5.441 +	    t)))))
   5.442 +
   5.443 +(defun yahtml-jump-to-name (name)
   5.444 +  "Jump to html's named tag."
   5.445 +  (setq name (format "name\\s *=\\s *\"?%s\"?" name))
   5.446 +  (or (and (re-search-forward name nil t) (goto-char (match-beginning 0)))
   5.447 +      (and (re-search-backward name nil t) (goto-char (match-beginning 0)))
   5.448 +      (message "Named tag `%s' not found" (substring href 1))))
   5.449 +
   5.450 +(defun yahtml-on-begend-p (&optional p)
   5.451 +  "Check if point is on begend clause."
   5.452 +  (let ((p (point)) cmd)
   5.453 +    (save-excursion
   5.454 +      (if p (goto-char p))
   5.455 +      (if (= (char-after (point)) ?<) (forward-char 1))
   5.456 +      (if (and (re-search-backward "<" nil t)
   5.457 +	       (looking-at
   5.458 +		(concat "<\\(/?" yahtml-command-regexp "\\)\\b"))
   5.459 +	       (condition-case nil
   5.460 +		   (forward-list 1))
   5.461 +	       (< p (point)))
   5.462 +	  (YaTeX-match-string 1)))))
   5.463 +
   5.464 +(defun yahtml-goto-corresponding-begend ()
   5.465 +  (let ((cmd (yahtml-on-begend-p)))
   5.466 +  (if cmd
   5.467 +      (progn
   5.468 +	(if (= (aref cmd 0) ?/)		;on </cmd> line
   5.469 +	    (re-search-backward (format "<%s" (substring cmd 1)))
   5.470 +	  (re-search-forward (format "</%s" cmd)))
   5.471 +	(if (match-beginning 0) (goto-char (match-beginning 0)))))))
   5.472 +
   5.473 +(defun yahtml-goto-corresponding-* (&optional other)
   5.474 +  "Go to corresponding object."
   5.475 +  (interactive)
   5.476 +  (cond
   5.477 +   ((yahtml-goto-corresponding-href other))
   5.478 +   ((yahtml-goto-corresponding-begend other))
   5.479 +   ))
   5.480 +
   5.481 +(defun yahtml-goto-corresponding-*-other-window ()
   5.482 +  "Go to corresponding object."
   5.483 +  (interactive)
   5.484 +  (yahtml-goto-corresponding-* t))
   5.485 +
   5.486 +;;; ---------- commenting ----------
   5.487 +(defun yahtml-comment-region (beg end)
   5.488 +  (interactive "r")
   5.489 +  (comment-region beg end nil))
   5.490 +
   5.491 +(defun yahtml-uncomment-region (beg end)
   5.492 +  (interactive "r")
   5.493 +  (comment-region beg end '(4)))
   5.494 +
   5.495 +
   5.496 +
   5.497 +;;; ---------- ----------
   5.498 +;;; ---------- ----------
   5.499 +;;; ---------- ----------
   5.500 +
   5.501 +;;;
   5.502 +;;hilit19
   5.503 +;;;
   5.504 +(defvar yahtml-default-face-table
   5.505 +  '(
   5.506 +    (form	black/ivory	white/hex-442233	italic)
   5.507 +    ))
   5.508 +(defvar yahtml-hilit-patterns-alist
   5.509 +  '(
   5.510 +    ;; comments
   5.511 +    ("<!--\\s " "-->" comment)
   5.512 +    ;; include&exec
   5.513 +    ("<!--#\\(include\\|exec\\)" "-->" include)
   5.514 +    ;; string
   5.515 +    (hilit-string-find 39 string)
   5.516 +    (yahtml-hilit-region-tag "\\(em\\|strong\\)" bold)
   5.517 +    ("</?[uod]l>" 0 decl)
   5.518 +    ("<\\(di\\|dt\\|li\\|dd\\)>" 0 label)
   5.519 +    ("<a\\s +href" "</a>" crossref)
   5.520 +    ("</?\\sw+>" 0 decl)
   5.521 +    ("<form" "</form" form)
   5.522 +    ))
   5.523 +
   5.524 +(defun yahtml-hilit-region-tag (tag)
   5.525 +  "Return list of start/end point of <TAG> form."
   5.526 +  (if (re-search-forward (concat "<" tag ">") nil t)
   5.527 +      (let ((m0 (match-beginning 0)))
   5.528 +	(skip-chars-forward " \t\n")
   5.529 +	(cons (point)
   5.530 +	      (progn (re-search-forward (concat "</" tag ">") nil t)
   5.531 +		     (1- (match-beginning 0)))))))
   5.532 +
   5.533 +;(setq hilit-patterns-alist (delq (assq 'yahtml-mode hilit-patterns-alist) hilit-patterns-alist))
   5.534 +(cond
   5.535 + ((and (featurep 'hilit19) (featurep 'yatex19))
   5.536 +  (or (assq 'yahtml-mode hilit-patterns-alist)
   5.537 +      (setq hilit-patterns-alist
   5.538 +	    (cons (cons 'yahtml-mode yahtml-hilit-patterns-alist)
   5.539 +		  hilit-patterns-alist)))))
   5.540 +
   5.541  (provide 'yahtml)
   5.542  
   5.543  ; Local variables:
     6.1 Binary file yatex.el has changed
     7.1 --- a/yatex.new	Thu Jun 29 13:46:57 1995 +0000
     7.2 +++ b/yatex.new	Sat Dec 02 18:35:28 1995 +0000
     7.3 @@ -1,6 +1,15 @@
     7.4  	What's new in YaTeX
     7.5  	yatex.el 各バージョンの変更点について
     7.6  
     7.7 +1.60	LaTeX2e 対応
     7.8 +	documentclass パラメータを修正し、ASCII 版 jLaTeX2e に対応
     7.9 +	\{ \}でhilitがおかしくなるバグを修正
    7.10 +	YaTeX-hilit-recenterのたびにpatterns-alistが太るのを修正
    7.11 +	yahtml.el に hilit を導入
    7.12 +	変数 YaTeX-hilit-sectioning-attenuation-rate で、セクションコマ
    7.13 +	ンドの色の濃さの減衰百分率を指定できるようにした
    7.14 +	\chapter, \section, ...のデフォルトの色を変えた
    7.15 +
    7.16  1.59	%(コメント)のhilitのバグを修正。
    7.17  	tabular環境のお任せ改行で無限ループになることがあるのを回避。
    7.18  	アドイン関数が効かないバグを修正。
     8.1 --- a/yatex19.el	Thu Jun 29 13:46:57 1995 +0000
     8.2 +++ b/yatex19.el	Sat Dec 02 18:35:28 1995 +0000
     8.3 @@ -1,7 +1,7 @@
     8.4  ;;; -*- Emacs-Lisp -*-
     8.5  ;;; YaTeX facilities for Emacs 19
     8.6  ;;; (c )1994-1995 by HIROSE Yuuji.[yuuji@ae.keio.ac.jp]
     8.7 -;;; Last modified Mon May 15 15:50:04 1995 on inspire
     8.8 +;;; Last modified Sun Dec  3 03:29:56 1995 on inspire
     8.9  ;;; $Id$
    8.10  
    8.11  ;;; とりあえず hilit19 を使っている時に色が付くようにして
    8.12 @@ -325,8 +325,13 @@
    8.13  (defvar YaTeX-hilit-pattern-adjustment-private nil
    8.14    "*Adjustment hilit-pattern-alist for default yatex-mode's pattern.")
    8.15  (defvar YaTeX-hilit-sectioning-face
    8.16 -  '(yellow/dodgerblue yellow/cornflowerblue)
    8.17 +  '(yellow/dodgerblue yellow/slateblue)
    8.18    "*Hilightening face for sectioning unit.  '(FaceForLight FaceForDark)")
    8.19 +(defvar YaTeX-hilit-sectioning-attenuation-rate
    8.20 +  '(15 40)
    8.21 +  "*Maximum attenuation rate of sectioning face. '(ForeRate BackRate)
    8.22 +Each rate specifies how much portion of RGB value should be attenuated
    8.23 +towards to lowest sectioning unit.  Numbers should be written in percentage.")
    8.24  (defvar YaTeX-sectioning-patterns-alist nil
    8.25    "Hilightening patterns for sectioning units.")
    8.26  (defvar YaTeX-hilit-singlecmd-face
    8.27 @@ -345,7 +350,9 @@
    8.28  	(sectcol (symbol-name sectface))
    8.29  	sect-pat-alist)
    8.30      (if (string-match "/" sectcol)
    8.31 -	(let (colorvalue fR fG fB bR bG bB list pat fg bg level from face)
    8.32 +	(let ((fmin (nth 0 YaTeX-hilit-sectioning-attenuation-rate))
    8.33 +	      (bmin (nth 1 YaTeX-hilit-sectioning-attenuation-rate))
    8.34 +	      colorvalue fR fG fB bR bG bB pat fg bg level from face list lm)
    8.35  	  (require 'yatexsec)
    8.36  	  (setq fg (substring sectcol 0 (string-match "/" sectcol))
    8.37  		bg (substring sectcol (1+ (string-match "/" sectcol)))
    8.38 @@ -357,18 +364,19 @@
    8.39  		bR (/ (nth 0 colorvalue) 256)
    8.40  		bG (/ (nth 1 colorvalue) 256)
    8.41  		bB (/ (nth 2 colorvalue) 256)
    8.42 +		lm YaTeX-sectioning-max-level
    8.43  		list YaTeX-sectioning-level)
    8.44  	  (while list
    8.45  	    (setq pat (concat YaTeX-ec-regexp (car (car list)) "\\*?{")
    8.46  		  level (cdr (car list))
    8.47  		  fg (format "hex-%02x%02x%02x"
    8.48 -			     (- fR (/ (* level fR) 40)) ;40 musn't be constant
    8.49 -			     (- fG (/ (* level fG) 40))
    8.50 -			     (- fB (/ (* level fB) 40)))
    8.51 +			     (- fR (/ (* level fR fmin) lm 100))
    8.52 +			     (- fG (/ (* level fG fmin) lm 100))
    8.53 +			     (- fB (/ (* level fB fmin) lm 100)))
    8.54  		  bg (format "hex-%02x%02x%02x"
    8.55 -			     (- bR (/ (* level bR) 15)) ;15 musn't be constant
    8.56 -			     (- bG (/ (* level bG) 15))
    8.57 -			     (- bB (/ (* level bB) 15)))
    8.58 +			     (- bR (/ (* level bR bmin) lm 100))
    8.59 +			     (- bG (/ (* level bG bmin) lm 100))
    8.60 +			     (- bB (/ (* level bB bmin) lm 100)))
    8.61  		  from (intern (format "sectioning-%d" level))
    8.62  		  face (intern (concat fg "/" bg)))
    8.63  	    (hilit-translate from face)
    8.64 @@ -390,39 +398,45 @@
    8.65  	      (cond
    8.66  	       ((eq hilit-background-mode 'light) (car table))
    8.67  	       ((eq hilit-background-mode 'dark) (car (cdr table)))
    8.68 -	       (t nil))))))
    8.69 +	       (t nil)))))
    8.70 +	  sect single)
    8.71        (hilit-translate
    8.72         ;;sectioning (funcall get-face YaTeX-hilit-sectioning-face)
    8.73 -       macro (funcall get-face YaTeX-hilit-singlecmd-face)))
    8.74 -    (setq hilit-patterns-alist		;Remove at first.
    8.75 -	  (delq 'yatex-mode hilit-patterns-alist)
    8.76 -	  hilit-patterns-alist
    8.77 -	  (cons
    8.78 -	   (cons 'yatex-mode
    8.79 -		 (append
    8.80 -		  YaTeX-sectioning-patterns-alist
    8.81 -		  YaTeX-hilit-pattern-adjustment-private
    8.82 -		  ;;YaTeX-hilit-pattern-adjustment-default
    8.83 -		  YaTeX-hilit-patterns-alist
    8.84 -		  (list
    8.85 -		   (list
    8.86 -		    'YaTeX-19-region-section-type
    8.87 -		    (concat "\\\\\\("
    8.88 -			    (mapconcat
    8.89 -			     (function (lambda (s) (regexp-quote (car s))))
    8.90 -			     (append user-section-table tmp-section-table)
    8.91 -			     "\\|")
    8.92 -			    "\\){")
    8.93 -		    'keyword)
    8.94 -		   (list
    8.95 -		    (concat "\\\\\\("
    8.96 -			    (mapconcat
    8.97 -			     (function (lambda (s) (regexp-quote (car s))))
    8.98 -			     (append user-singlecmd-table tmp-singlecmd-table)
    8.99 -			     "\\|")
   8.100 -			    "\\)\\b")
   8.101 -		    0 'macro))))
   8.102 -	   hilit-patterns-alist)))))
   8.103 +       macro (funcall get-face YaTeX-hilit-singlecmd-face))
   8.104 +      (if (setq sect (append user-section-table tmp-section-table))
   8.105 +	  (setq sect (concat "\\\\\\("
   8.106 +			     (mapconcat
   8.107 +			      (function
   8.108 +			       (lambda (s) (regexp-quote (car s))))
   8.109 +			      sect
   8.110 +			      "\\|")
   8.111 +			     "\\){")))
   8.112 +      (if (setq single (append user-singlecmd-table tmp-singlecmd-table))
   8.113 +	  (setq single (concat "\\\\\\("
   8.114 +			       (mapconcat
   8.115 +				(function (lambda (s) (regexp-quote (car s))))
   8.116 +				single
   8.117 +				"\\|")
   8.118 +			       "\\)\\b")))
   8.119 +      (setq hilit-patterns-alist		;Remove at first.
   8.120 +	    (delq (assq 'yatex-mode hilit-patterns-alist) hilit-patterns-alist)
   8.121 +	    hilit-patterns-alist
   8.122 +	    (cons
   8.123 +	     (cons 'yatex-mode
   8.124 +		   (append
   8.125 +		    (list nil)
   8.126 +		    YaTeX-sectioning-patterns-alist
   8.127 +		    YaTeX-hilit-pattern-adjustment-private
   8.128 +		    ;;YaTeX-hilit-pattern-adjustment-default
   8.129 +		    YaTeX-hilit-patterns-alist
   8.130 +		    (delq nil
   8.131 +			  (list
   8.132 +			   (if sect (list
   8.133 +				     'YaTeX-19-region-section-type
   8.134 +				     sect
   8.135 +				     'keyword))
   8.136 +			   (if single (list single 0 'macro))))))
   8.137 +	     hilit-patterns-alist))))))
   8.138  ;;(YaTeX-19-collect-macros)	;causes an error
   8.139  (defun YaTeX-hilit-recenter (arg)
   8.140    "Collect current local macro and hilit-recenter."
   8.141 @@ -490,5 +504,10 @@
   8.142  ;;;       string 'mediumspringgreen
   8.143  ;;;       formula 'khaki
   8.144  ;;;       label 'yellow-underlined))
   8.145 +(and YaTeX-emacs-19
   8.146 +     (eval-when-compile
   8.147 +       (if (and (boundp 'window-system) window-system)
   8.148 +	   (require 'hilit19)
   8.149 +	 (error "Byte compile this file on window system! Not `-nw'!"))))
   8.150  
   8.151  (provide 'yatex19)
     9.1 --- a/yatexadd.el	Thu Jun 29 13:46:57 1995 +0000
     9.2 +++ b/yatexadd.el	Sat Dec 02 18:35:28 1995 +0000
     9.3 @@ -2,7 +2,7 @@
     9.4  ;;; YaTeX add-in functions.
     9.5  ;;; yatexadd.el rev.13
     9.6  ;;; (c )1991-1995 by HIROSE Yuuji.[yuuji@ae.keio.ac.jp]
     9.7 -;;; Last modified Thu Jan 26 03:31:20 1995 on figaro
     9.8 +;;; Last modified Mon Nov  6 14:30:25 1995 on inspire
     9.9  ;;; $Id$
    9.10  
    9.11  ;;;
    9.12 @@ -389,7 +389,7 @@
    9.13  	   YaTeX-label-buffer (function (lambda (x) (window-width x))))
    9.14  	  (with-output-to-temp-buffer YaTeX-label-buffer
    9.15  	    (while (YaTeX-re-search-active-forward
    9.16 -		    (concat "\\\\" labelcmd)
    9.17 +		    (concat "\\\\" labelcmd "\\b")
    9.18  		    (regexp-quote YaTeX-comment-prefix) nil t)
    9.19  	      (goto-char (match-beginning 0))
    9.20  	      (skip-chars-forward "^{")
    9.21 @@ -742,5 +742,69 @@
    9.22        (setq YaTeX-default-document-style sname))))
    9.23  )
    9.24  
    9.25 +;;; -------------------- LaTeX2e stuff --------------------
    9.26 +(defvar YaTeX:documentclass-options-default
    9.27 +  '(("a4paper") ("a5paper") ("b5paper") ("10pt") ("11pt") ("12pt")
    9.28 +    ("latterpaper") ("legalpaper") ("executivepaper") ("landscape")
    9.29 +    ("oneside") ("twoside") ("draft") ("final") ("leqno") ("fleqn") ("openbib")
    9.30 +    ("clock")				;for slides class only
    9.31 +    )
    9.32 +    "Default options list for documentclass")
    9.33 +(defvar YaTeX:documentclass-options-private nil
    9.34 +  "*User defined options list for documentclass")
    9.35 +(defvar YaTeX:documentclass-options-local nil
    9.36 +  "*User defined options list for local documentclass")
    9.37 +
    9.38 +(defun YaTeX:documentclass ()
    9.39 +  (let*((delim ",")
    9.40 +	(dt (append YaTeX:documentclass-options-local
    9.41 +		    YaTeX:documentclass-options-private
    9.42 +		    YaTeX:documentclass-options-default))
    9.43 +	(minibuffer-completion-table dt)
    9.44 +	(opt (read-from-minibuffer
    9.45 +	      "Documentclass options ([opt1,opt2,...]): "
    9.46 +	      nil YaTeX-minibuffer-completion-map nil))
    9.47 +	(substr opt) o)
    9.48 +    (if (string< "" opt)
    9.49 +	(progn
    9.50 +	  (while substr
    9.51 +	    (setq o (substring substr 0 (string-match delim substr)))
    9.52 +	    (or (assoc o dt)
    9.53 +		(YaTeX-update-table
    9.54 +		 (list o)
    9.55 +		 'YaTeX:documentclass-options-default
    9.56 +		 'YaTeX:documentclass-options-private
    9.57 +		 'YaTeX:documentclass-options-local))
    9.58 +	    (setq substr
    9.59 +		  (if (string-match delim substr)
    9.60 +		      (substring substr (1+ (string-match delim substr))))))
    9.61 +	  (concat "[" opt "]"))
    9.62 +      "")))
    9.63 +
    9.64 +(defvar YaTeX:documentclasses-default
    9.65 +  '(("article") ("jarticle") ("report") ("jreport") ("book") ("jbook")
    9.66 +    ("j-article") ("j-report") ("j-book")
    9.67 +    ("letter") ("slides") ("ltxdoc") ("ltxguide") ("ltnews") ("proc"))
    9.68 +  "Default documentclass alist")
    9.69 +(defvar YaTeX:documentclasses-private nil
    9.70 +  "*User defined documentclass alist")
    9.71 +(defvar YaTeX:documentclasses-local nil
    9.72 +  "*User defined local documentclass alist")
    9.73 +(defvar YaTeX-default-documentclass (if YaTeX-japan "jarticle" "article")
    9.74 +  "*Default documentclass")
    9.75 +
    9.76 +(defun YaTeX::documentclass (&optional argp)
    9.77 +  (cond
    9.78 +   ((equal argp 1)
    9.79 +    (setq env-name "document")
    9.80 +    (let ((sname
    9.81 +	   (YaTeX-cplread-with-learning
    9.82 +	    (format "Documentclass (default %s): " YaTeX-default-documentclass)
    9.83 +	    'YaTeX:documentclasses-default
    9.84 +	    'YaTeX:documentclasses-private
    9.85 +	    'YaTeX:documentclasses-local)))
    9.86 +      (if (string= "" sname) (setq sname YaTeX-default-documentclass))
    9.87 +      (setq YaTeX-default-documentclass sname)))))
    9.88 +
    9.89  ;;; -------------------- End of yatexadd --------------------
    9.90  (provide 'yatexadd)
    10.1 --- a/yatexmth.el	Thu Jun 29 13:46:57 1995 +0000
    10.2 +++ b/yatexmth.el	Sat Dec 02 18:35:28 1995 +0000
    10.3 @@ -2,7 +2,7 @@
    10.4  ;;; YaTeX math-mode-specific functions.
    10.5  ;;; yatexmth.el rev.4
    10.6  ;;; (c )1993-1995 by HIROSE Yuuji [yuuji@ae.keio.ac.jp]
    10.7 -;;; Last modified Sat Feb 18 03:54:50 1995 on VFR
    10.8 +;;; Last modified Wed Aug 16 12:45:55 1995 on inspire
    10.9  ;;; $Id$
   10.10  
   10.11  ;;; [Customization guide]
   10.12 @@ -445,8 +445,7 @@
   10.13    (or (YaTeX-quick-in-environment-p
   10.14         '("math" "eqnarray" "equation" "eqnarray*" "displaymath"))
   10.15        (let*((p (point)) (nest 0) me0
   10.16 -	    (delim (concat YaTeX-sectioning-regexp
   10.17 -			   "\\|^%\\|^$\\|^\C-l"))
   10.18 +	    (delim (concat YaTeX-sectioning-regexp "\\|^$\\|^\C-l"))
   10.19  	    (boundary
   10.20  	     (save-excursion
   10.21  	       (if (looking-at delim)
    11.1 --- a/yatexprc.el	Thu Jun 29 13:46:57 1995 +0000
    11.2 +++ b/yatexprc.el	Sat Dec 02 18:35:28 1995 +0000
    11.3 @@ -2,7 +2,7 @@
    11.4  ;;; YaTeX process handler.
    11.5  ;;; yatexprc.el
    11.6  ;;; (c )1993-1995 by HIROSE Yuuji.[yuuji@ae.keio.ac.jp]
    11.7 -;;; Last modified Sat Jan 28 01:01:44 1995 on VFR
    11.8 +;;; Last modified Thu Nov  2 19:35:16 1995 on inspire
    11.9  ;;; $Id$
   11.10  
   11.11  (require 'yatex)
   11.12 @@ -668,7 +668,8 @@
   11.13      (string-match (YaTeX-guess-parent (YaTeX-get-builtin "!")) (buffer-name)))
   11.14     (t
   11.15      (save-excursion
   11.16 -      (let ((latex-main-id (concat "^\\s *" YaTeX-ec-regexp "documentstyle")))
   11.17 +      (let ((latex-main-id
   11.18 +	     (concat "^\\s *" YaTeX-ec-regexp "document\\(style\\|class\\)")))
   11.19  	(or (re-search-backward latex-main-id nil t)
   11.20  	    (re-search-forward latex-main-id nil t))))))
   11.21  )