yatex

changeset 79:0734be649cb8

Do not care file-coding-system when YaTeX-kanji-code is nil. New completion yatexpkg.el is introduced.
author yuuji
date Thu, 25 Dec 2003 04:10:32 +0000
parents 5b19f901fa16
children 9b4354af748c
files docs/yatexadd.doc docs/yatexe.tex docs/yatexj.tex help/YATEXHLP.eng help/YATEXHLP.jp yahtml.el yatex.el yatex.new yatex19.el yatexadd.el yatexenv.el yatexgen.el yatexhie.el yatexhlp.el yatexlib.el yatexm-o.el yatexpkg.el yatexprc.el yatexsec.el
diffstat 19 files changed, 847 insertions(+), 284 deletions(-) [+]
line diff
     1.1 --- a/docs/yatexadd.doc	Fri May 02 11:23:59 2003 +0000
     1.2 +++ b/docs/yatexadd.doc	Thu Dec 25 04:10:32 2003 +0000
     1.3 @@ -38,13 +38,19 @@
     1.4  【関数定義】
     1.5  
     1.6  	  付加関数には、各LaTeXコマンドのオプション引数を返す形式のもの、
     1.7 -	section型補完の引数を返すもの、の二種類があります。
     1.8 +	section型補完の引数を返すもの、リジョン括りsection型補完の引数該当
     1.9 +	部を処理するためのもの、三種類があります。ここでは便宜上その三つを、
    1.10  
    1.11 -	  前者は、以下の例のように、begin型補完では\begin{環境名}の直後に
    1.12 -	付加する文字列、section型補完では LaTeX コマンド名と第一引数の間に
    1.13 -	位置する文字列、maketitle型補完では LaTeX コマンド名の直後に位置す
    1.14 -	る文字列を返すような関数です。便宜上この形の付加関数を、追加型付加
    1.15 -	関数と呼ぶことにします。
    1.16 +		a. 追加型付加関数
    1.17 +		b. 引数型付加関数
    1.18 +		c. 括り補完時付加関数
    1.19 +
    1.20 +	と呼ぶことにします。
    1.21 +
    1.22 +	  a は、以下の例のように、begin型補完では\begin{環境名}の直後に付
    1.23 +	加する文字列、section型補完では LaTeX コマンド名と第一引数の間に位
    1.24 +	置する文字列、maketitle型補完では LaTeX コマンド名の直後に位置する
    1.25 +	文字列を返すような関数です。
    1.26  
    1.27  	(例)	\begin{table}[ht]	(付加関数名 YaTeX:table)
    1.28  		             ~~~~
    1.29 @@ -56,8 +62,8 @@
    1.30  	追加型付加関数は『LaTeXコマンド名の前に YaTeX: をつけた名前』で定
    1.31  	義します。
    1.32  
    1.33 -	  後者は、以下のようにsection型コマンドの引数となる文字列を返す
    1.34 -	関数です。この形の付加関数を引数型付加関数と呼ぶことにします。
    1.35 +	  b は、以下のようにsection型コマンドの引数となる文字列を返す関数
    1.36 +	です。
    1.37  
    1.38  	(例)	\newcommand{\foo}{bar}	(付加関数名 YaTeX::newcommand)
    1.39  			    ~~~~  ~~~
    1.40 @@ -68,6 +74,21 @@
    1.41  	て、引数型付加関数は整数の引数を一つ取るものとして定義し、その引数
    1.42  	の値により処理を決定することになります。
    1.43  
    1.44 +	(yatex.1.72の新機能)
    1.45 +	  c は、既存テキストの一部をsection型コマンドの引数として括るとき
    1.46 +	に、指定したりジョンの先頭と末尾の各ポイントを引数として呼ばれます。
    1.47 +	たとえば、
    1.48 +
    1.49 +		5/3
    1.50 +
    1.51 +	というテキストをリジョン指定して [prefix] S でセクション型コマンド
    1.52 +	で括りたいときに、括られるテキストに対してなんらかの処理をほどこし
    1.53 +	たいときに呼ばれます。
    1.54 +
    1.55 +	(例)	5/3		←5/3をリジョン指定し \frac で括る
    1.56 +		\frac{5/3}	←5/3のポイント位置を引数に呼ばれる
    1.57 +		      ~~~	(付加関数 YaTeX::frac-region)
    1.58 +		
    1.59  
    1.60  【定義例】
    1.61  
    1.62 @@ -110,6 +131,30 @@
    1.63  	なお、引数型付加関数が nil を返した場合は、通常の引数入力関数が呼
    1.64  	ばれます。
    1.65  
    1.66 +	  最後に括り補完時付加関数の例として、既存テキストを \frac で括
    1.67 +	る場合の例を示します。\frac は2つの引数を取り、\frac{a}{b} のよ
    1.68 +	うにして、分数を表すときに利用するコマンドです。数学的には
    1.69 +
    1.70 +				a
    1.71 +		a/b        ⇔  ----
    1.72 +				b
    1.73 +
    1.74 +	と置き換え可能な記法です。LaTeXソースにa/bと書いたものを野鳥の括
    1.75 +	り補完で\fracに括ると、以下のようになります。
    1.76 +
    1.77 +		\frac{a/b}
    1.78 +
    1.79 +	/の部分を }{ に置き換えれば正しい書き換えになります。このような
    1.80 +	ことを対話的に半自動で行なうアドイン関数は以下のようにします。
    1.81 +
    1.82 +		(defun YaTeX::frac-region (beg end)	;リジョンの先頭と末尾
    1.83 +		  (catch 'done
    1.84 +		    (while (search-forward "/" end t)	;/がある間繰り返す
    1.85 +		      (goto-char (match-beginning 0))	;/の位置に移動
    1.86 +		      (if (y-or-n-p "Replace this slash(/) to `}{'")
    1.87 +			  (throw 'done (replace-match "}{"))) ;置き換えて終了
    1.88 +		      (goto-char (match-end 0)))))
    1.89 +
    1.90  
    1.91  【呼ばれ方】
    1.92  
    1.93 @@ -118,7 +163,8 @@
    1.94  	\begin{環境名} が自動入力された直後に呼び出されます。section型補完
    1.95  	では第一引数の補完の直前、maketitle型補完の場合は、コマンド名の直
    1.96  	後(一つのスペースを挿入する直前)に呼び出されます。引数型付加関数は、
    1.97 -	section型コマンドの引数の入力時にその都度呼ばれます。
    1.98 +	section型コマンドの引数の入力時にその都度呼ばれます。括り補完時付
    1.99 +	加関数は、LaTeXコマンドと{}がテキストに挿入された直後に呼ばれます。
   1.100  
   1.101  
   1.102  【参考】
     2.1 --- a/docs/yatexe.tex	Fri May 02 11:23:59 2003 +0000
     2.2 +++ b/docs/yatexe.tex	Thu Dec 25 04:10:32 2003 +0000
     2.3 @@ -5,7 +5,7 @@
     2.4  
     2.5  @iftex
     2.6  @c @syncodeindex fn cp
     2.7 -@c Last modified Fri Feb  2 12:39:12 2001 on firestorm
     2.8 +@c Last modified Fri Sep 12 12:04:11 2003 on firestorm
     2.9  @syncodeindex vr cp
    2.10  @end iftex
    2.11  
    2.12 @@ -15,7 +15,7 @@
    2.13  @subtitle Yet Another tex-mode for emacs
    2.14  @title Wild Bird
    2.15  @subtitle // YaTeX //
    2.16 -@author @copyright{} 1991-1996 by    HIROSE, Yuuji [yuuji@@yatex.org]
    2.17 +@author @copyright{} 1991-2003 by    HIROSE, Yuuji [yuuji@@yatex.org]
    2.18  @end titlepage
    2.19  
    2.20  @node Top, What is YaTeX?, (dir), (dir)
    2.21 @@ -30,7 +30,7 @@
    2.22  * Main features::               What YaTeX can do
    2.23  * Installation::                Guide to install
    2.24  * Typesetting::                 Call typesetting processes
    2.25 -* %#notation::                  
    2.26 +* %#notation::                  Meta-keyword `%#'
    2.27  * Completion::                  Input LaTeX commands with completion
    2.28  * Local dictionaries::          Directory dependent completion
    2.29  * Commenting out::              Commenting/uncommenting text
    2.30 @@ -40,6 +40,7 @@
    2.31  * Updation of includeonly::     Free from maintaining includeonly
    2.32  * What column::                 Check what table-column the cursor belong
    2.33  * Intelligent newline::         Guess requisites of new line
    2.34 +* Usepackage checker::          Selecting correct \usepackage is YaTeX's job
    2.35  * Online help::                 On-line documentation of LaTeX
    2.36  * Browsing file hierarchy::     Walking through file hierarchy
    2.37  * Cooperation with other packages::  Work well with gmhist, min-out
    2.38 @@ -47,75 +48,6 @@
    2.39  * Etcetera::                    YaTeX is acquisitive.
    2.40  * Copying::                     Redistribution
    2.41  
    2.42 - --- The Detailed Node Listing ---
    2.43 -
    2.44 -Typesetting
    2.45 -
    2.46 -* Calling typesetter::          
    2.47 -* Calling previewer::           
    2.48 -* Printing out::                
    2.49 -
    2.50 -%# notation
    2.51 -
    2.52 -* Changing typesetter::         
    2.53 -* Static region for typesetting::  
    2.54 -* Lpr format::                  
    2.55 -* Editing %# notation::         
    2.56 -
    2.57 -Completion
    2.58 -
    2.59 -* Begin-type completion::       
    2.60 -* Section-type completion::     
    2.61 -* Large-type completion::       
    2.62 -* Maketitle-type completion::   
    2.63 -* Arbitrary completion::        
    2.64 -* End completion::              
    2.65 -* Accent completion::           
    2.66 -* Image completion::            
    2.67 -* Greek letters completion::    
    2.68 -
    2.69 -Section-type completion
    2.70 -
    2.71 -* view-sectioning::             
    2.72 -
    2.73 -Cursor jump
    2.74 -
    2.75 -* Jump to corresponding object::  
    2.76 -* Invoking image processor::    
    2.77 -* Jump to main file::           
    2.78 -* Jumping around the environment::  
    2.79 -* Jumping to last completion position::  
    2.80 -
    2.81 -Changing and Deleting
    2.82 -
    2.83 -* Changing LaTeX commands::     
    2.84 -* Killing LaTeX commands::      
    2.85 -
    2.86 -Customizations
    2.87 -
    2.88 -* Lisp variables::              
    2.89 -* Add-in functions::            
    2.90 -* Add-in generator::            
    2.91 -
    2.92 -Lisp variables
    2.93 -
    2.94 -* All customizable variables::  
    2.95 -* Sample definitions::          
    2.96 -* Hook variables::              
    2.97 -* Hook file::                   
    2.98 -
    2.99 -Procedure
   2.100 -
   2.101 -* How the add-in function works::  
   2.102 -* How the function is called::  
   2.103 -* Useful functions for creating add-in::  
   2.104 -* Contribution::                
   2.105 -
   2.106 -How the add-in function works
   2.107 -
   2.108 -* Defining option-add-in::      
   2.109 -* Defining argument-add-in::    
   2.110 -@end menu
   2.111  
   2.112  @node What is YaTeX?, Main features, Top, Top
   2.113  @comment  node-name,  next,  previous,  up
   2.114 @@ -1348,7 +1280,7 @@
   2.115  
   2.116  in the minibuffer.  Type @kbd{a} if you want to add the current file name
   2.117  to @code{\includeonly} list, @kbd{r} to replace \@code{includeonly} list
   2.118 -by the current file, and type @kbd{%} to comment out the
   2.119 +with the current file, and type @kbd{%} to comment out the
   2.120  @code{\includeonly} line.
   2.121  
   2.122  @node What column, Intelligent newline, Updation of includeonly, Top
   2.123 @@ -1389,7 +1321,7 @@
   2.124  virtual column  headers by  putting  them  in the  first line  and
   2.125  commenting that line with @code{%}.
   2.126  
   2.127 -@node Intelligent newline, Online help, What column, Top
   2.128 +@node Intelligent newline, Usepackage checker, What column, Top
   2.129  @comment  node-name,  next,  previous,  up
   2.130  @chapter Intelligent newline
   2.131  @cindex Intelligent newline
   2.132 @@ -1440,7 +1372,22 @@
   2.133  useful.  See the definition of the function
   2.134  @code{YaTeX-intelligent-newline-itemize} as an example.
   2.135  
   2.136 -@node Online help, Browsing file hierarchy, Intelligent newline, Top
   2.137 +@node Usepackage checker, Online help, Intelligent newline, Top
   2.138 +@comment  node-name,  next,  previous,  up
   2.139 +@chapter Usepackage checker
   2.140 +@cindex usepackage
   2.141 +
   2.142 +When you input begint-type, section-type, maketitle-type macros with
   2.143 +completion, and it requires some LaTeX2e package, YaTeX examines
   2.144 +the existence of correct @code{\usepackage}.  If not, YaTeX inserts
   2.145 +the @code{\usepackage@{@}} declaration corresponding to input macro.
   2.146 +
   2.147 +To activate the package completion for your favarite package,
   2.148 +set the variable @code{YaTeX-package-alist-private} correctly.
   2.149 +Please refere the value of @code{YaTeX-package-alist-default} as an
   2.150 +example.
   2.151 +
   2.152 +@node Online help, Browsing file hierarchy, Usepackage checker, Top
   2.153  @comment  node-name,  next,  previous,  up
   2.154  @chapter Online help
   2.155  @cindex online help
   2.156 @@ -1631,6 +1578,17 @@
   2.157  are to change some of these variables,  see more detailed documentation of
   2.158  the variable by @kbd{M-x describe-variable}.
   2.159  
   2.160 +@defvar YaTeX-japan
   2.161 +Set this nil to produce all messages in English
   2.162 +(@code{Depends on Japanese feature of Emacs})
   2.163 +@end defvar
   2.164 +
   2.165 +@defvar YaTeX-kanji-code
   2.166 +Default buffer-file-coding-system for YaTeX modes' buffer.
   2.167 +Set this 0 to no language conversion.  Nil to preserve original 
   2.168 +coding-system. (@code{1 or 2})
   2.169 +@end defvar
   2.170 +
   2.171  @defvar YaTeX-prefix
   2.172  Prefix key stroke (@kbd{C-c})
   2.173  @end defvar
   2.174 @@ -1831,6 +1789,28 @@
   2.175  (@code{(featurep 'hilit19)}
   2.176  @end defvar
   2.177  
   2.178 +@defvar YaTeX-singlecmd-suffix
   2.179 +Suffix which is always inserted after maketitle-type macros.
   2.180 +@code{"{}"} is recommended.
   2.181 +@end defvar
   2.182 +
   2.183 +@defvar YaTeX-package-alist-private
   2.184 +Alist of LaTeX2e-package name vs. lists of macros in it.
   2.185 +Set this alist properly and YaTeX automatically check the declaratiion of
   2.186 +`usepackage' for corresponding macro, when you input that macro with
   2.187 +completion.  If required `usepackage' is not found, YaTeX also
   2.188 +automatically inserts `\usepackage'.  Alist is as follows;
   2.189 +@lisp
   2.190 +   '((PackageName1
   2.191 +        (completionType ListOfMacro)
   2.192 +        (completionType ListOfMacro))
   2.193 +     (PackageName2
   2.194 +        (completionType ListOfMacro)
   2.195 +        (completionType ListOfMacro...))....)
   2.196 +@end lisp
   2.197 +completionType is one of @code{env, section, maketitle}.
   2.198 +Consult the value of @code{YaTeX-package-alist-default} as an example.
   2.199 +@end defvar
   2.200  
   2.201  @node Sample definitions, Hook variables, All customizable variables, Lisp variables
   2.202  @comment  node-name,  next,  previous,  up
   2.203 @@ -1919,7 +1899,18 @@
   2.204  @comment  node-name,  next,  previous,  up
   2.205  @subsection How the add-in function works
   2.206  
   2.207 -  There are two kinds of add-in.  @dfn{Option add-in} returns the
   2.208 +There are three types of add-in.
   2.209 +
   2.210 +@enumerate
   2.211 +@item
   2.212 +Option add-in
   2.213 +@item
   2.214 +argument add-in
   2.215 +@item
   2.216 +enclosing add-in
   2.217 +@end enumerate
   2.218 +
   2.219 +@dfn{Option add-in} returns the
   2.220  La@TeX{}'s optional parameters such as optional strings after
   2.221  @code{\begin@{ENV@}}, optional strings between a section-type command
   2.222  and its first argument, and optional strings just after type
   2.223 @@ -1952,9 +1943,33 @@
   2.224  command is being read.  Thus the add-in should determine the
   2.225  job referring the value of its argument.
   2.226  
   2.227 +  @dfn{enclosing add-in} is for modifying and/or checking the region that
   2.228 +will be enclosed by section-type commands via @kbd{[prefix] S}.  An
   2.229 +enclosing add-in function will be called with two arguments, beginning of
   2.230 +the enclosed region and end of the region.  Suppose you want to enclose
   2.231 +the existing text @code{(a+b)/c} by @code{\frac{}}.
   2.232 +
   2.233 +@display
   2.234 +a/c
   2.235 +|  |
   2.236 +A  B
   2.237 +@end display
   2.238 +
   2.239 +You do set-mark-command at point A and then move to point B.  Typing
   2.240 +@kbd{[prefix] S} and input @code{frac} enclose the region like this;
   2.241 +
   2.242 +@display
   2.243 +\frac{a/c}
   2.244 +@end display
   2.245 +
   2.246 +Normally, the expression @code{a/c} is translated to
   2.247 +@code{\frac@{a@}@{c@}}. An enclosing add-in is useful for modifying
   2.248 +@code{/} to @code{@}@{}.
   2.249 +
   2.250  @menu
   2.251  * Defining option-add-in::      
   2.252  * Defining argument-add-in::    
   2.253 +* Defining enclosing-add-in::   
   2.254  @end menu
   2.255  
   2.256  @node Defining option-add-in, Defining argument-add-in, How the add-in function works, How the add-in function works
   2.257 @@ -1984,7 +1999,7 @@
   2.258            (concat "@{" (read-string "Rule: ") "@}"))
   2.259  @end lisp
   2.260  
   2.261 -@node Defining argument-add-in,  , Defining option-add-in, How the add-in function works
   2.262 +@node Defining argument-add-in, Defining enclosing-add-in, Defining option-add-in, How the add-in function works
   2.263  @comment  node-name,  next,  previous,  up
   2.264  @subsubsection Defining `argument add-in'
   2.265  
   2.266 @@ -2007,6 +2022,29 @@
   2.267    Note that when the `argument add-in' function return `nil', normal
   2.268  argument reader will be called.
   2.269  
   2.270 +@node Defining enclosing-add-in,  , Defining argument-add-in, How the add-in function works
   2.271 +@comment  node-name,  next,  previous,  up
   2.272 +@subsubsection Defining `enclosing add-in'
   2.273 +
   2.274 +  This section describes how to define the add-in function for
   2.275 +text enclosed by @code{\frac@{@}}.
   2.276 +
   2.277 +  When enclosing the text @code{5/3} by @code{\frac@{@}}, you might want to
   2.278 +replace @code{/} with @code{@}@{}.  Enclosing function
   2.279 +@code{YaTeX::frac-region} is called with two arguments, beginning of
   2.280 +enclosed text and end of enclosed text.  The function is expected to
   2.281 +replace @code{/} with @code{@}@{}.  Here is an example expression.
   2.282 +
   2.283 +@lisp
   2.284 +(defun YaTeX::frac-region (beg end)
   2.285 +  (catch 'done
   2.286 +    (while (search-forward "/" end t)
   2.287 +      (goto-char (match-beginning 0))
   2.288 +      (if (y-or-n-p "Replace this slash(/) with `}{'")
   2.289 +	  (throw 'done (replace-match "}{")))
   2.290 +      (goto-char (match-end 0)))))
   2.291 +@end lisp
   2.292 +
   2.293  @node How the function is called, Useful functions for creating add-in, How the add-in function works, Add-in functions
   2.294  @comment  node-name,  next,  previous,  up
   2.295  @subsection How the function is called
   2.296 @@ -2282,7 +2320,7 @@
   2.297  as a result  of using this  software.   However, any  reports  and
   2.298  suggestions are  welcome as  long as I   feel  interests in   this
   2.299  software.   My possible  e-mail address is  `yuuji@@yatex.org'.
   2.300 -(up to Dec.2000 at least)  And there is mailing list for YaTeX.
   2.301 +(up to Sep.2003 at least)  And there is mailing list for YaTeX.
   2.302  Although the common language is Japanese, questions in English will be
   2.303  welcome.  To join the ML, send the mail whose subject is `append' to
   2.304  the address `yatex@@yatex.org.  If you have some
     3.1 --- a/docs/yatexj.tex	Fri May 02 11:23:59 2003 +0000
     3.2 +++ b/docs/yatexj.tex	Thu Dec 25 04:10:32 2003 +0000
     3.3 @@ -10,7 +10,7 @@
     3.4  @c ノードいじったら C-l C-u C-n 全部のノード更新 C-l C-u C-e
     3.5  @c メニュー増やしたら C-l C-u C-m 全部のメニュー更新 C-l C-u C-a
     3.6  @c フォーマットするときは C-l C-e C-b
     3.7 -@c Last modified Fri Feb  2 10:03:49 2001 on firestorm
     3.8 +@c Last modified Fri Aug 29 01:55:00 2003 on firestorm
     3.9  @syncodeindex vr cp
    3.10  @end iftex
    3.11  
    3.12 @@ -20,7 +20,7 @@
    3.13  @subtitle Yet Another tex-mode for emacs
    3.14  @title 『野鳥』
    3.15  @subtitle // YaTeX //
    3.16 -@author @copyright{} 1991-2000 by    HIROSE, Yuuji [yuuji@@yatex.org]
    3.17 +@author @copyright{} 1991-2003 by    HIROSE, Yuuji [yuuji@@yatex.org]
    3.18  @end titlepage
    3.19  
    3.20  @node Top, Intro, (dir), (dir)
    3.21 @@ -42,6 +42,7 @@
    3.22  * Includeonly::                 勝手に includeonly
    3.23  * What column::                 カラム位置ガイド
    3.24  * Intelligent newline::         おまかせ改行
    3.25 +* Usepackage cheker::           先回りusepackage
    3.26  * Changing mode of YaTeX::      野鳥動作モード変更
    3.27  * Online help::                 LaTeXオンラインヘルプ
    3.28  * Inclusion hierarchy browser::  ファイル分割階層構造の表示
    3.29 @@ -51,65 +52,6 @@
    3.30  * Copying::                     取り扱い
    3.31  * Concept Index::               索引
    3.32  
    3.33 - --- The Detailed Node Listing ---
    3.34 -
    3.35 -latexコマンド起動
    3.36 -
    3.37 -* Calling typesetter::          タイプセッタ起動
    3.38 -* Calling previewer::           プレヴューア起動
    3.39 -* Print out::                   プリントアウト用コマンドの起動
    3.40 -
    3.41 -%#記法
    3.42 -
    3.43 -* Changing typesetter::         タイプセット用コマンドの変更
    3.44 -* Splitting input files::       入力ファイル分割
    3.45 -* Fix region for typesetting::  領域の固定
    3.46 -* lpr format::                  プリントアウトコマンド用フォーマット
    3.47 -* Editing %# notation::         %#記法の編集
    3.48 -
    3.49 -補完入力
    3.50 -
    3.51 -* begin型補完::                 
    3.52 -* section型補完::               
    3.53 -* large型補完::                 
    3.54 -* maketitle型補完::             
    3.55 -* Arbitrary completion::        随時補完
    3.56 -* end補完::                     
    3.57 -* Accent mark completion::      アクセント記号補完
    3.58 -* Image completion::            数式記号イメージ補完
    3.59 -* Greek letter completion::     ギリシャ文字補完
    3.60 -
    3.61 -section型補完
    3.62 -
    3.63 -* 2個以上の引数をとる section型コマンド::  
    3.64 -* Enclose section-type command::  括り補完
    3.65 -* Recursive completion::        再帰補完
    3.66 -* view-sectioning::             セクション区切りのアウトライン表示
    3.67 -
    3.68 -カーソルジャンプ
    3.69 -
    3.70 -* 対応オブジェクトへのジャンプ::  
    3.71 -* お絵描きツール起動::          
    3.72 -* メインファイルへのジャンプ::  
    3.73 -* 環境を単位としたジャンプ::    
    3.74 -* 最後の補完位置へのジャンプ::  
    3.75 -
    3.76 -変更/削除
    3.77 -
    3.78 -* Changing LaTeX command::      La@TeX{} コマンドの変更
    3.79 -* Killing LaTeX command::       La@TeX{} コマンドの削除
    3.80 -
    3.81 -カスタマイズ
    3.82 -
    3.83 -* Lisp variables::              lisp 変数
    3.84 -* Add-in functions::            付加関数(アドイン関数)
    3.85 -
    3.86 -lisp 変数
    3.87 -
    3.88 -* All customizable variables::  カスタマイズ変数一覧
    3.89 -* Sample definitions::          カスタマイズ変数設定例
    3.90 -* Hook variables::              hook変数
    3.91 -* Hook file::                   hook用ファイル
    3.92  @end menu
    3.93  
    3.94  @node Intro, Terminology, Top, Top
    3.95 @@ -1566,7 +1508,7 @@
    3.96  す。もし項目名として別のものを表示して欲しい場合は、行頭を@code{%}にしてダ
    3.97  ミーの項目並びを作っておくと良いでしょう。
    3.98  
    3.99 -@node Intelligent newline, Changing mode of YaTeX, What column, Top
   3.100 +@node Intelligent newline, Usepackage cheker, What column, Top
   3.101  @comment  node-name,  next,  previous,  up
   3.102  @chapter おまかせ改行
   3.103  @cindex おまかせ改行[おまかせかいきよう]
   3.104 @@ -1612,7 +1554,22 @@
   3.105  いでしょう。@file{yatexenv.el}内の関数 
   3.106  @code{YaTeX-intelligent-newline-itemize} の定義などを参考にしてください。
   3.107  
   3.108 -@node Changing mode of YaTeX, Online help, Intelligent newline, Top
   3.109 +@node Usepackage cheker, Changing mode of YaTeX, Intelligent newline, Top
   3.110 +@comment  node-name,  next,  previous,  up
   3.111 +@chapter 先回りusepackage
   3.112 +@cindex 先回りusepackage[さきまわり]
   3.113 +
   3.114 +  begin型、section型、maketitle型、いずれかのLaTeX2eマクロを補完入力すると、
   3.115 +そのマクロの利用に外部パッケージを必要とする場合、そのパッケージを
   3.116 +本文中で @code{\usepackage@{@}} しているかどうかを調査し、もししていなければ
   3.117 +プリアンブルに対応するパッケージを引数にした @code{\usepackage} 文を
   3.118 +(確認後に)挿入します。
   3.119 +
   3.120 +  ただしこの機能が働くためには、パッケージ名とその中で定義されているマクロ
   3.121 +群をalistの形式で変数 @code{YaTeX-package-alist-private} に設定しておく必
   3.122 +要があります。
   3.123 +
   3.124 +@node Changing mode of YaTeX, Online help, Usepackage cheker, Top
   3.125  @comment  node-name,  next,  previous,  up
   3.126  @chapter 野鳥の動作モード切り替え
   3.127  @cindex モード切り替え[もうときりかえ]
   3.128 @@ -1841,7 +1798,9 @@
   3.129  @end defvar
   3.130  
   3.131  @defvar YaTeX-kanji-code
   3.132 -文書を作成する時の漢字コード 1=Shift JIS, 2=JIS, 3=EUC (2 (MS-DOSでは1))
   3.133 +文書を作成する時の漢字コード
   3.134 +nil=既存のコードのまま 0=no-conversion1=Shift JIS,
   3.135 +2=JIS, 3=EUC (2 (MS-DOSでは1))
   3.136  @end defvar
   3.137  
   3.138  @defvar tex-command
   3.139 @@ -2034,6 +1993,30 @@
   3.140  (@code{(featurep 'hilit19)}
   3.141  @end defvar
   3.142  
   3.143 +@defvar YaTeX-singlecmd-suffix
   3.144 +全てのmaketitle型コマンドの補完入力直後に挿入する文字列。
   3.145 +@code{"{}"} などがお勧め。
   3.146 +@end defvar
   3.147 +
   3.148 +@defvar YaTeX-package-alist-private
   3.149 +LaTeX2eのパッケージ名とその中に含まれるマクロのリスト。
   3.150 +適切に設定しておくと本文入力時にマクロを補完入力すると
   3.151 +そのマクロに必要なパッケージを usepackage するか自動的に検査してくれる。
   3.152 +していなければ \usepackage を自動追加することもできる。
   3.153 +リストは 
   3.154 +@lisp
   3.155 +   '((パッケージ名1
   3.156 +        (補完タイプ マクロのリスト……)
   3.157 +        (補完タイプ マクロのリスト……))
   3.158 +     (パッケージ名2
   3.159 +        (補完タイプ マクロのリスト……)
   3.160 +        (補完タイプ マクロのリスト……))………)
   3.161 +@end lisp
   3.162 +という形式にする。補完タイプは @code{env, section, maketitle} のどれか。
   3.163 +具体例は変数 @code{YaTeX-package-alist-default}
   3.164 +の値参照。
   3.165 +@end defvar
   3.166 +
   3.167  @node Sample definitions, Hook variables, All customizable variables, Lisp variables
   3.168  @comment  node-name,  next,  previous,  up
   3.169  @subsection カスタマイズ変数設定例
   3.170 @@ -2125,7 +2108,7 @@
   3.171  ただくと、作者は喜んでサポートに励むことでしょう。
   3.172  
   3.173    苦情、希望、バグ報告、感想等は歓迎いたします。
   3.174 -連絡は yuuji@@yatex.org まで(2000年12月現在)。
   3.175 +連絡は yuuji@@yatex.org まで(2003年9月現在)。
   3.176  継続的に使用してくださる方はメイリングリスト「fj野鳥の会」に
   3.177  是非加入してください。加入方法については本パッケージの @file{docs/qanda}
   3.178  ファイルの「その他」の章を御覧ください。
     4.1 --- a/help/YATEXHLP.eng	Fri May 02 11:23:59 2003 +0000
     4.2 +++ b/help/YATEXHLP.eng	Thu Dec 25 04:10:32 2003 +0000
     4.3 @@ -1299,6 +1299,166 @@
     4.4  Begin a new page and create the parbox-ed BOX whose width is \textwidth.
     4.5  This is useful to make a page-acrossing title in a twocolumn page.
     4.6  
     4.7 +breakbox
     4.8 +\begin{breakbox} ... \end{breakbox}
     4.9 +Make a surrounding frame extended across pages.
    4.10 +Useful for cite a long program list.
    4.11 +Requires `\usepackage{eclbkbox}'
    4.12 +
    4.13 +verbfile
    4.14 +\verbfile{FILE}
    4.15 +Include a FILE in verbatim format.
    4.16 +Requires `\usepackage{misc}'
    4.17 +See also \listing
    4.18 +
    4.19 +listing
    4.20 +\listing{FILE}
    4.21 +Include a FILE in verbatim format with line number.
    4.22 +Requires `\usepackage{misc}'
    4.23 +See also \verbfile
    4.24 +
    4.25 +ascmac
    4.26 +\usepackage{ascmac}
    4.27 +The `ascmac' package provides
    4.28 +* \boxnote environment		notebook-like box
    4.29 +* \screen environment		corner-rounded box suitable for screen output
    4.30 +* \itembox environment		itemizing box
    4.31 +* \shadebox environment		shaded box
    4.32 +* \keytop macro			keytop
    4.33 +* \yen				Yen mark
    4.34 +* \return-key
    4.35 +* \mask, \maskbox
    4.36 +
    4.37 +boxnote
    4.38 +\begin{boxnote} ... \end{boxnote}
    4.39 +Enclose with notebook-like square.
    4.40 +Defined in ascmac.sty.
    4.41 +
    4.42 +<refer ascmac>
    4.43 +
    4.44 +screen
    4.45 +\begin{screen} ... \end{screen}
    4.46 +Enclose with corner-rounded square which stands for screen output.
    4.47 +Requires `\usepackage{ascmac}'
    4.48 +
    4.49 +<refere ascmac>
    4.50 +
    4.51 +itembox
    4.52 +\begin{itembox}{ITEMSTRING} ... \end{itembox}
    4.53 +Enclose box with ITEMSTRING header.
    4.54 +Requires `\usepackage{ascmac}'
    4.55 +<refere ascmac>
    4.56 +
    4.57 +shadebox
    4.58 +\begin{shadebox} ... \end{shadebox}
    4.59 +Enclose shaded box.
    4.60 +Requires `\usepackage{ascmac}'
    4.61 +<refere ascmac>
    4.62 +
    4.63 +keytop
    4.64 +\keytop{KEY}
    4.65 +Output a keytop designed character.
    4.66 +Requires `\usepackage{ascmac}'
    4.67 +<refere ascmac>
    4.68 +
    4.69 +mask
    4.70 +\mask{STRING}{MASKTYPE}
    4.71 +Make a masked STRING.  MASKTYPE is one of character A through K.
    4.72 +
    4.73 +eg.) \mask{This is a pen!}{C}
    4.74 +
    4.75 +Mask types are viewed at
    4.76 +http://www.yatex.org/help/ascmac-mask.jpg
    4.77 +
    4.78 +Defined in `\usepackage{ascmac}'
    4.79 +
    4.80 +<refere ascmac>
    4.81 +
    4.82 +maskbox
    4.83 +\maskbox{WIDTH}{HEIGHT}{MASKTYPE}{POS}{STRING}
    4.84 +Make a masked box of WIDTH x HEIGHT which contains STRING located in POS.
    4.85 +Masking type MASKTYPE is one of character A through K.
    4.86 +
    4.87 +eg.) \maskbox{5cm}{2.5em}{G}{c}{Year!}
    4.88 +
    4.89 +Mask types are viewed at
    4.90 +http://www.yatex.org/help/ascmac-mask.jpg
    4.91 +
    4.92 +Requires `\usepackage{ascmac}'
    4.93 +<refere ascmac>
    4.94 +
    4.95 +alltt
    4.96 +\begin{alltt} ... \end{alltt}
    4.97 +An environment like verbatim except in which TeX macro can be used.
    4.98 +
    4.99 +comment
   4.100 +\begin{comment} ... \end{comment}
   4.101 +Comment out enclosed environment.
   4.102 +But if \includeversion{comment} appears, enclosed part activated.
   4.103 +Putting \excludeversion{ENV} defines new environment ENV which
   4.104 +works equivalently to comment environment.
   4.105 +
   4.106 +Requires `\usepackage{version}'
   4.107 +
   4.108 +bou
   4.109 +\bou{STRING}
   4.110 +Put the emphasizing dot on each characters in STRING.
   4.111 +
   4.112 +Requires `\usepackage{plext}'
   4.113 +
   4.114 +url
   4.115 +\url{URL_STRING}
   4.116 +Put URL string with reasonable folding.
   4.117 +
   4.118 +Requires `\usepackage{url}'
   4.119 +
   4.120 +longtable
   4.121 +\begin{longtable}{POSSTRING} ... \end{longtable}
   4.122 +Same as table, but can be spreaded across pages.
   4.123 +
   4.124 +Requires `\usepackage{longtable}'
   4.125 +
   4.126 +fancybox
   4.127 +\usepackage{fancybox}
   4.128 +Provides some fancy boxes.
   4.129 +* \shadowbox{}
   4.130 +* \ovalbox{}
   4.131 +* \doublebox{}
   4.132 +
   4.133 +shadowbox
   4.134 +\shadowbox{STRING}
   4.135 +Surround a STRING by shadow box.
   4.136 +
   4.137 +Require `\usepackage{fancybox}`
   4.138 +
   4.139 +<ref fancybox>
   4.140 +
   4.141 +ovalbox
   4.142 +\ovalbox{STRING}
   4.143 +Surround a STRING by oval box
   4.144 +
   4.145 +Require `\usepackage{fancybox}`
   4.146 +
   4.147 +<ref fancybox>
   4.148 +
   4.149 +Ovalbox
   4.150 +\Ovalbox{STRING}
   4.151 +Surround a STRING by thick oval box.
   4.152 +
   4.153 +Require `\usepackage{fancybox}`
   4.154 +
   4.155 +<ref fancybox>
   4.156 +
   4.157 +doublebox
   4.158 +\doublebox{STRING}
   4.159 +Surround a STRING by double frame.
   4.160 +
   4.161 +Require `\usepackage{fancybox}`
   4.162 +
   4.163 +<ref fancybox>
   4.164 +
   4.165 +
   4.166 +
   4.167  YaTeX
   4.168  (setq auto-mode-alist (cons '("\\.tex$" . yatex-mode) auto-mode-alist))
   4.169  The mode you are probably using now.
     5.1 --- a/help/YATEXHLP.jp	Fri May 02 11:23:59 2003 +0000
     5.2 +++ b/help/YATEXHLP.jp	Thu Dec 25 04:10:32 2003 +0000
     5.3 @@ -1,7 +1,11 @@
     5.4  %%%
     5.5  %%% 野鳥-LaTeXヘルプファイル(c)HIROSE Yuuji [yuuji@yatex.org]
     5.6 -%%% 機械的に変換して野鳥以外のデバイスで利用することを許可します。
     5.7 -%%% その際にコピーライト表示と含まれている項目を削除しないでください。
     5.8 +%%% このヘルプファイルを野鳥以外のデバイスで利用することを許可します。
     5.9 +%%% 項目の修正や追加は自由に行なって構いませんが、そのことを
    5.10 +%%% 知らせて頂けるとありがたいです。
    5.11 +%%% 他のデバイスで利用する場合でも先頭のコピーライト表示と、末尾に含まれる
    5.12 +%%% LaiTeX, laitex, YaTeX, yatex の各項目は(このヘルプファイルについての
    5.13 +%%% 著作権表記と謝辞が含まれているので)削除しないでください。
    5.14  %%%
    5.15  
    5.16  textfloatsep
    5.17 @@ -1234,6 +1238,169 @@
    5.18  新しいページを開始し、\textwidthのBOXをparboxで作成する。
    5.19  二段組みページでぶち抜きタイトルを作成する時に用いるとよい。
    5.20  
    5.21 +breakbox
    5.22 +\begin{breakbox} ... \end{breakbox}
    5.23 +ページをまたがる枠で囲む
    5.24 +要 `\usepackage{eclbkbox}'
    5.25 +
    5.26 +verbfile
    5.27 +\verbfile{FILE}
    5.28 +FILE を verbatim 環境的に取り込む。
    5.29 +要 `\usepackage{misc}'
    5.30 +cf) \listing
    5.31 +
    5.32 +listing
    5.33 +\listing{FILE}
    5.34 +FILE を verbatim 環境的に取り込む(行番号つき)。
    5.35 +要 `\usepackage{misc}'
    5.36 +cf) \verbfile
    5.37 +
    5.38 +ascmac
    5.39 +\usepackage{ascmac}
    5.40 +`ascmac' パッケージで定義されている代表的なマクロ
    5.41 +* \boxnote 環境			帳面風のボックス
    5.42 +* \screen 環境			スクリーン出力風の枠
    5.43 +* \itembox 環境			目立つ枠
    5.44 +* \shadebox 環境		影つきボックス
    5.45 +* \keytop{} 			キートップ
    5.46 +* \yen				円記号
    5.47 +* \return-key			リターンキー
    5.48 +* \mask, \maskbox		網掛け文字
    5.49 +
    5.50 +boxnote
    5.51 +\begin{boxnote} ... \end{boxnote}
    5.52 +帳面風の枠で囲む
    5.53 +要 ascmac.sty
    5.54 +
    5.55 +<refer ascmac>
    5.56 +
    5.57 +screen
    5.58 +\begin{screen} ... \end{screen}
    5.59 +スクリーン出力風の枠で囲む
    5.60 +要 `\usepackage{ascmac}'
    5.61 +
    5.62 +<refere ascmac>
    5.63 +
    5.64 +itembox
    5.65 +\begin{itembox}{ITEMSTRING} ... \end{itembox}
    5.66 +見出し(ITEMSTRING)つきの枠で囲む
    5.67 +要 `\usepackage{ascmac}'
    5.68 +<refere ascmac>
    5.69 +
    5.70 +shadebox
    5.71 +\begin{shadebox} ... \end{shadebox}
    5.72 +行幅いっぱいの影つきの枠で囲む
    5.73 +要 `\usepackage{ascmac}'
    5.74 +<refere ascmac>
    5.75 +
    5.76 +keytop
    5.77 +\keytop{KEY}
    5.78 +キートップ風に KEY を出力
    5.79 +要 `\usepackage{ascmac}'
    5.80 +<refere ascmac>
    5.81 +
    5.82 +mask
    5.83 +\mask{文字列}{網掛けタイプ}
    5.84 +「文字列」を指定した網掛けタイプで装飾する。
    5.85 +網掛けタイプは A〜K のどれか。
    5.86 +
    5.87 +例) \mask{御食事券発覚!}{C}
    5.88 +
    5.89 +どんな見映えかは以下を見よ。
    5.90 +http://www.yatex.org/help/ascmac-mask.jpg
    5.91 +
    5.92 +要 `\usepackage{ascmac}'
    5.93 +
    5.94 +<refere ascmac>
    5.95 +
    5.96 +maskbox
    5.97 +\maskbox{WIDTH}{HEIGHT}{MASKTYPE}{POS}{STRING}
    5.98 +指定した幅(WIDTH)と高さ(HEIGHT)で指定した網掛けタイプ(MASKTYPE)
    5.99 +のボックスを作り、その中の指定した位置(POS)にSTRINGを配置する。
   5.100 +POSは l c rのどれかで、それぞれ、左寄せ、中央寄せ、右寄せ。
   5.101 +
   5.102 +網掛けタイプは A〜K のどれか。
   5.103 +
   5.104 +例) \maskbox{0.7\columnwidth}{6em}{A}{c}{\shortstack{これは\\大事件だ!}}
   5.105 +
   5.106 +マスクタイプA〜Kがどんな見映えかは以下を見よ。
   5.107 +http://www.yatex.org/help/ascmac-mask.jpg
   5.108 +
   5.109 +要 `\usepackage{ascmac}'
   5.110 +<refere ascmac>
   5.111 +
   5.112 +alltt
   5.113 +\begin{alltt} ... \end{alltt}
   5.114 +TeXマクロの使えるverbitam環境。
   5.115 +
   5.116 +comment
   5.117 +\begin{comment} ... \end{comment}
   5.118 +環境内の全てを出力しないようにする。
   5.119 +ただし、 \includeversion{comment} と書くと環境を出力するようになる。
   5.120 +また \excludeversion{ENV} とすると新しい環境 ENV が
   5.121 +comment 環境 と同じ機能を持つものとして使えるようになる。
   5.122 +
   5.123 +要 `\usepackage{version}'
   5.124 +
   5.125 +bou
   5.126 +\bou{STRING}
   5.127 +横書き環境で STRING に傍点を付ける。
   5.128 +
   5.129 +要 `\usepackage{plext}'
   5.130 +
   5.131 +url
   5.132 +\url{URL_STRING}
   5.133 +overfullしがちなURLを頑張って折り返してくれる。
   5.134 +
   5.135 +要 `\usepackage{url}'
   5.136 +
   5.137 +longtable
   5.138 +\begin{longtable}{POSSTRING} ... \end{longtable}
   5.139 +ページをまたぐ表が作れる。
   5.140 +
   5.141 +table環境も参照せよ。
   5.142 +
   5.143 +fancybox
   5.144 +\usepackage{fancybox}
   5.145 +各種の見栄えの良いボックスが定義されている。
   5.146 +
   5.147 +* \shadowbox{}
   5.148 +* \ovalbox{}
   5.149 +* \doublebox{}
   5.150 +
   5.151 +shadowbox
   5.152 +\shadowbox{STRING}
   5.153 +STRINGをその幅で影つきボックスで囲む。
   5.154 +
   5.155 +要 `\usepackage{fancybox}`
   5.156 +
   5.157 +<ref fancybox>
   5.158 +
   5.159 +ovalbox
   5.160 +\ovalbox{STRING}
   5.161 +角の丸い四角枠で STRING を囲む。
   5.162 +
   5.163 +要 `\usepackage{fancybox}`
   5.164 +
   5.165 +<ref fancybox>
   5.166 +
   5.167 +Ovalbox
   5.168 +\Ovalbox{STRING}
   5.169 +角の丸い四角枠で STRING を囲む。ovalboxより線が太い。
   5.170 +
   5.171 +要 `\usepackage{fancybox}`
   5.172 +
   5.173 +<ref fancybox>
   5.174 +
   5.175 +doublebox
   5.176 +\doublebox{STRING}
   5.177 +二重四角枠で STRING を囲む。
   5.178 +
   5.179 +要 `\usepackage{fancybox}`
   5.180 +
   5.181 +<ref fancybox>
   5.182 +
   5.183 +
   5.184  LaiTeX
   5.185  a Little Assistant Interface for TeX on Vz
   5.186  おそらくあなたが今 Vz 上で使っているこのモード。
   5.187 @@ -1320,8 +1487,8 @@
   5.188  	たれました。享年二十六歳。彼には、野鳥だけでなく私が手掛けた数多
   5.189  	くのソフトウェアを作る動機、センスあふれるコメントなどを頂きまし
   5.190  	た。現在の野鳥が皆様に支持されるように健やかに育ったのは彼のおか
   5.191 -	げと言っても過言ではありません。野鳥/雷鳥/白鳥/飛鳥を使うときに
   5.192 -	彼の安らかな眠りを私と共に祈って下さい。
   5.193 +	げと言っても過言ではありません。野鳥/雷鳥/白鳥/飛鳥/花鳥を使うと
   5.194 +	きに彼の安らかな眠りを私と共に祈って下さい。
   5.195  
   5.196  るねきちさん(asciinet)
   5.197  	占い師だそうです。
     6.1 --- a/yahtml.el	Fri May 02 11:23:59 2003 +0000
     6.2 +++ b/yahtml.el	Thu Dec 25 04:10:32 2003 +0000
     6.3 @@ -1,6 +1,6 @@
     6.4  ;;; -*- Emacs-Lisp -*-
     6.5 -;;; (c ) 1994-2002 by HIROSE Yuuji [yuuji@yatex.org]
     6.6 -;;; Last modified Thu Nov 21 17:55:40 2002 on firestorm
     6.7 +;;; (c) 1994-2003 by HIROSE Yuuji [yuuji@yatex.org]
     6.8 +;;; Last modified Mon Nov 17 18:28:50 2003 on firestorm
     6.9  ;;; $Id$
    6.10  
    6.11  (defconst yahtml-revision-number "1.70"
    6.12 @@ -202,9 +202,7 @@
    6.13  (defvar yahtml-environment-indent 1
    6.14    "*Indentation depth of HTML's listing environment")
    6.15  
    6.16 -(defvar YaTeX-japan (or (boundp 'NEMACS) (boundp 'MULE) YaTeX-emacs-20)
    6.17 -  "Whether yatex mode is running on Japanese environment or not.")
    6.18 -
    6.19 +;; YaTeX-japan is defined in yatexlib.el
    6.20  (defvar yahtml-lint-program (if YaTeX-japan "jweblint" "weblint")
    6.21    "*Program name to lint HTML file")
    6.22  (defvar yahtml-hate-too-deep-indentation nil
    6.23 @@ -345,6 +343,9 @@
    6.24        (yahtml-define-begend-key "ba" "a" map)
    6.25        (yahtml-define-begend-key "bf" "form" map)
    6.26        (yahtml-define-begend-key "bs" "select" map)
    6.27 +      (yahtml-define-begend-key "bv" "div" map)
    6.28 +      (yahtml-define-begend-key "bS" "div" map)
    6.29 +      (yahtml-define-begend-key "bp" "pre" map)
    6.30        (YaTeX-define-key "b " 'yahtml-insert-begend map)
    6.31        (YaTeX-define-key "B " 'yahtml-insert-begend-region map)
    6.32        )
    6.33 @@ -571,6 +572,7 @@
    6.34  	(set (make-local-variable 'yahtml-mode-old-mode) old-mm)))
    6.35    (let ((coding (or (yahtml-dir-default-charset) yahtml-kanji-code)))
    6.36      (cond
    6.37 +     ((null coding) nil)
    6.38       ((and YaTeX-emacs-20 (boundp 'buffer-file-coding-system))
    6.39        (setq buffer-file-coding-system
    6.40  	    (or (and (fboundp 'set-auto-coding) buffer-file-name
     7.1 --- a/yatex.el	Fri May 02 11:23:59 2003 +0000
     7.2 +++ b/yatex.el	Thu Dec 25 04:10:32 2003 +0000
     7.3 @@ -1,30 +1,15 @@
     7.4  ;;; -*- Emacs-Lisp -*-
     7.5  ;;; Yet Another tex-mode for emacs - //野鳥//
     7.6 -;;; yatex.el rev. 1.71
     7.7 -;;; (c )1991-2003 by HIROSE Yuuji.[yuuji@yatex.org]
     7.8 -;;; Last modified Thu May  1 22:36:40 2003 on firestorm
     7.9 +;;; yatex.el rev. 1.72
    7.10 +;;; (c)1991-2003 by HIROSE Yuuji.[yuuji@yatex.org]
    7.11 +;;; Last modified Thu Dec 25 13:10:42 2003 on firestorm
    7.12  ;;; $Id$
    7.13  ;;; The latest version of this software is always available at;
    7.14  ;;; http://www.yatex.org/
    7.15  
    7.16 -;; This program is free software; you can redistribute it and/or modify
    7.17 -;; it under the terms of the GNU General Public License as published by
    7.18 -;; the Free Software Foundation; either version 2, or (at your option)
    7.19 -;; any later version.
    7.20 -
    7.21 -;; This program is distributed in the hope that it will be useful,
    7.22 -;; but WITHOUT ANY WARRANTY; without even the implied warranty of
    7.23 -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    7.24 -;; GNU General Public License for more details.
    7.25 -
    7.26 -;; You should have received a copy of the GNU General Public License
    7.27 -;; along with this program; see the file COPYING.  If not, write to the
    7.28 -;; Software Foundation Inc., 59 Temple Place - Suite 330, Boston, MA
    7.29 -;; 02111-1307, USA.
    7.30 -
    7.31  (require 'comment)
    7.32  (require 'yatexlib)
    7.33 -(defconst YaTeX-revision-number "1.71"
    7.34 +(defconst YaTeX-revision-number "1.72"
    7.35    "Revision number of running yatex.el")
    7.36  
    7.37  ;---------- Local variables ----------
    7.38 @@ -276,6 +261,7 @@
    7.39       ("widetilde") ("widehat") ("overline") ("overrightarrow")
    7.40       ;; section types in mathmode
    7.41       ("frac" 2) ("sqrt") ("mathrm") ("mathbf") ("mathit")
    7.42 +
    7.43       )
    7.44     (if YaTeX-use-LaTeX2e
    7.45         '(("documentclass") ("usepackage")
    7.46 @@ -287,6 +273,13 @@
    7.47  	 ("rotatebox" 2) ("resizebox" 2) ("reflectbox")
    7.48  	 ("colorbox" 2) ("fcolorbox" 3) ("textcolor" 2) ("color")
    7.49  	 ("includegraphics") ("includegraphics*")
    7.50 +	 ("bou")			;defined in plext
    7.51 +	 ("url")			;defined in url
    7.52 +	 ("shadowbox") ("doublebox") ("ovalbox") ("Ovalbox")
    7.53 +	 ("fancyoval")			;defined in fancybox
    7.54 +	 ("keytop") ("mask" 2) ("maskbox" 5) ;defined in ascmac
    7.55 +	 ("bm")				;deined in bm
    7.56 +	 ("verbfile") ("listing")	;defined in misc
    7.57  	 )))
    7.58    "Default completion table for section-type completion.")
    7.59  
    7.60 @@ -295,14 +288,21 @@
    7.61  
    7.62  ; Set tex-environment possible completion
    7.63  (defvar env-table
    7.64 -  '(("quote") ("quotation") ("center") ("verse") ("document")
    7.65 -    ("verbatim") ("itemize") ("enumerate") ("description")
    7.66 -    ("list") ("tabular") ("tabular*") ("table") ("tabbing") ("titlepage")
    7.67 -    ("sloppypar") ("picture") ("displaymath")
    7.68 -    ("eqnarray") ("figure") ("equation") ("abstract") ("array")
    7.69 -    ("thebibliography") ("theindex") ("flushleft") ("flushright")
    7.70 -    ("minipage")
    7.71 -    )
    7.72 +  (append
    7.73 +   '(("quote") ("quotation") ("center") ("verse") ("document")
    7.74 +     ("verbatim") ("itemize") ("enumerate") ("description")
    7.75 +     ("list") ("tabular") ("tabular*") ("table") ("tabbing") ("titlepage")
    7.76 +     ("sloppypar") ("picture") ("displaymath")
    7.77 +     ("eqnarray") ("figure") ("equation") ("abstract") ("array")
    7.78 +     ("thebibliography") ("theindex") ("flushleft") ("flushright")
    7.79 +     ("minipage")
    7.80 +     )
    7.81 +   (if YaTeX-use-LaTeX2e
    7.82 +       '(("comment")			;defined in version
    7.83 +	 ("longtable")			;defined in longtable
    7.84 +	 ("screen") ("boxnote") ("shadebox") ("itembox") ;in ascmac
    7.85 +	 ("alltt")			;defined in alltt
    7.86 +	 ("breakbox"))))			;defined in eclbkbox
    7.87    "Default completion table for begin-type completion.")
    7.88  
    7.89  (defvar user-env-table nil)
    7.90 @@ -352,7 +352,9 @@
    7.91  	 ("varpi") ("rho") ("varrho") ("sigma") ("varsigma") ("tau")
    7.92  	 ("upsilon") ("phi") ("varphi") ("chi") ("psi") ("omega")
    7.93  	 ("Gamma") ("Delta") ("Theta") ("Lambda")("Xi") ("Pi")
    7.94 -	 ("Sigma") ("Upsilon") ("Phi") ("Psi") ("Omega"))))
    7.95 +	 ("Sigma") ("Upsilon") ("Phi") ("Psi") ("Omega")))
    7.96 +   (if YaTeX-use-LaTeX2e
    7.97 +       '(("return") ("Return") ("yen"))))	;defined in ascmac
    7.98    "Default completion table for maketitle-type completion.")
    7.99  
   7.100  (defvar user-singlecmd-table nil)
   7.101 @@ -506,7 +508,12 @@
   7.102  (defvar YaTeX-fontsize-name "large" "*Initial fontsize completion")
   7.103  (defvar YaTeX-single-command "maketitle" "*Initial LaTeX single command")
   7.104  (defvar YaTeX-kanji-code (if YaTeX-dos 1 2)
   7.105 -  "*File kanji code used by Japanese TeX.")
   7.106 +  "*File kanji code used by Japanese TeX.
   7.107 +nil: Do not care (Preserve coding-system)
   7.108 +0: no-converion (mule)
   7.109 +1: Shift JIS
   7.110 +2: JIS
   7.111 +3: EUC")
   7.112  
   7.113  (defvar YaTeX-coding-system nil "File coding system used by Japanese TeX.")
   7.114  (cond
   7.115 @@ -515,9 +522,7 @@
   7.116  	(cdr (assoc YaTeX-kanji-code YaTeX-kanji-code-alist))))
   7.117   ((boundp 'MULE)
   7.118    (setq YaTeX-coding-system
   7.119 -	(symbol-value (cdr (assoc YaTeX-kanji-code YaTeX-kanji-code-alist)))))
   7.120 - ((boundp 'NEMACS)
   7.121 -  (setq YaTeX-latex-message-code latex-message-kanji-code)))
   7.122 +	(symbol-value (cdr (assoc YaTeX-kanji-code YaTeX-kanji-code-alist))))))
   7.123  
   7.124  (defvar YaTeX-mode-syntax-table nil
   7.125    "*Syntax table for yatex-mode")
   7.126 @@ -610,7 +615,9 @@
   7.127  	    YaTeX-math-mode indent-line-function comment-line-break-function
   7.128  	    comment-start comment-start-skip
   7.129  	    ))
   7.130 -  (cond ((boundp 'MULE)
   7.131 +  (cond ((null YaTeX-kanji-code)
   7.132 +	 nil)
   7.133 +	((boundp 'MULE)
   7.134  	 (set-file-coding-system  YaTeX-coding-system))
   7.135  	((and YaTeX-emacs-20 (boundp 'buffer-file-coding-system))
   7.136  	 (setq buffer-file-coding-system
   7.137 @@ -729,6 +736,8 @@
   7.138  (autoload 'YaTeX-display-hierarchy-directly "yatexhie"
   7.139    "Same as YaTeX-display-hierarchy.  Call from mouse." t)
   7.140  
   7.141 +;;autoload from yatexpkg.el
   7.142 +(autoload 'YaTeX-package-auto-usepackage "yatexpkg" "Auto \\usepackage" t)
   7.143  
   7.144  ;;;
   7.145  ;; YaTeX-mode functions
   7.146 @@ -780,6 +789,7 @@
   7.147        (goto-char beg2)
   7.148        (YaTeX-intelligent-newline nil)
   7.149        (YaTeX-indent-line))
   7.150 +    (YaTeX-package-auto-usepackage env 'env)
   7.151      (if YaTeX-current-position-register
   7.152  	(point-to-register YaTeX-current-position-register))))
   7.153  
   7.154 @@ -813,7 +823,9 @@
   7.155  	(cond
   7.156  	 ((save-excursion (not (search-backward YaTeX-ec nil t)))
   7.157  	  (if YaTeX-use-LaTeX2e "documentclass" "documentstyle"))
   7.158 -	 ((progn (forward-char -1) (looking-at "表\\|図\\|式"))
   7.159 +	 ((progn
   7.160 +	    (if (= (char-after (1- (point))) ?~) (forward-char -1))
   7.161 +	    (forward-char -1) (looking-at "表\\|図\\|式"))
   7.162  	  "ref")
   7.163  	 ((and (looking-at "[a-z \t]")
   7.164  	       (progn (skip-chars-backward "a-z \t")
   7.165 @@ -886,12 +898,15 @@
   7.166  	   (enable-recursive-minibuffers t));;let
   7.167  	(setq YaTeX-section-name section)
   7.168  	(if beg
   7.169 -	    (let ((e (make-marker)))
   7.170 +	    (let*((e (make-marker))
   7.171 +		  (ar2 (intern-soft (concat "YaTeX::" section "-region")))
   7.172 +		  (arp (and ar2 (fboundp ar2))))
   7.173  	      (goto-char end)
   7.174  	      (insert "}")
   7.175  	      (set-marker e (point))
   7.176  	      (goto-char beg)
   7.177  	      (insert YaTeX-ec YaTeX-section-name "{")
   7.178 +	      (if arp (funcall ar2 (point) e))
   7.179  	      (goto-char e)
   7.180  	      (set-marker e nil))
   7.181  	  (use-global-map YaTeX-recursive-map)
   7.182 @@ -918,7 +933,8 @@
   7.183  	(if (string= (buffer-substring (- (point) 2) (point)) "{}")
   7.184  	  (forward-char -1))
   7.185  	(while (string= (buffer-substring (- (point) 3) (1- (point))) "{}")
   7.186 -	  (forward-char -2)))
   7.187 +	  (forward-char -2))
   7.188 +	(YaTeX-package-auto-usepackage section 'section))
   7.189      (if (<= (minibuffer-depth) 0) (use-global-map global-map))
   7.190      (insert "")))		;insert dummy string to fontify(Emacs20)
   7.191  
   7.192 @@ -967,7 +983,8 @@
   7.193        (if YaTeX-current-position-register
   7.194  	  (point-to-register YaTeX-current-position-register))
   7.195        (save-excursion
   7.196 -	(insert (YaTeX-addin YaTeX-fontsize-name))))))
   7.197 +	(insert (YaTeX-addin YaTeX-fontsize-name)))
   7.198 +      (YaTeX-package-auto-usepackage YaTeX-fontsize-name 'large))))
   7.199  
   7.200  (defun YaTeX-make-fontsize-region ()
   7.201    "Call function:YaTeX-make-fontsize with ARG to specify region mode."
   7.202 @@ -1003,6 +1020,7 @@
   7.203      (goto-char p)
   7.204      (forward-char -2)
   7.205      (if (looking-at "\\[\\]") (forward-char 1) (goto-char q)))
   7.206 +  (YaTeX-package-auto-usepackage YaTeX-single-command 'maketitle)
   7.207    (if YaTeX-current-position-register
   7.208        (point-to-register YaTeX-current-position-register)))
   7.209  
   7.210 @@ -2019,26 +2037,42 @@
   7.211  (defun YaTeX-kill-paren (kill-contents)
   7.212    "Kill parentheses leaving its contents.
   7.213  But kill its contents if the argument KILL-CONTENTS is non-nil."
   7.214 -  (save-excursion
   7.215 -    (let (p)
   7.216 -      (if (looking-at "\\s(\\|\\(\\s)\\)")
   7.217 -	  (progn
   7.218 -	    (if (match-beginning 1)
   7.219 -		(up-list -1))
   7.220 -	    (setq p (point))
   7.221 -	    (forward-list 1)
   7.222 -	    (if kill-contents (delete-region p (point))
   7.223 -	      (backward-delete-char 1)
   7.224 -	      (goto-char p)
   7.225 -	      (if (looking-at
   7.226 -		   (concat "{" YaTeX-ec-regexp
   7.227 -			   YaTeX-command-token-regexp "+"
   7.228 -			   "\\s +"))
   7.229 -		  (delete-region
   7.230 -		   (point)
   7.231 -		   (progn (re-search-forward "\\s +" nil t) (point)))
   7.232 -		(delete-char 1)))
   7.233 -	    t)))))
   7.234 +  (interactive "P")
   7.235 +  (let (p bsl (backslash-syntax (char-to-string (char-syntax ?\\)))
   7.236 +	  (md (match-data)))
   7.237 +    (unwind-protect
   7.238 +	(save-excursion
   7.239 +	  (modify-syntax-entry ?\\ " ")
   7.240 +	  (if (looking-at "\\s(\\|\\(\\s)\\)")
   7.241 +	      (progn
   7.242 +		(if (match-beginning 1)
   7.243 +		    (up-list -1))
   7.244 +		(if (and (> (point) (point-min))
   7.245 +			 (= (char-after (1- (point))) ?\\ ))
   7.246 +		    (setq p (1- (point)) bsl t)
   7.247 +		  (setq p (point)))
   7.248 +		(forward-list 1)
   7.249 +					;(YaTeX-goto-open-paren t)
   7.250 +		(if kill-contents (delete-region p (point))
   7.251 +		  (backward-delete-char 1)
   7.252 +		  (cond
   7.253 +		   ((save-excursion
   7.254 +		      (forward-char -2)
   7.255 +		      (looking-at (concat YaTeX-ec-regexp "/")))
   7.256 +		    (backward-delete-char 2))
   7.257 +		   ((= (char-after (1- (point))) ?\\)
   7.258 +		    (backward-delete-char 1)))
   7.259 +		  (goto-char p)
   7.260 +		  (if (looking-at
   7.261 +		       (concat "{" YaTeX-ec-regexp
   7.262 +			       YaTeX-command-token-regexp "+"
   7.263 +			       "\\s +"))
   7.264 +		      (delete-region (point) (match-end 0))
   7.265 +		    (delete-char 1)
   7.266 +		    (if bsl (delete-char 1))))
   7.267 +		t)))
   7.268 +      (modify-syntax-entry ?\\ backslash-syntax)
   7.269 +      (store-match-data md))))
   7.270  
   7.271  (defvar YaTeX-read-environment-history nil "Holds history of environments.")
   7.272  (put 'YaTeX-read-environment-history 'no-default t)
     8.1 --- a/yatex.new	Fri May 02 11:23:59 2003 +0000
     8.2 +++ b/yatex.new	Thu Dec 25 04:10:32 2003 +0000
     8.3 @@ -1,6 +1,14 @@
     8.4  	What's new in YaTeX/yahtml
     8.5  	野鳥/yahtml - 各バージョンの変更点について
     8.6  
     8.7 +1.72	=== yatex ===
     8.8 +	YaTeX-kanji-code が nil なら coding-system に感知しない
     8.9 +	補完したマクロがLaTeX2eの特定のpackageに依存している場合
    8.10 +	そのpackageを半自動で \usepackage する(yatexpkg.el新設)
    8.11 +	{} の末尾がイタリック補正 \/ ならそれを消す
    8.12 +	=== yahtml ==
    8.13 +	yahtml-kanji-code が nil なら coding-system に感知しない
    8.14 +
    8.15  1.71	=== yatex ===
    8.16  	fill-prefix を指定している場合、Emacs21で \item の auto-fill が
    8.17  	\item の深さにかかわらず fill-prefix になってしまうのを回避
     9.1 --- a/yatex19.el	Fri May 02 11:23:59 2003 +0000
     9.2 +++ b/yatex19.el	Thu Dec 25 04:10:32 2003 +0000
     9.3 @@ -1,7 +1,7 @@
     9.4  ;;; -*- Emacs-Lisp -*-
     9.5  ;;; YaTeX facilities for Emacs 19
     9.6 -;;; (c )1994-2003 by HIROSE Yuuji.[yuuji@yatex.org]
     9.7 -;;; Last modified Fri Feb 21 01:35:19 2003 on firestorm
     9.8 +;;; (c)1994-2003 by HIROSE Yuuji.[yuuji@yatex.org]
     9.9 +;;; Last modified Fri Jun 27 12:07:46 2003 on firestorm
    9.10  ;;; $Id$
    9.11  
    9.12  ;(require 'yatex)
    10.1 --- a/yatexadd.el	Fri May 02 11:23:59 2003 +0000
    10.2 +++ b/yatexadd.el	Thu Dec 25 04:10:32 2003 +0000
    10.3 @@ -1,8 +1,8 @@
    10.4  ;;; -*- Emacs-Lisp -*-
    10.5  ;;; YaTeX add-in functions.
    10.6 -;;; yatexadd.el rev.15
    10.7 -;;; (c )1991-2003 by HIROSE Yuuji.[yuuji@yatex.org]
    10.8 -;;; Last modified Mon Mar 17 16:46:01 2003 on serow
    10.9 +;;; yatexadd.el rev.17
   10.10 +;;; (c)1991-2003 by HIROSE Yuuji.[yuuji@yatex.org]
   10.11 +;;; Last modified Thu Nov 27 11:11:30 2003 on firestorm
   10.12  ;;; $Id$
   10.13  
   10.14  ;;;
   10.15 @@ -60,26 +60,28 @@
   10.16    (concat (YaTeX:read-position "tb")
   10.17  	  "{" (read-string "Column format: ") "}"))
   10.18  
   10.19 -(defun YaTeX:read-oneof (oneof)
   10.20 +(defun YaTeX:read-oneof (oneof &optional quick allow-dup)
   10.21    (let ((pos "") loc (guide ""))
   10.22      (and (boundp 'name) name (setq guide (format "%s " name)))
   10.23 -    (while (not (string-match
   10.24 -		 (setq loc (read-key-sequence
   10.25 -			    (format "%s position (`%s') [%s]: "
   10.26 -				    guide oneof pos));name is in YaTeX-addin
   10.27 -		       loc (if (fboundp 'events-to-keys)
   10.28 -			       (events-to-keys loc) loc))
   10.29 -		 "\r\^g\n"))
   10.30 -      (cond
   10.31 -       ((string-match loc oneof)
   10.32 -	(if (not (string-match loc pos))
   10.33 -	    (setq pos (concat pos loc))))
   10.34 -       ((and (string-match loc "\C-h\C-?") (> (length pos) 0))
   10.35 -	(setq pos (substring pos 0 (1- (length pos)))))
   10.36 -       (t
   10.37 -	(ding)
   10.38 -	(message "Please input one of `%s'." oneof)
   10.39 -	(sit-for 3))))
   10.40 +    (catch 'quick
   10.41 +      (while (not (string-match
   10.42 +		   (setq loc (read-key-sequence
   10.43 +			      (format "%s position (`%s') [%s]: "
   10.44 +				      guide oneof pos));name is in YaTeX-addin
   10.45 +			 loc (if (fboundp 'events-to-keys)
   10.46 +				 (events-to-keys loc) loc))
   10.47 +		   "\r\^g\n"))
   10.48 +	(cond
   10.49 +	 ((string-match loc oneof)
   10.50 +	  (if (or allow-dup (not (string-match loc pos)))
   10.51 +	      (setq pos (concat pos loc)))
   10.52 +	  (if quick (throw 'quick t)))
   10.53 +	 ((and (string-match loc "\C-h\C-?") (> (length pos) 0))
   10.54 +	  (setq pos (substring pos 0 (1- (length pos)))))
   10.55 +	 (t
   10.56 +	  (ding)
   10.57 +	  (message "Please input one of `%s'." oneof)
   10.58 +	  (sit-for 3)))))
   10.59      (message "")
   10.60      pos))
   10.61  
   10.62 @@ -218,7 +220,6 @@
   10.63  
   10.64  (fset 'YaTeX:right 'YaTeX:left)
   10.65  
   10.66 -
   10.67  (defun YaTeX:read-coordinates (&optional mes varX varY)
   10.68    (concat
   10.69     "("
   10.70 @@ -227,6 +228,9 @@
   10.71     (read-string (format "%s %s: " (or mes "Dimension") (or varY "Y")))
   10.72     ")"))
   10.73  
   10.74 +(defun YaTeX:itembox ()
   10.75 +  (concat "{" (read-string "Item heading string: ") "}"))
   10.76 +
   10.77  ;;;
   10.78  ;;Sample functions for maketitle-type command.
   10.79  ;;;
   10.80 @@ -1132,12 +1136,7 @@
   10.81     ((equal 1 argp)
   10.82      (read-string "Number of columns: "))
   10.83     ((equal 2 argp)
   10.84 -    (let (c)
   10.85 -      (while (not (string-match
   10.86 -		   (progn (message "Format(one of l,r,c): ")
   10.87 -			  (setq c (char-to-string (read-char))))
   10.88 -		   "lrc")))
   10.89 -      c))
   10.90 +    (YaTeX:read-oneof "|lrc" nil t))
   10.91     ((equal 3 argp)
   10.92      (read-string "Item: "))))
   10.93  
   10.94 @@ -1373,6 +1372,59 @@
   10.95    (setq YaTeX-section-name "label")
   10.96    nil)
   10.97  
   10.98 +(defvar YaTeX::usepackage-alist-default
   10.99 +  '(("version") ("plext") ("url") ("fancybox") ("pifont") ("longtable")
  10.100 +    ("ascmac") ("bm") ("graphics") ("graphicx") ("alltt") ("misc") ("eclbkbox")
  10.101 +    ("amsmath") ("amssymb") ("xymtex") ("chemist")
  10.102 +    ("a4j") ("array") ("epsf") ("color") ("epsfig") ("floatfig")
  10.103 +    ("landscape") ("path") ("supertabular") ("twocolumn"))
  10.104 +  "Default completion table for arguments of \usepackage")
  10.105 +
  10.106 +(defvar YaTeX::usepackage-alist-private nil
  10.107 +  "*Private completion list of the argument for usepackage")
  10.108 +
  10.109 +(defvar YaTeX::usepackage-alist-local nil
  10.110 +  "Directory local  completion list of the argument for usepackage")
  10.111 +
  10.112 +(defun YaTeX::usepackage (&optional argp)
  10.113 +  (cond
  10.114 +   ((equal argp 1)
  10.115 +    (setq YaTeX-env-name "document")
  10.116 +    (YaTeX-cplread-with-learning
  10.117 +     "Use package: "
  10.118 +     'YaTeX::usepackage-alist-default
  10.119 +     'YaTeX::usepackage-alist-private
  10.120 +     'YaTeX::usepackage-alist-local))))
  10.121 +
  10.122 +(defun YaTeX::mask (argp)
  10.123 +  (cond
  10.124 +   ((equal argp 1)
  10.125 +    (read-string "String: "))
  10.126 +   ((equal argp 2)
  10.127 +    (let (c)
  10.128 +      (while (not (memq c '(?A ?B ?C ?D ?E ?F ?G ?H ?I ?J ?K)))
  10.129 +	(message "Mask type(A..K): ")
  10.130 +	(setq c (upcase (read-char))))
  10.131 +      (format "%c" c)))))
  10.132 +
  10.133 +(defun YaTeX::maskbox (argp)
  10.134 +  (cond
  10.135 +   ((equal argp 1)
  10.136 +    (read-string "Width: "))
  10.137 +   ((equal argp 2)
  10.138 +    (read-string "Height: "))
  10.139 +   ((equal argp 3)
  10.140 +    (let (c)
  10.141 +      (while (not (memq c '(?A ?B ?C ?D ?E ?F ?G ?H ?I ?J ?K)))
  10.142 +	(message "Mask type(A..K): ")
  10.143 +	(setq c (upcase (read-char))))
  10.144 +      (format "%c" c)))
  10.145 +   ((equal argp 4)
  10.146 +    (YaTeX:read-oneof "lcr" 'quick))
  10.147 +   ((equal argp 5)
  10.148 +    (read-string "String: "))
  10.149 +))
  10.150 +
  10.151  ;;; -------------------- math-mode stuff --------------------
  10.152  (defun YaTeX::tilde (&optional pos)
  10.153    "For accent macros in mathmode"
  10.154 @@ -1418,6 +1470,44 @@
  10.155  (fset 'YaTeX::overline		'YaTeX::widetilde)
  10.156  (fset 'YaTeX::overrightarrow	'YaTeX::widetilde)
  10.157  	
  10.158 +;
  10.159 +; for \frac{}{} region
  10.160 +(defun YaTeX::frac-region (beg end)
  10.161 +  (if (catch 'done
  10.162 +	(while (re-search-forward "\\s *\\(\\\\over\\|/\\)\\s *" end t)
  10.163 +	  (goto-char (match-beginning 0))
  10.164 +	  (if (y-or-n-p
  10.165 +	       (format "Replace this `%s' with `}{'" (YaTeX-match-string 0)))
  10.166 +	      (throw 'done t))
  10.167 +	  (goto-char (match-end 0))))
  10.168 +      (let (p (b0 (match-beginning 0)) e0)
  10.169 +	(replace-match "}{")
  10.170 +	(setq e0 (point))
  10.171 +	(save-restriction
  10.172 +	  (narrow-to-region beg end)
  10.173 +	  (goto-char e0)
  10.174 +	  (skip-chars-forward " \t")
  10.175 +	  (setq p (point))
  10.176 +	  (YaTeX-goto-corresponding-paren)
  10.177 +	  (forward-char 1)
  10.178 +	  (skip-chars-forward " \t\r\n")
  10.179 +	  (if (= end (1+ (point)))
  10.180 +	      (progn
  10.181 +		(goto-char p)
  10.182 +		(if (looking-at "\\\\") (forward-char 1))
  10.183 +		(YaTeX-kill-paren nil)))
  10.184 +	  (goto-char beg)
  10.185 +	  (skip-chars-forward " \t")
  10.186 +	  (setq p (point))
  10.187 +	  (YaTeX-goto-corresponding-paren)
  10.188 +	  (forward-char 1)
  10.189 +	  (skip-chars-forward " \t\r\n")
  10.190 +	  (if (>= (point) b0)
  10.191 +	      (progn
  10.192 +		(goto-char p)
  10.193 +		(if (looking-at "\\\\") (forward-char 1))
  10.194 +		(YaTeX-kill-paren nil))))))
  10.195 +  (message ""))
  10.196  
  10.197  ;;;
  10.198  ;; Add-in functions for large-type command.
    11.1 --- a/yatexenv.el	Fri May 02 11:23:59 2003 +0000
    11.2 +++ b/yatexenv.el	Thu Dec 25 04:10:32 2003 +0000
    11.3 @@ -1,8 +1,8 @@
    11.4  ;;; -*- Emacs-Lisp -*-
    11.5  ;;; YaTeX environment-specific functions.
    11.6  ;;; yatexenv.el
    11.7 -;;; (c ) 1994-2003 by HIROSE Yuuji.[yuuji@yatex.org]
    11.8 -;;; Last modified Sun Mar 30 19:25:47 2003 on firestorm
    11.9 +;;; (c) 1994-2003 by HIROSE Yuuji.[yuuji@yatex.org]
   11.10 +;;; Last modified Fri Jun 27 12:09:30 2003 on firestorm
   11.11  ;;; $Id$
   11.12  
   11.13  ;;;
    12.1 --- a/yatexgen.el	Fri May 02 11:23:59 2003 +0000
    12.2 +++ b/yatexgen.el	Thu Dec 25 04:10:32 2003 +0000
    12.3 @@ -1,8 +1,8 @@
    12.4  ;;; -*- Emacs-Lisp -*-
    12.5  ;;; YaTeX add-in function generator.
    12.6  ;;; yatexgen.el rev.5
    12.7 -;;; (c )1991-1995,1999,2000 by HIROSE Yuuji.[yuuji@yatex.org]
    12.8 -;;; Last modified Mon Dec 25 19:17:30 2000 on firestorm
    12.9 +;;; (c)1991-1995,1999,2000 by HIROSE Yuuji.[yuuji@yatex.org]
   12.10 +;;; Last modified Fri Jun 27 12:09:37 2003 on firestorm
   12.11  ;;; $Id$
   12.12  
   12.13  (require 'yatex)
    13.1 --- a/yatexhie.el	Fri May 02 11:23:59 2003 +0000
    13.2 +++ b/yatexhie.el	Thu Dec 25 04:10:32 2003 +0000
    13.3 @@ -1,8 +1,8 @@
    13.4  ;;; -*- Emacs-Lisp -*-
    13.5  ;;; YaTeX hierarchy browser.
    13.6  ;;; yatexhie.el
    13.7 -;;; (c )1995 by HIROSE Yuuji [yuuji@yatex.org]
    13.8 -;;; Last modified Wed Dec  1 23:41:01 1999 on firestorm
    13.9 +;;; (c)1995 by HIROSE Yuuji [yuuji@yatex.org]
   13.10 +;;; Last modified Fri Jun 27 12:09:49 2003 on firestorm
   13.11  ;;; $Id$
   13.12  
   13.13  ;; ----- Customizable variables -----
    14.1 --- a/yatexhlp.el	Fri May 02 11:23:59 2003 +0000
    14.2 +++ b/yatexhlp.el	Thu Dec 25 04:10:32 2003 +0000
    14.3 @@ -1,8 +1,8 @@
    14.4  ;;; -*- Emacs-Lisp -*-
    14.5  ;;; YaTeX helper with LaTeX commands and macros.
    14.6  ;;; yatexhlp.el
    14.7 -;;; (c )1994,1998 by HIROSE Yuuji.[yuuji@yatex.org]
    14.8 -;;; Last modified Thu Aug 26 18:15:39 1999 on firestorm
    14.9 +;;; (c)1994,1998 by HIROSE Yuuji.[yuuji@yatex.org]
   14.10 +;;; Last modified Fri Jun 27 12:09:58 2003 on firestorm
   14.11  ;;; $Id$
   14.12  
   14.13  (let ((help-file (concat "YATEXHLP."
    15.1 --- a/yatexlib.el	Fri May 02 11:23:59 2003 +0000
    15.2 +++ b/yatexlib.el	Thu Dec 25 04:10:32 2003 +0000
    15.3 @@ -1,12 +1,13 @@
    15.4  ;;; -*- Emacs-Lisp -*-
    15.5  ;;; YaTeX and yahtml common libraries, general functions and definitions
    15.6  ;;; yatexlib.el
    15.7 -;;; (c )1994-2002 by HIROSE Yuuji.[yuuji@yatex.org]
    15.8 -;;; Last modified Wed Oct  2 23:35:33 2002 on firestorm
    15.9 +;;; (c)1994-2002 by HIROSE Yuuji.[yuuji@yatex.org]
   15.10 +;;; Last modified Tue Aug 19 22:20:40 2003 on firestorm
   15.11  ;;; $Id$
   15.12  
   15.13  ;; General variables
   15.14  (defvar YaTeX-dos (memq system-type '(ms-dos windows-nt OS/2)))
   15.15 +(defvar YaTeX-macos (memq system-type '(darwin)))
   15.16  (defvar YaTeX-emacs-19 (>= (string-to-int emacs-version) 19))
   15.17  (defvar YaTeX-emacs-20 (>= (string-to-int emacs-version) 20))
   15.18  (defvar YaTeX-emacs-21 (>= (string-to-int emacs-version) 21))
   15.19 @@ -21,7 +22,11 @@
   15.20        window-system)  ; falls down lazy check..
   15.21    "Current display's capability of expressing colors.")
   15.22  
   15.23 -(defvar YaTeX-japan (or (boundp 'NEMACS) (boundp 'MULE) YaTeX-emacs-20)
   15.24 +(defvar YaTeX-japan
   15.25 +  (or (boundp 'NEMACS)
   15.26 +      (boundp 'MULE)
   15.27 +      (and (boundp 'current-language-environment)
   15.28 +	   (string-match "[Jj]apanese" current-language-environment)))
   15.29    "Whether yatex mode is running on Japanese environment or not.")
   15.30  
   15.31  ;; autoload from yahtml.el
   15.32 @@ -33,14 +38,17 @@
   15.33      (list '(0 . *noconv*)
   15.34  	  (cons
   15.35  	   1
   15.36 -	   (if YaTeX-dos (if (boundp '*sjis-dos*) *sjis-dos* *sjis*dos)
   15.37 -	     *sjis*))
   15.38 +	   (cond
   15.39 +	    (YaTeX-dos (if (boundp '*sjis-dos*) *sjis-dos* *sjis*dos))
   15.40 +	    (YaTeX-macos (if (boundp '*sjis-mac*) *sjis-mac* *sjis*mac))
   15.41 +	    (t *sjis*)))
   15.42  	  '(2 . *junet*) '(3 . *euc-japan*)))
   15.43     (YaTeX-emacs-20
   15.44      ;;(cdr-safe(assq 'coding-system (assoc "Japanese" language-info-alist)))
   15.45      (list '(0 . no-conversion)
   15.46  	  (cons
   15.47  	   1 (cond (YaTeX-dos 'shift_jis-dos)
   15.48 +		   (YaTeX-macos 'shift_jis-mac)
   15.49  		   ((member 'shift_jis (coding-system-list)) 'shift_jis-unix)
   15.50  		   (t 'sjis)))
   15.51  	  '(2 . iso-2022-jp-unix)
    16.1 --- a/yatexm-o.el	Fri May 02 11:23:59 2003 +0000
    16.2 +++ b/yatexm-o.el	Thu Dec 25 04:10:32 2003 +0000
    16.3 @@ -1,7 +1,7 @@
    16.4  ;;; -*- Emacs-Lisp -*-
    16.5  ;;; Sample startup file to invoke yatex-mode with outline-minor mode.
    16.6 -;;; (c )1993 by HIROSE Yuuji [yuuji@yatex.org]
    16.7 -;;; Last modified Thu Aug 26 18:16:00 1999 on firestorm
    16.8 +;;; (c)1993 by HIROSE Yuuji [yuuji@yatex.org]
    16.9 +;;; Last modified Fri Jun 27 12:10:15 2003 on firestorm
   16.10  
   16.11  ;;;
   16.12  ;; outline-minor-mode(使用しない場合は不要です)
    17.1 --- a/yatexpkg.el	Fri May 02 11:23:59 2003 +0000
    17.2 +++ b/yatexpkg.el	Thu Dec 25 04:10:32 2003 +0000
    17.3 @@ -1,12 +1,13 @@
    17.4  ;;; -*- Emacs-Lisp -*-
    17.5  ;;; YaTeX package manager
    17.6  ;;; yatexpkg.el
    17.7 -;;; (c )2003 by HIROSE, Yuuji [yuuji@yatex.org]
    17.8 -;;; Last modified Fri May  2 20:13:49 2003 on firestorm
    17.9 +;;; (c)2003 by HIROSE, Yuuji [yuuji@yatex.org]
   17.10 +;;; Last modified Thu Aug 28 18:24:33 2003 on firestorm
   17.11  ;;; $Id$
   17.12  
   17.13  (defvar YaTeX-package-alist-default
   17.14 -  '(("version"	(env "comment"))	;by tsuchiya@pine.kuee.kyoto-u.ac.jp
   17.15 +  '(("version"	(env "comment")		;by tsuchiya@pine.kuee.kyoto-u.ac.jp
   17.16 +     		(section "includeversion" "excludeversion"))
   17.17  
   17.18      ("plext"	(section "bou"))	;by yas.axis@ma.mni.ne.jp
   17.19  
   17.20 @@ -17,14 +18,21 @@
   17.21      ("longtable" (env "longtable"))
   17.22      ("ascmac"	(env "screen" "boxnote" "shadebox" "itembox")
   17.23  		(maketitle "return" "Return" "yen")
   17.24 -     		(section "keytop"))
   17.25 +     		(section "keytop") ("mask") ("maskbox"))
   17.26      ("bm"	(section "bm"))		;by aoyama@le.chiba-u.ac.jp
   17.27  
   17.28      ("graphicx"	(section "includegraphics"))
   17.29      ("alltt"	(env "alltt"))
   17.30      ("misc"	(section "verbfile" "listing"))
   17.31      ("eclbkbox"	(env "breakbox")))
   17.32 -  "Default package vs. macro list")
   17.33 +  "Default package vs. macro list.
   17.34 +Alists contains '(PACKAGENAME . MACROLIST)
   17.35 +PACKAGENAME     Basename of package(String).
   17.36 +MACROLIST	List of '(TYPE . MACROS)
   17.37 +TYPE	One of 'env, 'section or 'maketitle according to completion-type
   17.38 +MACROS	List of macros
   17.39 +
   17.40 +An good example is the value of YaTeX-package-alist-default.")
   17.41  
   17.42  (defvar YaTeX-package-alist-private nil
   17.43    "*User defined package vs. macro list. See also YaTeX-package-alist-default")
   17.44 @@ -85,6 +93,7 @@
   17.45  			usepkgrx YaTeX-comment-prefix nil t)
   17.46  		  (setq mb0 (match-beginning 0))
   17.47  		  (skip-chars-forward "^{")
   17.48 +		  (forward-char 1)
   17.49  		  (let ((pl pkglist))
   17.50  		    (while pl		;(car pl)'s car is package, cdr is type
   17.51  		      (if (looking-at (regexp-quote (car (car pl))))
   17.52 @@ -100,7 +109,11 @@
   17.53  		  (setq pkg
   17.54  			(completing-read
   17.55  			 "Load which package?(TAB for list): "
   17.56 -			 pkglist))
   17.57 +			 pkglist nil nil
   17.58 +			 ;;initial input
   17.59 +			 (if (= (length pkglist) 1)
   17.60 +			     (let ((w (car (car pkglist))))
   17.61 +			       (if YaTeX-emacs-19 (cons w 0) w)))))
   17.62  		  (set-buffer pb)
   17.63  		  (goto-char (point-min))
   17.64  		  (if (YaTeX-re-search-active-forward
    18.1 --- a/yatexprc.el	Fri May 02 11:23:59 2003 +0000
    18.2 +++ b/yatexprc.el	Thu Dec 25 04:10:32 2003 +0000
    18.3 @@ -1,8 +1,8 @@
    18.4  ;;; -*- Emacs-Lisp -*-
    18.5  ;;; YaTeX process handler.
    18.6  ;;; yatexprc.el
    18.7 -;;; (c )1993-2003 by HIROSE Yuuji.[yuuji@yatex.org]
    18.8 -;;; Last modified Thu May  1 22:37:31 2003 on firestorm
    18.9 +;;; (c)1993-2003 by HIROSE Yuuji.[yuuji@yatex.org]
   18.10 +;;; Last modified Sun Nov  2 08:09:44 2003 on firestorm
   18.11  ;;; $Id$
   18.12  
   18.13  ;(require 'yatex)
   18.14 @@ -27,15 +27,23 @@
   18.15    "Shell option for command execution.")
   18.16  
   18.17  (defvar YaTeX-latex-message-code
   18.18 +;;   (cond
   18.19 +;;    (YaTeX-dos (cdr (assq 1 YaTeX-kanji-code-alist)))
   18.20 +;;    ((and YaTeX-emacs-20 (member 'undecided (coding-system-list))
   18.21 +;; 	 'undecided))
   18.22 +;;    ((featurep 'mule)
   18.23 +;;     (or (and (boundp '*autoconv*) *autoconv*)
   18.24 +;; 	(and (fboundp 'coding-system-list) 'automatic-conversion)))
   18.25 +;;    ((boundp 'NEMACS)
   18.26 +;;     (cdr (assq (if YaTeX-dos 1 2) YaTeX-kanji-code-alist))))
   18.27    (cond
   18.28 -   (YaTeX-dos (cdr (assq 1 YaTeX-kanji-code-alist)))
   18.29 -   ((and YaTeX-emacs-20 (member 'undecided (coding-system-list))
   18.30 -	 'undecided))
   18.31 -   ((featurep 'mule)
   18.32 -    (or (and (boundp '*autoconv*) *autoconv*)
   18.33 -	(and (fboundp 'coding-system-list) 'automatic-conversion)))
   18.34 +   (YaTeX-emacs-20
   18.35 +    (cdr (assoc latex-message-kanji-code YaTeX-kanji-code-alist)))
   18.36 +   ((boundp 'MULE)
   18.37 +    (symbol-value
   18.38 +     (cdr (assoc latex-message-kanji-code YaTeX-kanji-code-alist))))
   18.39     ((boundp 'NEMACS)
   18.40 -    (cdr (assq (if YaTeX-dos 1 2) YaTeX-kanji-code-alist))))
   18.41 +    latex-message-kanji-code))
   18.42    "Process coding system for LaTeX.")
   18.43  
   18.44  (if YaTeX-typeset-buffer-syntax nil
   18.45 @@ -395,11 +403,11 @@
   18.46        (concat
   18.47         (catch 'found-paper
   18.48  	 (mapcar (lambda (pair)
   18.49 -		   (if (member (car pair) opts)
   18.50 +		   (if (YaTeX-member (car pair) opts)
   18.51  		       (throw 'found-paper (cdr pair))))
   18.52  		 YaTeX-paper-type-alist)
   18.53  	 YaTeX-default-paper-type)
   18.54 -       (if (member "landscape" opts) "r" "")))))
   18.55 +       (if (YaTeX-member "landscape" opts) (if YaTeX-dos "L" "r") "")))))
   18.56  
   18.57  (defvar YaTeX-preview-command-history nil
   18.58    "Holds minibuffer history of preview command.")
   18.59 @@ -415,7 +423,10 @@
   18.60       "Preview command: "
   18.61       (YaTeX-replace-format
   18.62        (or (YaTeX-get-builtin "PREVIEW") dvi2-command)
   18.63 -      "p" (concat "-paper " (YaTeX-get-paper-type)))
   18.64 +      "p" (format (cond
   18.65 +		   (YaTeX-dos "-y:%s")
   18.66 +		   (t "-paper %s"))
   18.67 +		  (YaTeX-get-paper-type)))
   18.68       'YaTeX-preview-command-history)
   18.69      (read-string-with-history
   18.70       "Preview file[.dvi]: "
   18.71 @@ -688,10 +699,13 @@
   18.72  (defvar YaTeX-lpr-command-history nil
   18.73    "Holds command line history of YaTeX-lpr.")
   18.74  (put 'YaTeX-lpr-command-history 'no-default t)
   18.75 +(defvar YaTeX-lpr-ask-page-range-default t)
   18.76  (defun YaTeX-lpr (arg)
   18.77 -  "Print out.  If prefix arg ARG is non nil, call print driver without
   18.78 +  "Print out.
   18.79 +If prefix arg ARG is non nil, call print driver without
   18.80  page range description."
   18.81    (interactive "P")
   18.82 +  (or YaTeX-lpr-ask-page-range-default (setq arg (not arg)))
   18.83    (let*((cmd (or (YaTeX-get-builtin "LPR") dviprint-command-format))
   18.84  	from to (lbuffer "*dvi-printing*") dir)
   18.85      (setq
    19.1 --- a/yatexsec.el	Fri May 02 11:23:59 2003 +0000
    19.2 +++ b/yatexsec.el	Thu Dec 25 04:10:32 2003 +0000
    19.3 @@ -1,8 +1,8 @@
    19.4  ;;; -*- Emacs-Lisp -*-
    19.5  ;;; YaTeX sectioning browser.
    19.6  ;;; yatexsec.el
    19.7 -;;; (c ) 1994,1998,1999,2003 by HIROSE Yuuji [yuuji@yatex.org]
    19.8 -;;; Last modified Wed Mar  5 13:19:11 2003 on firestorm
    19.9 +;;; (c) 1994,1998,1999,2003 by HIROSE Yuuji [yuuji@yatex.org]
   19.10 +;;; Last modified Fri Jun 27 12:10:34 2003 on firestorm
   19.11  ;;; $Id$
   19.12  
   19.13  (defvar YaTeX-sectioning-level