# HG changeset patch # User yuuji # Date 785751973 0 # Node ID eb0512bfcb7f0a120d4f775378a0b86cb10e75b5 # Parent a0640ff3f72ff208b44f9b58a4a7ba28c998a179 Abolish user-article table. Use normal read-string instead. Supply smart add-in function for documentstyle. Update user dictionary whenever new words entered. Enhance [prefix] c. Allow user defined sectioning commands in yatexsec. diff -r a0640ff3f72f -r eb0512bfcb7f docs/yatex.ref --- a/docs/yatex.ref Mon Oct 31 17:49:43 1994 +0000 +++ b/docs/yatex.ref Fri Nov 25 08:26:13 1994 +0000 @@ -8,7 +8,11 @@ 野鳥では、prefix キーをカスタマイズできるため(標準ではC-c)これを [prefix] と表記します。C-c のまま変更していない場合、[prefix] a は - C-c a を表わします。 + C-c a を表わします。begin型コマンドとは \begin〜\endの形式のコマ + ンド、section型コマンドとは \section{題}のように引数を取るコマン + ド、large型コマンドとは {\tt } のような中括弧で囲まれたフォント/ + サイズ指定子、maketitle型コマンドとは \maketitle のように引数を + 伴わないコマンドを指します。 【補完】 @@ -52,10 +56,10 @@ ※は、MS-DOS では無効です。 - [prefix] tr の領域指定は、文書中の、 %#BEGIN と書いてある行から、 - %#END と書いてある行までです。%#END を省略すると、%#BEGINから文書 - 末まで、両方省略すると、マークした位置から、ポイントまでが指定領域 - となります。 + [prefix] tr の領域指定は、文書中の、 %#BEGIN と書いてある行か + ら、%#END と書いてある行までです。%#END を省略すると、%#BEGINか + ら文書末まで、両方省略するとマークした位置から、ポイントまでが指 + 定領域となります。 【カーソルジャンプ】 @@ -110,7 +114,10 @@ ◆itemの桁揃え [prefix] i ◆LaTeXコマンド変更 [prefix] c - \begin{}, \end{} の環境名を同時に変更します。 + \begin{}, \end{} の行で起動すると環境名を同時に変更します。 + section型コマンドの上で起動するとコマンドを変更し、コマンドの引 + 数の位置で起動すると引数を変更します。large型コマンドの上で起動 + するとフォント/サイズ指定子を変更します。 ◆コマンド削除 [prefix] k @@ -130,7 +137,7 @@ ◆%# 記法の編集 [prefix] % ◆tabular/array桁位置表示 [prefix] & ◆オンラインヘルプ [prefix] ? - ◆オンラインヘルプ [prefix] / + ◆オンラインapropos [prefix] / ◆おまかせ改行 ESC RET 「おまかせ改行」は tabular, array, itemize, enumerate, list, diff -r a0640ff3f72f -r eb0512bfcb7f docs/yatexadd.doc --- a/docs/yatexadd.doc Mon Oct 31 17:49:43 1994 +0000 +++ b/docs/yatexadd.doc Fri Nov 25 08:26:13 1994 +0000 @@ -5,14 +5,11 @@ 【付加関数とは】 - begin 型補完で、「tabular 環境を入力している時に、"{|c|c|c|}" と - か、また、table 環境の入力時に"[tbp]" とかも一緒に入力すればいいの - に」などと思うことはありませんか。もちろんこれを自動入力する関数は - 簡単にサポートできるでしょう。 - - しかし、tabular 環境に限らず、LaTeX の環境の引数には、各人お決ま - りのフォーマットがあるものです。たとえば凝った表を書く時の tabular - 環境の引数は、かなり複雑なので、上のような自動入力関数よりも、 + begin 型補完で、「tabular 環境を入力している時に、わたしの好み + のスタイルが入らないなあ」などと思うことはありませんか。tabular + 環境に限らず、LaTeX の環境の引数には、各人お決まりのフォーマット + があるものです。たとえば凝った表を書く時の tabular環境の引数は、 + かなり複雑なので、デフォルトの自動入力関数よりも、 "{@{\vrule width 1pt\ }|||@{\ \vrule width 1pt}}" diff -r a0640ff3f72f -r eb0512bfcb7f docs/yatexe.tex --- a/docs/yatexe.tex Mon Oct 31 17:49:43 1994 +0000 +++ b/docs/yatexe.tex Fri Nov 25 08:26:13 1994 +0000 @@ -31,11 +31,11 @@ * Typesetting:: * %# notation:: * Completion:: +* Local dictionaries:: * Commenting out:: * Cursor jump:: * Changing and Deleting:: * Filling an item:: -* Local dictionaries:: * Updation of @code{\includeonly}:: * What column?:: * Intelligent newline:: @@ -70,10 +70,16 @@ * view-sectioning:: +Changing and Deleting + +* Changing La@TeX{} commands:: +* Killing La@TeX{} commands:: + Customizations * Lisp variables:: * Add-in functions:: +* Add-in generator:: Lisp variables @@ -81,6 +87,18 @@ * Sample definitions:: * Hook variables:: * Hook file:: + +Procedure + +* How the add-in function works?:: +* How the function is called:: +* Useful functions for creating add-in:: +* Contribution:: + +How the add-in function works? + +* Defining `option add-in':: +* Defining `argument add-in':: @end menu @node What is YaTeX?, Main features, Top, Top @@ -108,6 +126,7 @@ (@kbd{C-c b}, @kbd{C-c s}, @kbd{C-c l}, @kbd{C-c m}) @item Enclosing text into La@TeX{} environments or commands (@kbd{C-u} @var{AboveKeyStrokes}) +@item Displaying the structure of text at entering sectioning delimiters @item Learning unknown/new La@TeX{} commands for the next completion @item Argument reading with a guide for complicated La@TeX{} commands @item Generating argument-readers for new/unsupported commands(@file{yatexgen}) @@ -216,7 +235,7 @@ skip this by invoking it with universal-argument as follows: @example -C-u [prefix] tl + C-u [prefix] tl @end example @node %# notation, Completion, Typesetting, Top @@ -391,7 +410,7 @@ When you type @kbd{b}, all @code{%#BEGIN} and @code{%#END} are automatically erased. -@node Completion, Commenting out, %# notation, Top +@node Completion, Local dictionaries, %# notation, Top @comment node-name, next, previous, up @chapter Completion @cindex completion @@ -583,7 +602,7 @@ @cindex number of argument @example -C-u 2 [prefix] s (or ESC 2 [prefix] s) + C-u 2 [prefix] s (or ESC 2 [prefix] s) @end example @noindent @@ -603,12 +622,6 @@ arguments by calling the completion with different universal argument again. - The special number of argument 0 makes YaTeX use read-string to -read the first argument instead of completing-read. It is more -comfortable to enter first argument without completion when you -put section title which contains space character. Normally, such -sectioning commands as chapter, section, paragraph..., have -argument 0 in the completion table. Invoking section-type completion with @code{[Prefix] S} (Capital `S') includes the region as the first argument of section-type command. @@ -836,7 +849,36 @@ @kbd{;} or @kbd{/} after universal-argument(@kbd{C-u}) which forces @kbd{;} and @kbd{/} to work as math-prefix. -@node Commenting out, Cursor jump, Completion, Top +@node Local dictionaries, Commenting out, Completion, Top +@comment node-name, next, previous, up +@chapter Local dictionaries +@cindex local dictionaries +@cindex nervous users + + Tables for completion consist of three dictionaries; `standard +dictionary' built in @file{yatex.el}, `user dictionary' for your common +private commands, and `local dictionary' that is effective in a certain +directory. + + When you input the command unknown to YaTeX at a completion in the +minibuffer, YaTeX asks you with the following prompt; + +@example + `foo' is not in table. Register into: U)serTable L)ocal N)one +@end example + +@noindent +In this menu, typing `u' updates your `user dictionary', `l' updates your +local dictionary, and `n' updates no dictionary and throws the word away. + + If you find this switching feature meaningless and bothersome, put the +next expression into your @file{~/.emacs} + +@lisp + (setq YaTeX-nervous nil) +@end lisp + +@node Commenting out, Cursor jump, Local dictionaries, Top @comment node-name, next, previous, up @chapter Commenting out @cindex commenting out @@ -918,18 +960,20 @@ La@TeX{} command of last place. YaTeX recognize the followings as pairs that have relation each other. -@table +@itemize @bullet @item @code{\begin@{@}} <-> @code{\end@{@}} @item @code{%#BEGIN} <-> @code{%#END} @item @code{\label@{@}} <-> @code{\ref@{@}} @item @code{\include(\input)} -> included file @item @code{\bibitem@{@}} <-> @code{\cite@{@}} -@end table +@end itemize - On a @code{\begin},@code{\end} line, typing @kbd{[prefix] g} -moves the cursor to the corresponding @code{\end},@code{\begin} line, if -its partner really exists. The movement on the line @code{%#BEGIN} and -@code{%#END} are the same. + On a @code{\begin},@code{\end} line, typing @kbd{[prefix] g} moves the +cursor to the corresponding @code{\end},@code{\begin} line, if its partner +really exists. The behaviour on the line @code{%#BEGIN} and @code{%#END} +are the same. Note that if the correspondent of @code{label/ref} or +@code{cite/bibitem} exists in another file, that file have to be opend to +make a round trip between references by @kbd{[prefix] g}. If you type @code{[prefix] g} on the line of @code{\include@{chap1@}}, typically in the main text, YaTeX switches buffer to @file{chap1.tex}. @@ -978,17 +1022,58 @@ @cindex prefix c @cindex prefix k -@kbd{[prefix] c} can change the name of the corresponding environment -declaration. @kbd{[prefix] k} works as follows: +@menu +* Changing La@TeX{} commands:: +* Killing La@TeX{} commands:: +@end menu + +@node Changing La@TeX{} commands, Killing La@TeX{} commands, Changing and Deleting, Changing and Deleting +@comment node-name, next, previous, up +@section Changing La@TeX{} commands + +@kbd{[prefix] c} can change the various (La)@TeX{} commands. This can +change the followings. +@itemize @bullet +@item Environment names +@item Section-type commands +@item Argument of section-type commands +@item Optional parameters (enclosed by []) of section-type commands +@item Font/size designators +@end itemize + + Typing @kbd{[prefix] c} on one of above objects you want to change +brings a suitable reading function sometimes with completion. +Note: If you want to change the argument of section-type command that +contains other La@TeX{} commands, type @kbd{[prefix] c} either of +surrounding braces of the argument in order to make YaTeX ignore the +internal La@TeX{} sequences as an object of changing. Anyway, it is +very difficult to know which argument position the cursor belongs because +the La@TeX{} commands can be nested and braces can freely emerge. So keep +it mind to put the cursor on a brace when you are thinking of changing a +complicated argument. + +@node Killing La@TeX{} commands, , Changing La@TeX{} commands, Changing and Deleting +@comment node-name, next, previous, up +@section Killing La@TeX{} commands +@cindex Killing La@TeX{} commands + + @kbd{[prefix] k} kills the La@TeX{} commands sometimes with their +arguments. Following table illustrates the correspondence of the invoking +position and what is killed. @example [Invoking position] [action] -\begin,\end line kill \begin,\end pairs -%BEGIN, %END line kill %BEGIN,%END pairs +\begin, \end line kill \begin,\end pairs +%#BEGIN, %#END line kill %#BEGIN,%#END pairs on a Section-type command kill section-type command on a parenthesis kill parentheses @end example +Note that when killing @code{\begin, \end} or @code{%#BEGIN, %#END} pair, +the lines @code{\begin, \end} or @code{%#BEGIN, %#END} exist will be +killed entirely. So take care not to create any line that contains more +than one @code{\begin} or so. + While all operations above are to kill `containers' which surround some text, universal argument (@kbd{C-u}) for these commands kills not only `containers' but also `contents' of them. See below as a sample. @@ -999,7 +1084,7 @@ ~(cursor) @end example -@node Filling an item, Local dictionaries, Changing and Deleting, Top +@node Filling an item, Updation of @code{\includeonly}, Changing and Deleting, Top @comment node-name, next, previous, up @chapter Filling an item @cindex filling an item @@ -1029,36 +1114,7 @@ for Emacs-Lisp, name a newcommand for `itemize' beginning with @code{\item} such as @code{\itembf}, not @code{\bfitem}. -@node Local dictionaries, Updation of @code{\includeonly}, Filling an item, Top -@comment node-name, next, previous, up -@chapter Local dictionaries -@cindex local dictionaries -@cindex nervous users - - Tables for completion consist of three dictionaries; `standard -dictionary' built in @file{yatex.el}, `user dictionary' for your common -private commands, and `local dictionary' that is effective in a certain -directory. - - When you input the command unknown to YaTeX at a completion in the -minibuffer, YaTeX asks you with the following prompt; - -@example - `foo' is not in table. Register into: U)serTable L)ocal N)one -@end example - -@noindent -In this menu, typing `u' updates your `user dictionary', `l' updates your -local dictionary, and `n' updates no dictionary and throws the word away. - - If you find this switching feature meaningless and bothersome, put the -next expression into your @file{~/.emacs} - -@lisp - (setq YaTeX-nervous nil) -@end lisp - -@node Updation of @code{\includeonly}, What column?, Local dictionaries, Top +@node Updation of @code{\includeonly}, What column?, Filling an item, Top @comment node-name, next, previous, up @chapter Updation of @code{\includeonly} @cindex includeonly @@ -1262,6 +1318,7 @@ @menu * Lisp variables:: * Add-in functions:: +* Add-in generator:: @end menu @node Lisp variables, Add-in functions, Customizations, Customizations @@ -1297,7 +1354,9 @@ Here are the customizable variables of yatex-mode. Each value setq-ed in @file{~/.emacs} is preferred and that of defined in @file{yatex.el} is -neglected. Parenthesized contents stands for the default value. +neglected. Parenthesized contents stands for the default value. When you +are to change some of these variables, see more detailed documentation of +the variable by @kbd{M-x describe-variable}. @defvar YaTeX-prefix Prefix key stroke (@kbd{C-c}) @@ -1435,6 +1494,18 @@ Disable [prefix] b ?? shortcut (@code{nil)} @end defvar +@defvar YaTeX-hilit-pattern-adjustment-private +List of the list that contain the regular expression and the symbol of +logical meaning of the string that matches the pattern. See also the +value from @code{(assq 'yatex-mode hilit-patterns-alist)} and the value of +@code{YaTeX-hilit-pattern-adjustment-default} (and even the document of +hilit19.el). +@end defvar + +@defvar YaTeX-sectioning-level +Alist of LaTeX's sectioning command vs its height. +@end defvar + @node Sample definitions, Hook variables, All customizable variables, Lisp variables @comment node-name, next, previous, up @subsection Sample definitions @@ -1482,16 +1553,385 @@ this file at the initialization of itself. Using @file{yatexhks.el} makes @code{yatex-mode-load-hook} unnecessary. -@node Add-in functions, , Lisp variables, Customizations +@node Add-in functions, Add-in generator, Lisp variables, Customizations @comment node-name, next, previous, up @section Add-in functions @cindex add-in functions +@cindex yatexadd.el You can easily define a function to input detailed arguments -with completion according to La@TeX{} environments or commands. To -know the way to define these functions, see also @file{yatexadd.doc} in -this package please. +with completion according to La@TeX{} environments or commands. +@c @node What is add-in functions?, , Add-in functions, Add-in functions +@comment node-name, next, previous, up +@subsection What is add-in functions? +@cindex tabular + + When you input @code{tabular} environment, don't you think ``I want +YaTeX to complete its argument toward my favorite one such as +@code{@{|c|c|c|@}}...''? Yes, you can define the function to complete +arguments for any environment and any La@TeX{} commands. + +@subsection Procedure + + Here is the procedure to define add-in functions. +@enumerate +@item +Define the function +@item +Put the function into @file{yatexhks.el} +@end enumerate + +@menu +* How the add-in function works?:: +* How the function is called:: +* Useful functions for creating add-in:: +* Contribution:: +@end menu + +@node How the add-in function works?, How the function is called, Add-in functions, Add-in functions +@comment node-name, next, previous, up +@subsection How the add-in function works? + + There are two kinds of add-in. @dfn{Option add-in} returns the +La@TeX{}'s optional parameters such as optional strings after +@code{\begin@{ENV@}}, optional strings between a section-type command +and its first argument, and optional strings just after type +maketitle-type command. The following illustrates the name of add-in +functions, where underlined strings are generated by add-in functions. + +@display +\begin{table}[ht] (Function name: YaTeX:table) + ~~~~ +\put(100,200){} (Function name: YaTeX:put) + ~~~~~~~~~ +\sum_{i=0}^{n} (Function name: YaTeX:sum) + ~~~~~~~~~~ +@end display + + Obviously, the function name is decided by concatenating the prefix +`YaTeX:' and La@TeX{} command's name. + + Another add-in type is @dfn{argument add-in}, which completes arguments +for section-type commands. + +@display +\newcommand{\foo}{bar} (Function name: YaTeX::newcommand) + ~~~~ ~~~ +@end display + + When the section-type command is inputted, the function named by +concatenating `YaTeX::' and section-type command, is called automatically +with an integer argument which indicates which argument of section-type +command is being read. Thus the add-in should determine the +job refering the value of its argument. + +@menu +* Defining `option add-in':: +* Defining `argument add-in':: +@end menu + +@node Defining `option add-in', Defining `argument add-in', How the add-in function works?, How the add-in function works? +@comment node-name, next, previous, up +@subsubsection Defining `option add-in' + + If you want @code{@{|c|c|c|@}} for all @code{tabular} environment, + +@lisp + (defun YaTeX:tabular () + "{|c|c|c|}") +@end lisp + +@noindent +is enough. If you want more complicated format, define as below. + +@lisp + (defun YaTeX:tabular () + "@{@@@{\\vrule width 1pt\\ @}|||@@@{\\ \\vrule width 1pt@}@}") +@end lisp + +@noindent +Note that the character @code{\} must be described as @code{\\} in +Emacs-Lisp. The next example reads the tabular format from keyboard. +@lisp + (defun YaTeX:tabular () + (concat "{" (read-string "Rule: ") "}")) +@end lisp + +@node Defining `argument add-in', , Defining `option add-in', How the add-in function works? +@comment node-name, next, previous, up +@subsubsection Defining `argument add-in' + + This section describes how to define the add-in function for +@code{\newcommand}. + + The first argument of @code{\newcommand} begins always with @code{\}. +The second argument is usually so complex that we can not edit them in the +minibuffer. Here is the created function considering this. + +@lisp + (defun YaTeX::newcommand (n) ;n is argument position + (cond + ((= n 1) ;1st argument is macro name + (read-string "Command: " "\\")) ;initial input `\' + ((= n 2) "") ;do nothing when reading arg#2 + (t nil))) +@end lisp + + Note that when the `argument add-in' function return `nil', normal +argument reader will be called. + +@node How the function is called, Useful functions for creating add-in, How the add-in function works?, Add-in functions +@comment node-name, next, previous, up +@subsection How the function is called + + YaTeX calls the add-in functions for specified begin-type, section-type, +and maketitle-type command, if any. `Option add-in' functions for +begin-type are called when @code{\begin@{ENV@}} has been inserted, +functions for section-type are called just before input of the first +argument, and functions for maketitle-type is called after maketitle-type +command has been inserted. `Argument add-in' functions are called at each +entry of arguments for section-type commands. + +@node Useful functions for creating add-in, Contribution, How the function is called, Add-in functions +@comment node-name, next, previous, up +@subsection Useful functions for creating add-in + + Many add-in functions for typical La@TeX{} commands are defined in +@file{yatexadd.el}. Those are also useful as references. Here are the +short descriptions on useful functions, where [F] means function, [A] +means arguments, [D] means description. + +@itemize +@item [F] +YaTeX:read-position +@itemx [A] +Character list which can show up in the brackets +@itemx [D] + Return the location specifier such as `[htb]'. When +nothing is entered, omit [] itself. If the possible characters +are "htbp", call this function as +@code{(YaTeX:read-position "htbp")} + +@item [F] +YaTeX:read-coordinates +@itemx [A] +Base prompt, X-axis prompt, Y-axis prompt (each optional) +@itemx [D] + Read the coodinates with the prompt ``BasePrompt X-axisPrompt:'' for +X-axis, ``BasePrompt Y-axisPrompt:'' for Y-axis, and return it in the form +of ``(X,Y)''. The default prompts are @code{Dimention}, @code{X}, +@code{Y} respectively. + +@item [F] +YaTeX:check-comletion-type +@itemx [A] +One of the symbols: 'begin, 'section, or 'maketitle +@itemx [D] + Check the current completion type is specified one and cause error if +not. The variable @code{YaTeX-current-completion-type} holds the symbol +according to the current completion type. +@end itemize + +@node Contribution, , Useful functions for creating add-in, Add-in functions +@comment node-name, next, previous, up +@subsection Contribution + + If you make your own pretty function and you let it be in public, please +send me the function. I'm going to include it in the next release. + +@node Add-in generator, , Add-in functions, Customizations +@comment node-name, next, previous, up +@section Add-in generator + + First, don't forget to read the section of add-in functions @ref{Add-in +functions}. If you easily understand how to define them, there's no need +to read this section. But being not familiar with Emacs-Lisp, when you +don't have clear idea what to do, this section describes how to get YaTeX +make add-in function. + + There are two methods of generation. One is for fully interactive +generator for beginners and another requires little knowledge of +Emacs-Lisp. + +@subsection Generator for beginners + The former generator is called by +@center @kbd{M-x YaTeX-generate} + +@noindent +strokes. All you have to do is follow the guidances. Defying them may cases +the disaster (I wonder what is it???). So when you make some mistake, it +is recommendable to type @kbd{C-g} and start afresh. + +@subsection Simple generator + + The latter generator is invoked by the next sequence. +@center @kbd{M-x YaTeX-generate-simple} +This generator can make both ``option add-in'' and ``argument add-in'' +(@emph{refer the section add-in functions} +@ref{How the add-in function works?}), whereas @code{YaTeX-generate} +cannot make ``argument addin''. + + For example, assume you have the LaTeX command as follows. + +@example + \epsinput[t](250,50){hoge.eps}{plain}{Picture of foo} + (A) (B) (1) (2) (3) + (A)Optional parameter to specify the position + One of t(top), b(bottom), l(left), r(right) + (B)Maximum size of frame + (1)1st argument is filename of EPS file + (2)2nd argument indicates + plain do nothing + frame make frame around image + dframe make double-frame around image + for included EPS file. + (3)Caption for the picture +@end example + + Now get start with generation. Typing @kbd{M-x YaTeX-generate-simple} +brings the prompt: +@display + (O)ption? (A)rgument? +@end display + +@subsubsection Generating ``option add-in'' +@cindex option add-in + + Since (A), (B) above are optional argument, all we have to do to +complete them is define the option add-in for them. Let's generate the +function to complete (A). + +@display + M-x YaTeX-generate-simple RET + epsinput RET + o +@end display + +@noindent +Typing as above leads the next prompt. + +@display +Read type(1): (S)tring (C)omplete (F)ile ([)option (P)osition co(O)rd. (q)uit +@end display + +@noindent + This asks that ``Which type is the completion style of 1st argument?''. +Here are the possible completion style. + +@table @code +@item String +read plain string +@item Complete +read with completion +@item File +read file name +@item Option +read optional string (if string omitted, omit [] too) +@item Position +read positional option (like [htbp]) +@item Coord. +read coodinates +@item Quit +quit from genarating +@end table + + Since (A) is the optional argument to specify the location of included +EPS file, the completion style is @code{Position}, and the possible +characters are t, b, l, and r. To tell these information to generator, +operate as follows. + +@display + Read type(1).... p + Acceptable characters: tblr RET +@end display + + (B) is coordinate. So its completion style is coOrd. We want a prompt +meaning ``Maximum size'' when completion. + +@display + Read type(2).... o + Prompt for coordinates: Max size RET +@end display + + That's all for optional argument. Select quit. + +@display + Read type(3).... q +@end display + + Then the generated option add-in function for \epsinput will be shown in +the next window. + +@subsubsection Generating ``argument add-in'' +@cindex argument add-in + + Next, create the argument add-in. The arguments for \epsinput are EPS +file name, framing style, and caption string in sequence. + +@display + M-x YaTeX-generate-simple RET + epsinput RET + a +@end display + + Above key strokes bring the prompt that asks the number of argument. +Answer it with 3. + +@display + How many arguments?: 3 RET +@end display + + Then the generator asks the completion style and prompt for completion. +Answer them. @kbd{f} for FileName and prompt string. + +@display + Read type(1).... f + Prompt for argument#1 EPS file name RET +@end display + + The second argument is one of selected symbol. So the completion type +is @code{Completion}. + +@display + Read type(2).... c + Prompt for argument#2 Include style RET +@end display + + Then all the candidates ready to be read. Type single RET after +entering all. + +@display + Item[1](RET to exit): plain RET + Item[2](RET to exit): frame RET + Item[3](RET to exit): dframe RET + Item[4](RET to exit): RET +@end display + + The following prompt asks whether the entered string must belong to +candidates or not. In this case, since the argument must be one of +@code{plain}, @code{frame}, and @code{dframe}, type @code{y}. + +@display + Require match? (y or n) y +@end display + + The last argument is the caption string for which any completion is +needed. + +@display + Read type(3).... s + Prompt for argument#3 Caption RET + default: Figure of RET +@end display + + Finally we'll get the argument add-in in the next window. + +@subsection Contribution + + If you get your own pretty function and you let it be in public, please +steel yourself in the happy atomospher and do not send me the function. +I do know it is not fine because it is generated by yatexgen:-p. @node Etcetera, Copying, Customizations, Top @comment node-name, next, previous, up @@ -1514,7 +1954,7 @@ as a result of using this software. However, any reports and suggestions are welcome as long as I feel interests in this software. My possible e-mail address is `yuuji@@ae.keio.ac.jp'. -(up to Mar.1993 at least) +(up to Mar.1995 at least) The specification of this software will be surely modified (depending on my feelings) without notice :-p. diff -r a0640ff3f72f -r eb0512bfcb7f docs/yatexj.tex --- a/docs/yatexj.tex Mon Oct 31 17:49:43 1994 +0000 +++ b/docs/yatexj.tex Fri Nov 25 08:26:13 1994 +0000 @@ -25,15 +25,15 @@ * Main features:: 主な機能 * Installation:: インストール * Invocation:: 外部コマンドの起動 -* %#記法:: +* %#notation :: %#記法 * Completion:: 補完入力 +* Local dictionary:: ローカル辞書 * Commenting out:: コメントアウト * Cursor jump:: カーソルジャンプ * Modifying/Deleting:: 変更/削除 * Filling item:: itemの桁揃え -* Local dictionary:: ローカル辞書 * Includeonly:: 勝手にincludeonly -* Where am I?:: +* What column:: ここはどこ? * Intelligent newline:: おまかせ改行 * Online help:: オンラインヘルプ * Cooperation with other packages:: 他パッケージとの連携 @@ -57,6 +57,7 @@ ストの編集を支援します。さらに La@TeX{} コマンドのオンラインヘルプに よりマニュアルを調べる手間を軽減します。 + English manual @xref{Top, , , yatexe,YaTeX English info} @node Main features, Installation, Intro, Top @comment node-name, next, previous, up @@ -71,7 +72,8 @@ コマンドの補完入力 (@kbd{C-c b}, @kbd{C-c s}, @kbd{C-c l}, @kbd{C-c m}) @item 既に入力したテキストを環境やコマンド引数の中に取り込む括り補完 -(@kbd{C-u} 通常補完キー) +(@kbd{C-u} +通常補完キー) +@item セクション区切り入力時の文書構造アウトライン表示 @item 補完辞書の学習 @item La@TeX{} の環境やコマンドに応じたガイド付き引数入力 @item 野鳥にないガイド付き引数入力関数の自動生成(@file{yatexgen.el}) @@ -119,7 +121,7 @@ に変わります。 -@node Invocation, %#記法, Installation, Top +@node Invocation, %#notation , Installation, Top @comment node-name, next, previous, up @chapter latexコマンド起動 @cindex prefix key @@ -164,9 +166,9 @@ タイプセッタを起動すると、編集ウィンドウが2つに分割され、片方のウィンド ウにタイプセット画面が表示されます。出力されるメッセージと連動しタイプセッ トバッファは自動的にスクロールします。もし、途中でエラーが起こって止まって -しまった場合にはタイプセットバッファに移り、(@kbd{^Xo}) タイプセッタの出し -ている ? プロンプトに対して、@kbd{x} (処理の中断)などの指示を送ることがで -きます。エラーを修正する場合は、 +しまった場合にはタイプセットバッファに移り、(@kbd{C-x o}) タイプセッタの出 +している ? プロンプトに対して、@kbd{x} (処理の中断)などの指示を送ることが +できます。エラーを修正する場合は、 @table @kbd @item [prefix] ' @@ -207,7 +209,7 @@ @end table @cindex ページ確認省略lpr起動[へえしかくにんしようりやくlprきとう] -@node %#記法, Completion, Invocation, Top +@node %#notation , Completion, Invocation, Top @comment node-name, next, previous, up @chapter %#記法 @@ -222,7 +224,7 @@ * Editing %# notation:: %#記法の編集 @end menu -@node Changing typesetter, Splitting input files, %#記法, %#記法 +@node Changing typesetter, Splitting input files, %#notation , %#notation @comment node-name, next, previous, up @section タイプセット用コマンド変更 @@ -238,7 +240,7 @@ @cindex タイプセッタの使い分け[たいふせつたのつかいわけ] -@node Splitting input files, Fix region for typesetting, Changing typesetter, %#記法 +@node Splitting input files, Fix region for typesetting, Changing typesetter, %#notation @comment node-name, next, previous, up @section 入力ファイル分割 @@ -259,7 +261,7 @@ @cindex ghostview @example - %#!jlatex main ; dvi2ps main.dvi > main + %#!jlatex main ; dvi2ps main.dvi > main @end example なお、この行の最後の単語のピリオド以前を「メインファイル」のベース @@ -284,7 +286,7 @@ -@node Fix region for typesetting, lpr format, Splitting input files, %#記法 +@node Fix region for typesetting, lpr format, Splitting input files, %#notation @comment node-name, next, previous, up @section 領域の固定 @cindex 固定領域のタイプセット[こていりよういきのたいふせつと] @@ -296,9 +298,9 @@ すが、必ず決まった領域をタイプセットしたい場合は、その領域を @example - %#BEGIN - <渡したい領域> - %#END + %#BEGIN + <渡したい領域> + %#END @end example @noindent @@ -335,10 +337,10 @@ の消し忘れには十分ご注意下さい。 @cindex 長いファイルの編集[なかいふあいるのへんしゆう] -@node Require, lpr format, Fix region for typesetting, %#記法 +@node Require, lpr format, Fix region for typesetting, %#notation @comment node-name, next, previous, up -@node lpr format, Editing %# notation, Fix region for typesetting, %#記法 +@node lpr format, Editing %# notation, Fix region for typesetting, %#notation @comment node-name, next, previous, up @section lprフォーマット @cindex lprふぉーまっと[lprふおおまつと] @@ -383,7 +385,7 @@ @noindent などとするのも便利かもしれません。 -@node Editing %# notation, , lpr format, %#記法 +@node Editing %# notation, , lpr format, %#notation @comment node-name, next, previous, up @section %#記法自体の編集 @cindex %#きほうじたいのへんしゅう[%#きほうしたいのへんしゆう] @@ -410,7 +412,7 @@ @code{%#BEGIN}, @code{%#END} が自動的に消去されます。 @cindex lprフォーマットの変更[lprふおおまつとのへんこう] -@node Completion, Commenting out, %#記法, Top +@node Completion, Local dictionary, %#notation , Top @comment node-name, next, previous, up @chapter 補完入力 @@ -552,7 +554,7 @@ で実行します。@kbd{[prefix] s} を入力するとミニバッファに、 @example - (C-v for view) \???@{@} (default documentstyle): + (C-v for view-section) \???@{@} (default documentstyle): @end example @noindent @@ -562,7 +564,7 @@ る補完機能が有効です。 次に、@{@}の中身の入力を促す、 @example - \section@{???@}: + \section@{???@}: @end example @noindent @@ -570,30 +572,30 @@ たとえば、 @example - (C-v for view) \???@{@} (default documentstyle): section - \section@{???@}: 目的 + (C-v for view-section) \???@{@} (default documentstyle): section + \section@{???@}: 目的 @end example @noindent のように入力した場合は、文章中に @example - \section@{目的@} + \section@{目的@} @end example @noindent が挿入され、 @example - (C-v for view) \???@{@} (default section): vspace* - \vspace*@{???@}: + (C-v for view-section) \???@{@} (default section): vspace* + \vspace*@{???@}: @end example @noindent のように@{@}の中身を省略したときは、 @example - \vspace*@{@} + \vspace*@{@} @end example @noindent @@ -601,13 +603,12 @@ @menu * 2個以上の引数をとる section型コマンド:: -* Input argument without copletion:: 引数入力時に補完しない * Enclose region-type command:: * Recursive completion:: 再帰補完 * view-sectioning:: セクション区切りのアウトライン表示 @end menu -@node 2個以上の引数をとる section型コマンド, Input argument without copletion, section型補完, section型補完 +@node 2個以上の引数をとる section型コマンド, Enclose region-type command, section型補完, section型補完 @comment node-name, next, previous, up @subsection 2個以上の引数をとる section型コマンド @cindex 引数[ひきすう] @@ -625,7 +626,7 @@ と section 型補完を呼び出した後、 @example - (Ctrl-v for view) \???@{@} (default vspace*): addtolength + (Ctrl-v for view-section) \???@{@} (default vspace*): addtolength \addtolength@{???@}: \topmargin Argument 2: 8mm @end example @@ -640,19 +641,8 @@ す。 @cindex 引数の個数を変える[ひきすうのこすうをかえる] -@node Input argument without copletion, Enclose region-type command, 2個以上の引数をとる section型コマンド, section型補完 -@comment node-name, next, previous, up -@subsection 引数入力時に補完しない -@cindex 引数入力時に補完しない[ひきすうにゆうりよくしにほかんしない] - なお、特別な例として引数0を指定すると、第一引数の入力時に補完入力ではな -く、単純な文字列入力を使用するようになります。段落を指定する@samp{chapter} -や @samp{section}などは第一引数の段落タイトル入力時に、スペースを含めるこ -とがあるので、補完入力は却ってじゃまになります。標準設定では、これらの段落 -指定コマンド(chapter, section, paragraph など)に引数0の指定が埋め込まれて -います。 - -@node Enclose region-type command, Recursive completion, Input argument without copletion, section型補完 +@node Enclose region-type command, Recursive completion, 2個以上の引数をとる section型コマンド, section型補完 @comment node-name, next, previous, up @subsection 既に書いたテキストを括る @cindex 括る[くくる] @@ -705,7 +695,7 @@ がlarge型補完の開始です。@kbd{[prefix] l} を押すと、ミニバッファに @example - @{\??? @} (default large): + @{\??? @} (default large): @end example @noindent @@ -796,7 +786,7 @@ を押すと、ミニバッファに @example - 1:` 2:' 3:^ 4:" 5:~ 6:= 7:. u v H t c d b + 1:` 2:' 3:^ 4:" 5:~ 6:= 7:. u v H t c d b @end example @noindent @@ -804,14 +794,14 @@ して下さい。すると編集バッファに、 @example - \`@{@} + \`@{@} @end example @noindent があらわれ、カーソルが@{@}内に位置するので、さらに一文字入力する事で、 @example - \`@{o@} + \`@{o@} @end example @noindent @@ -859,15 +849,15 @@ に表示されたなら、そこでイメージ入力を止めて次の編集動作に移っても 構いません。 - 数式環境中で@samp{;}自身を入力するには@kbd{};;」のようにします。イメージ +@cindex ;自身[;ししん] + 数式環境中で@samp{;}自身を入力するには@kbd{;;}のようにします。イメージ 入力の途中でTABを押すと、それまで入力した文字で始まるもの一覧が表示されま す。ここで目的の La@TeX{} コマンドまでカーソルを移動し再度TABを押すことで その La@TeX{} コマンドがバッファに挿入されます。 -@cindex ;自身[;ししん] どのキー入力にどの記号が対応しているか全て知りたい時は、@kbd{;}を押した -直後にリターンキーを押してください。以下の例は、@kbd{;<}と押した後にTAB -を押したものです。 +直後にTABを押してください。以下の例は、@kbd{;<}と押した後にTABを押したもの +です。 @example KEY LaTeX sequence sign @@ -900,8 +890,8 @@ もう一つ、数式環境中で@kbd{/}を押すとギリシャ文字入力モードに入ります。 @kbd{/}を押した直後に@kbd{a}を押すと@code{\alpha}が、@kbd{g} を押すと @code{\gamma}が、などアルファベットに対応したギリシャ文字が挿入されます。 -操作方法は;の数式記号補完とまったく同じです。まずは@kbd{/}の直後にリターン -キーを押してどのアルファベットにどのギリシャ文字が対応しているか調べてみて +操作方法は;の数式記号補完とまったく同じです。まずは@kbd{/}の直後に +TABを押してどのアルファベットにどのギリシャ文字が対応しているか調べてみて ください。 @kbd{;}と@kbd{/}を数式環境中で押しているにもかかわらず、イメージ補完が働 @@ -909,7 +899,42 @@ とにより、強制的にイメージ補完に入ることができます。また、この時にどのよう な状態で数式環境内判定に失敗したかをご連絡下さい。 -@node Commenting out, Cursor jump, Completion, Top +@node Local dictionary, Commenting out, Completion, Top +@comment node-name, next, previous, up +@chapter ローカル辞書 +@cindex ローカル辞書[ろおかるししよ] +@cindex .yatexrc +@cindex 変な単語[へんなたんこ] + + 補完入力用の候補は三種類の辞書から構成されています。一つは +@file{yatex.el}に組み込まれた「標準辞書」、もう一つはユーザが個人的に常用 +するコマンドを保存する「ユーザ辞書」、そしてもうひとつはあるディレクトリで +のみ有効なコマンドを保存する「ローカル辞書」です。 + + 補完入力時に新しい単語を入れた場合に、その単語をどの辞書に入れるか聞いて +来ます。 + +@example + `foo' is not in table. Register into: U)serTable L)ocal N)one +@end example + +@noindent +というプロンプトに対し、@kbd{u}と答えると「ユーザ辞書」を、@kbd{l}と答える +とローカル辞書を更新することになり、@kbd{n}と答えると新たな単語を学習せず +に捨てることになります。 + + もし、ローカル辞書の機能はいらず、全てユーザ辞書の更新のみでよいと言う場 +合には@file{~/.emacs}などで、 +@cindex YaTeX-nervous + +@lisp + (setq YaTeX-nervous nil) +@end lisp + +@noindent +として下さい。 + +@node Commenting out, Cursor jump, Local dictionary, Top @comment node-name, next, previous, up @chapter コメントアウト @cindex コメントアウト[こめんとあうと] @@ -990,18 +1015,20 @@ を押すことにより、カーソル位置のLa@TeX{}コマンドに対応する場所にジャンプ します。対応関係が存在すると解釈されるコマンドには以下のものがあります。 -@table +@itemize @bullet @item @code{\begin@{@}}←→@code{\end@{@}} @item @code{%#BEGIN}←→@code{%#END} @item @code{\label@{@}}←→@code{\ref@{@}} @item @code{\include(\input)}→対応するファイル @item @code{\bibitem@{@}}←→@code{\cite@{@}} -@end table +@end itemize - @code{\begin@{@}} か @code{\end@{@}} の行で@kbd{[prefix] g} -を押すことにより、対応する@code{end/begin}の行にジャンプします。もちろん対 -応するものがない場合はエラーになります。またこれは、領域固定のための -@code{%#BEGIN} と @code{%#END} のペアに対しても同様に動作します。 + @code{\begin@{@}} か @code{\end@{@}} の行で@kbd{[prefix] g}を押すことに +より、対応する@code{end/begin}の行にジャンプします。もちろん対応するものが +ない場合はエラーになります。またこれは、領域固定のための @code{%#BEGIN} と +@code{%#END} のペアに対しても同様に動作します。なお、@code{label/ref}や +@code{cite/bibitem}対応するものが別ファイルにある時は、ジャンプ先となるファ +イルがオープンされていなければなりません。 @xref{%#記法} メインの .tex ファイルの @code{\include{chap1}} などにカーソルを合わせ、 @@ -1020,6 +1047,12 @@ オープンしていない場合は、カレントディレクトリから探して自動的にオープンし ます。さらに現在の環境を単位として機能するコマンドに以下のものがあります。 +@cindex 環境の先頭へ[かんきようのせんとうへ] +@cindex 環境の末尾へ[かんきようのまつひへ] +@cindex 環境をマーク[かんきようをまあく] +@cindex M-C-a +@cindex M-C-e +@cindex M-C-@@ @table @kbd @item M-C-a @dots{} 環境の先頭(@code{\begin})へジャンプ @@ -1028,12 +1061,6 @@ @item M-C-@@ @dots{} 環境全体をマーク @end table -@cindex 環境の先頭へ[かんきようのせんとうへ] -@cindex 環境の末尾へ[かんきようのまつひへ] -@cindex 環境をマーク[かんきようをまあく] -@cindex M-C-a -@cindex M-C-e -@cindex M-C-@@ 上記のコマンドは通常の@kbd{[prefix]}キーではなく@kbd{META}キーをプリフィク スとして機能するのでご注意下さい。 @@ -1061,23 +1088,56 @@ これらのコマンドは、コマンドを起動する場所によって動作を決定するので注意し て下さい。 -@kbd{[prefix] c} は、@code{\begin@{@}} または @code{\end@{@}} のある場所で -起動すると、環境名の変更を行います。@kbd{[prefix] k} は起動する位置により +@menu +* Changing LaTeX command:: La@TeX{} コマンドの変更 +* Killing LaTeX command:: La@TeX{} コマンドの削除 +@end menu + +@node Changing LaTeX command, Killing LaTeX command, Modifying/Deleting, Modifying/Deleting +@comment node-name, next, previous, up +@section La@TeX{} コマンドの変更 + +変更したい La@TeX{} コマンドにカーソルを合わせて @kbd{[prefix] c} +を押すとそのコマンドを補完入力などを用いて手軽に変えることができます。 +@kbd{[prefix] c} で変更できるコマンドには以下のものがあります。 + +@itemize +@item @code{begin/end} の環境名 +@item section型コマンドのコマンド名 +@item section型コマンドの引数 +@item section型コマンドのオプションパラメータ([]で囲まれたもの) +@item large型コマンド +@end itemize + + 変えたいsection型コマンドの引数がさらに La@TeX{} コマンドを含む場合は、 +その引数を囲む中括弧の上で @kbd{[prefix] c} を押すことで中のコマンドを変更 +対象判定から除外することができます。 + +@cindex 環境名の変更[かんきようめいのへんこう] + +@node Killing LaTeX command, , Changing LaTeX command, Modifying/Deleting +@comment node-name, next, previous, up +@section La@TeX{} コマンドの削除 + +@kbd{[prefix] k} は起動する位置により 次のような動作を行います。 -@cindex 環境名の変更[かんきようめいのへんこう] @cindex 環境の削除[かんきようのさくしよ] @example 起動位置 動作 -\begin\endの行 @code{\begin\end}ペアの削除 -%BEGIN, %END の行 %BEGIN,%ENDペアの削除 +\begin, \endの行 @code{\begin\end}ペアの削除 +%#BEGIN, %#END の行 %#BEGIN,%#ENDペアの削除 section型コマンドの上(中) section型コマンドの削除 フォント指定括弧の上 フォント指定の削除 括弧の上 対をなす括弧の削除 @end example @noindent +@code{\begin, \end} および @code{%#BEGIN, %#END} を削除する場合、 +@code{\begin, \end} や @code{%#BEGIN, %#END} の存在する行は +まるごと削除されるので、それらの一行に @code{\begin} などを二つ以上連ねて +書かないように注意してください。 上記のものはすべて本文を囲う「容器」を削除するように働きますが、 universal-argument (@kbd{C-u}) を打った後で@kbd{[prefix] k}をタイプすると、 それぞれの「容器」に含まれる「中身」も一気に削除します。以下の例を参考にし @@ -1089,7 +1149,7 @@ ↑(カーソル位置) @end example -@node Filling item, Local dictionary, Modifying/Deleting, Top +@node Filling item, Includeonly, Modifying/Deleting, Top @comment node-name, next, previous, up @chapter itemの桁揃え @cindex itemの桁揃え[itemのけたそろえ] @@ -1103,17 +1163,17 @@ @dots{} itemの桁揃え @end table +@cindex NTT-jTeX[えぬていいていいしえいてつく] @noindent によって、その item のインデントの深さに応じて fill されます。なお、NTT jTeX を使用している場合には、Lisp 変数@code{NTT-jTeX}を@code{t}にセットし て下さい。 -@cindex NTT-jTeX[えぬていいていいしえいてつく] +@cindex YaTeX-item-regexp このとき、変数@code{YaTeX-item-regexp}の値(標準では @code{"\\\\item"})を 項目指定コマンドの正規表現として検索に使用します。itemize 環境で、独自のコ マンドを定義して項目を列挙している場合(例えば@code{\underlineitem})は、 @file{~/.emacs} で次のように指定して下さい。 -@cindex YaTeX-item-regexp @lisp (setq YaTeX-item-regexp @@ -1124,42 +1184,7 @@ この変数の指定の仕方がよく分からない場合は、独自の項目列挙コマンドの名前を @code{@code{"\item"}で始まるものにして下さい(例えば"\itembf"})。 -@node Local dictionary, Includeonly, Filling item, Top -@comment node-name, next, previous, up -@chapter ローカル辞書 -@cindex ローカル辞書[ろおかるししよ] -@cindex .yatexrc -@cindex 変な単語[へんなたんこ] - - 補完入力用の候補は三種類の辞書から構成されています。一つは -@file{yatex.el}に組み込まれた「標準辞書」、もう一つはユーザが個人的に常用 -するコマンドを保存する「ユーザ辞書」、そしてもうひとつはあるディレクトリで -のみ有効なコマンドを保存する「ローカル辞書」です。 - - 補完入力時に新しい単語を入れた場合に、その単語をどの辞書に入れるか聞いて -来ます。 - -@example - `foo' is not in table. Register into: U)serTable L)ocal N)one -@end example - -@noindent -というプロンプトに対し、@kbd{u}と答えると「ユーザ辞書」を、@kbd{l}と答える -とローカル辞書を更新することになり、@kbd{n}と答えると新たな単語を学習せず -に捨てることになります。 - - もし、ローカル辞書の機能はいらず、全てユーザ辞書の更新のみでよいと言う場 -合には@file{~/.emacs}などで、 - -@lisp - (setq YaTeX-nervous nil) -@end lisp -@cindex YaTeX-nervous - -@noindent -として下さい。 - -@node Includeonly, Where am I?, Local dictionary, Top +@node Includeonly, What column, Filling item, Top @comment node-name, next, previous, up @chapter 勝手にincludeonly @cindex 勝手にincludeonly[かつてにincludeonly] @@ -1181,9 +1206,9 @@ @end example @noindent -と書き直さなければなりませんが、野鳥では現在編集しているファイル名がメイン -ファイルの@code{\includeonly}にない場合には自動的にこれを検出し、次の指示 -を仰ぎます。 +と書き直さなければならず手間がかかります。野鳥では現在編集しているファイル +名がメインファイルの@code{\includeonly}にない場合には自動的にこれを検出し、 +次の指示を仰ぎます。 @example A)dd R)eplace %)comment? @@ -1195,10 +1220,10 @@ @code{\includeonly} の行をコメントアウトして無効化したい時には、@kbd{%}を それぞれ押して下さい。 -@node Where am I?, Intelligent newline, Includeonly, Top +@node What column, Intelligent newline, Includeonly, Top @comment node-name, next, previous, up -@chapter 今はどこ? -@cindex 今はどこ?[いまはとこ] +@chapter ここはどこ? +@cindex ここどこ?[ここはとこ] @cindex prefix & @cindex 複雑なtabular[ふくさつなtabular] @@ -1228,10 +1253,10 @@ を押すとカーソル位置のカラムがどの項目に該当するかをミニバッファに表示しま す。tabular/array環境の第1行目を項目名の並びとみなして対応するものを探しま -す。もし項目名として別のものを与えたい場合は、行頭を@code{%}にしてダミーの -項目並びを作っておくと良いでしょう。 +す。もし項目名として別のものを表示して欲しい場合は、行頭を@code{%}にしてダ +ミーの項目並びを作っておくと良いでしょう。 -@node Intelligent newline, Online help, Where am I?, Top +@node Intelligent newline, Online help, What column, Top @comment node-name, next, previous, up @chapter おまかせ改行 @cindex おまかせ改行[おまかせかいぎょう] @@ -1247,7 +1272,7 @@ @noindent を押すと、その環境に応じた行エントリを次の行に挿入します。例えば、tabular -環境では、その環境のカラム数に対応した個数の @code{&} にくわえ、行末の +環境では、その環境のカラム数に対応した個数の @code{&} に加え、行末の @code{\\} を入れます。この時それ以前に @code{\hline} があればそれも付け加 えます。環境とそれに応じて自動入力するものの対応は以下のようになります。 @@ -1298,6 +1323,8 @@ @section オンラインヘルプ @cindex グローバルヘルプ[くろおはるへるふ] @cindex プライベートヘルプ[ふらいへえとへるふ] +@cindex YaTeX-help-file +@cindex YaTeX-help-file-private 「オンラインヘルプ」は、一般的な La@TeX{} コマンド(デフォルトでカーソル 位置のコマンド)に対する説明を隣のバッファに表示します。この時参照されるヘ @@ -1309,8 +1336,6 @@ クロ定義に関する説明が書かれているファイルで、変数 @code{YaTeX-help-file-private}の値で指定されます。こちらはユーザのホームディ レクトリの下などに置かれます。 -@cindex YaTeX-help-file -@cindex YaTeX-help-file-private @section オンラインapropos @@ -1387,7 +1412,8 @@ yatex-mode における次の変数がカスタマイズ可能です。@file{~/.emacs} で @code{setq} しておけば、そちらの定義が優先されます。括弧の中はデフォルト値 -です。 +です。実際に変数の値を変更する場合は @kbd{M-x describe-variable} で +変数の詳細な説明を参照してください。 @defvar YaTeX-prefix yatex-mode 中のプリフィクスキー(@kbd{C-c}) @@ -1529,6 +1555,14 @@ 入力に入る(@kbd{nil}) @end defvar +@defvar YaTeX-hilit-pattern-adjustment-private +正規表現とそれにマッチするものの論理的意味をシンボルであらわしたものの +リスト…のリスト。hilit19 を組み込んでいる時のみ有効。 +詳しくは @code{(assq 'yatex-mode hilit-patterns-alist)} +した結果と、変数 @code{YaTeX-hilit-pattern-adjustment-default} の値(と場合 +によっては hilit19 のドキュメント)を参照せよ。 +@end defvar + @node Sample definitions, Hook variables, All customizable variables, Lisp variables @comment node-name, next, previous, up @subsection カスタマイズ変数設定例 @@ -1619,8 +1653,8 @@ しません。常識的に扱ってください。また、使用している旨をメイルでお知らせい ただくと、作者は喜んでサポートに励むことでしょう(ほんとか)。 - 苦情、希望、バグ報告、感想等、作者が本プログラムに興味を持ってい -る間に限り受け付けます。連絡は pcs39334@@asciinet.or.jp または、 + 苦情、希望、バグ報告、感想等は歓迎いたします。 +連絡は pcs39334@@asciinet.or.jp または、 yuuji@@ae.keio.ac.jpまで(1995年3月現在)。 仕様は、予告なく確実に(気分次第で)変更されます:-p。 diff -r a0640ff3f72f -r eb0512bfcb7f help/YATEXHLP.jp --- a/help/YATEXHLP.jp Mon Oct 31 17:49:43 1994 +0000 +++ b/help/YATEXHLP.jp Fri Nov 25 08:26:13 1994 +0000 @@ -1161,9 +1161,25 @@ 新しいページを開始し、\textwidthのBOXをparboxで作成する。 二段組みページでぶち抜きタイトルを作成する時に用いるとよい。 +LaiTeX +a Little Assistant Interface for TeX +おそらくあなたが今 Vz 上で使っているこのモード。 +LaTeXを効率的に使うための多くの機能を盛り込んでいます。 + +【発音について】 + +laitex.defなどプログラムを指す時は「らいてっく」、システムを指す時は「ら +いちょう」と読みます。 + +【補足】 +「雷鳥」の旧仮名遣いは「らいてう」だそうです。 + +laitex + + YaTeX (setq auto-mode-alist (cons '("\\.tex$" . yatex-mode) auto-mode-alist)) -おそらくあなたが今使っているこのモード。 +おそらくあなたが今 Emacs で使っているこのモード。 LaTeXを効率的に使うための多くの機能を盛り込んでいます。 【発音について】 diff -r a0640ff3f72f -r eb0512bfcb7f yatex.el Binary file yatex.el has changed diff -r a0640ff3f72f -r eb0512bfcb7f yatex.new --- a/yatex.new Mon Oct 31 17:49:43 1994 +0000 +++ b/yatex.new Fri Nov 25 08:26:13 1994 +0000 @@ -1,13 +1,31 @@ - Yet Another tex-mode for Emacs - yatex.el 各バージョンの変更点について。 + What's new in YaTeX + yatex.el 各バージョンの変更点について + +1.54 section 型コマンドの引数のデフォルトの入力には通常の文字列入力を + 行うようにし、変数 user-article-table を廃止した。これにより + Emacs-19(Mule2) でのデフォルトのヘルプファイルの格納場所をetcディ + レクトリから、site-lisp ディレクトリに変更した(注意!!)。 + ~/.yatexrc に任意の elisp を入れておいても消えないようになった。 + documentstyle のアドイン関数を充実させ、スタイルオプションやスタ + イルの学習を行うようにした。 + ユーザ辞書も新単語の入力と同時に更新するようにし、kill-emacs を + トラップするのをやめた。 + [prefix] c で section 型コマンドとその引数/オプション、large型 + コマンドを変更できるようにした。 + 数式モード自動判定時にコメントアウトされた $ は数えないようにし + た。また、変数 YaTeX-verbatim-environments を用意し、LaTeX コマ + ンドが無効となる環境名のリストを列挙できるようにした。 + YaTeX-hilit-pattern-adjustment-private で独自カラーを定義可能に。 + YaTeX-sectioning-level で独自に定義したセクション区切りコマンド + を登録してもうまく動作するようにした。 1.53 Emacs-19で新単語の更新がうまくいかなかったのを今度こそ直した。 ref/labelジャンプで別のバッファのref/labelに飛べるようにした。 ref/labelジャンプと同形式でcite/bibitem間で飛べるようにした。 cite/bibitemのアドイン関数の追加。 -1.52 外部プロセス用テンポラリバッファが別frameにある時には現frameにテ - ンポラリバッファをpopupしないようにした。 +1.52 外部プロセス用テンポラリバッファが別 frame にある時には現 frame + にテンポラリバッファを popup しないようにした。 Hilightening に独自のタグを導入し、reverseVideo がON/OFFの時両方 に対応した。 Emacs-19で新単語の更新がうまくいかなかったのを直した。 diff -r a0640ff3f72f -r eb0512bfcb7f yatex19.el --- a/yatex19.el Mon Oct 31 17:49:43 1994 +0000 +++ b/yatex19.el Fri Nov 25 08:26:13 1994 +0000 @@ -1,13 +1,13 @@ ;;; -*- Emacs-Lisp -*- ;;; YaTeX facilities for Emacs 19 ;;; (c )1994 by HIROSE Yuuji.[yuuji@ae.keio.ac.jp] -;;; Last modified Fri Sep 23 04:30:27 1994 on figaro +;;; Last modified Mon Nov 21 21:52:16 1994 on figaro ;;; $Id$ -;;; $B$H$j$"$($:(B hilit19 $B$r;H$C$F$$$k;~$K?'$,IU$/$h$&$K$7$F(B -;;; $B%a%K%e!<%P!<$G$4$K$g$4$K$g$G$-$k$h$&$K$7$?$@$1!#(B -;;; $B$$$C$?$$C/$,%a%K%e!<%P!<;H$C$F(BLaTeX$B%=!<%9=q$/$s$@$m$&$+(B? -;;; $B$^$"$$$$$dN}=,N}=,!#8e$m$NJ}$K$A$g$C$H%3%a%s%H$"$j!#(B +;;; とりあえず hilit19 を使っている時に色が付くようにして +;;; メニューバーでごにょごにょできるようにしただけ。 +;;; いったい誰がメニューバー使ってLaTeXソース書くんだろうか? +;;; まあいいや練習練習。後ろの方にちょっとコメントあり。 (require 'yatex) @@ -203,17 +203,21 @@ '(lambda (x y) (string< (car x) (car y)))))) ;; Highlightening -;; $B%m!<%+%k$J%^%/%m$rFI$_9~$s$@8e(B redraw $B$9$k$H(B -;; $B%m!<%+%k%^%/%m$r(B keyword $B$H$7$F8w$i$;$k(B(keyword$B$8$c$^$:$$$+$J!D(B)$B!#(B +;; ローカルなマクロを読み込んだ後 redraw すると +;; ローカルマクロを keyword として光らせる(keywordじゃまずいかな…)。 (defvar YaTeX-hilit-pattern-adjustment (list - ;;\def $B$,(B define $B$J$s$@$+$i(B new* $B$b(B define $B$G$7$g$&!#(B + ;;\def が define なんだから new* も define でしょう。 '("\\\\\\(re\\)?new\\(environment\\|command\\){" "}" define) '("\\\\new\\(length\\|theorem\\|counter\\){" "}" define) - ;;$B%;%/%7%g%s%3%^%s%I$,C1$J$k%-!<%o!<%I$C$F$3$H$O$J$$$G$7$g$&!#(B + ;;セクションコマンドが単なるキーワードってことはないでしょう。 (list (concat "\\\\\\(" YaTeX-sectioning-regexp "\\){") "}" - 'sectioning)) + 'sectioning) + ;;eqnarray などの数式環境が入ってないみたい… + '("\\\\begin{\\(eqnarray\\*?\\)\\|\\(equation\\*?\\)}" + "\\\\end{\\(eqnarray\\*?\\)\\|\\(equation\\*?\\)}" + formula)) "Adjustment for hilit19's LaTeX hilit pattern.") (defvar YaTeX-hilit-sectioning-face '(yellow/dodgerblue yellow/cornflowerblue)) @@ -269,10 +273,10 @@ (define-key YaTeX-mode-map key 'YaTeX-hilit-recenter))) (where-is-internal 'hilit-recenter))) -;;; reverseVideo $B$K$7$F(B hilit-background-mode $B$r(B 'dark -;;; $B$K$7$F$$$k?M$O?t<0$J$I$,0E$/$J$j$9$.$F8+$E$i$$$+$b$7$l$J$$!#(B -;;; $Bl=j$ND>8e$KCV$/$H$A$g$C(B -;;; $B$H$O$^$7!#(B +;;; reverseVideo にして hilit-background-mode を 'dark +;;; にしている人は数式などが暗くなりすぎて見づらいかもしれない。 +;;; 次のコードを hilit19 をロードしている場所の直後に置くとちょっ +;;; とはまし。 ;;; (if (eq hilit-background-mode 'dark) ;;; (hilit-translate ;;; string 'mediumspringgreen diff -r a0640ff3f72f -r eb0512bfcb7f yatexadd.el --- a/yatexadd.el Mon Oct 31 17:49:43 1994 +0000 +++ b/yatexadd.el Fri Nov 25 08:26:13 1994 +0000 @@ -2,7 +2,7 @@ ;;; YaTeX add-in functions. ;;; yatexadd.el rev.9 ;;; (c )1991-1994 by HIROSE Yuuji.[yuuji@ae.keio.ac.jp] -;;; Last modified Mon Oct 31 12:55:54 1994 on pajero +;;; Last modified Sat Nov 12 07:03:15 1994 on VFR ;;; $Id$ ;;; @@ -566,17 +566,22 @@ "Alist of LaTeX style parameters.") (defvar YaTeX:style-parameters-private nil "*User definable alist of style parameters.") -(defvar YaTeX:style-parameters-private nil - "Holds the union of LaTeX style parameters.") -(setq YaTeX:style-parameters - (append YaTeX:style-parameters-private YaTeX:style-parameters-default)) +(defvar YaTeX:style-parameters-local nil + "*User definable alist of local style parameters.") (defvar YaTeX:length-history nil "Holds history of length.") (defun YaTeX::setlength (&optional argp) "YaTeX add-in function for arguments of \\setlength." (cond ((equal 1 argp) - (completing-read "Length variable: " YaTeX:style-parameters nil nil "\\")) + ;;(completing-read "Length variable: " YaTeX:style-parameters nil nil "\\") + (YaTeX-cplread-with-learning + "Length variable: " + 'YaTeX:style-parameters-default + 'YaTeX:style-parameters-private + 'YaTeX:style-parameters-local + nil nil "\\") + ) ((equal 2 argp) (let ((minibuffer-history-symbol 'YaTeX:length-history)) (read-string "Length: ")))) @@ -587,7 +592,12 @@ "YaTeX add-in function for arguments of \\settowidth." (cond ((equal 1 argp) - (completing-read "Length variable: " YaTeX:style-parameters nil nil "\\")) + (YaTeX-cplread-with-learning + "Length variable: " + 'YaTeX:style-parameters-default + 'YaTeX:style-parameters-private + 'YaTeX:style-parameters-local + nil nil "\\")) ((equal 2 argp) (read-string "Text: "))) ) @@ -596,12 +606,14 @@ (cond ((equal argp 1) (let ((length (read-string "Length variable: " "\\"))) - (or (assoc length YaTeX:style-parameters-private) - (setq YaTeX:style-parameters-private - (cons (list length) YaTeX:style-parameters-private) - YaTeX:style-parameters - (cons (list length) YaTeX:style-parameters))) - length))) + (if (string< "" length) + (YaTeX-update-table + (list length) + 'YaTeX:style-parameters-default + 'YaTeX:style-parameters-private + 'YaTeX:style-parameters-local)) + length) + )) ) ;; \multicolumn's arguments @@ -621,5 +633,75 @@ (read-string "Item: "))) ) +(defvar YaTeX:documentstyles-default + '(("article") ("jarticle") ("j-article") + ("book") ("jbook") ("j-book") + ("report") ("jreport") ("j-report") + ("letter") ("ascjletter")) + "List of LaTeX documentstyles.") +(defvar YaTeX:documentstyles-private nil + "*User defined list of LaTeX documentstyles.") +(defvar YaTeX:documentstyles-local nil + "*User defined list of local LaTeX documentstyles.") +(defvar YaTeX:documentstyle-options-default + '(("a4j") ("a5j") ("b4j") ("b5j") + ("twocolumn") ("jtwocolumn") ("epsf") ("epsfig") ("epsbox") ("nfig")) + "List of LaTeX documentstyle options.") +(defvar YaTeX:documentstyle-options-private nil + "*User defined list of LaTeX documentstyle options.") +(defvar YaTeX:documentstyle-options-local nil + "List of LaTeX local documentstyle options.") + +(defvar YaTeX-minibuffer-completion-map nil + "Minibuffer completion key map that allows comma completion.") +(if YaTeX-minibuffer-completion-map nil + (setq YaTeX-minibuffer-completion-map + (copy-keymap minibuffer-local-completion-map)) + (define-key YaTeX-minibuffer-completion-map " " + 'YaTeX-minibuffer-complete) + (define-key YaTeX-minibuffer-completion-map "\t" + 'YaTeX-minibuffer-complete)) + +(defun YaTeX:documentstyle () + (let*((delim ",") + (dt (append YaTeX:documentstyle-options-local + YaTeX:documentstyle-options-private + YaTeX:documentstyle-options-default)) + (minibuffer-completion-table dt) + (opt (read-from-minibuffer + "Style options ([opt1,opt2,...]): " + nil YaTeX-minibuffer-completion-map)) + (substr opt) o) + (if (string< "" opt) + (progn + (while substr + (setq o (substring substr 0 (string-match delim substr))) + (or (assoc o dt) + (YaTeX-update-table + (list o) + 'YaTeX:documentstyle-options-default + 'YaTeX:documentstyle-options-private + 'YaTeX:documentstyle-options-local)) + (setq substr + (if (string-match delim substr) + (substring substr (1+ (string-match delim substr)))))) + (concat "[" opt "]")) + ""))) + +(defun YaTeX::documentstyle (&optional argp) + "YaTeX add-in function for arguments of \\socumentstyle." + (cond + ((equal argp 1) + (let ((sname + (YaTeX-cplread-with-learning + (format "Documentstyle (default %s): " + YaTeX-default-document-style) + 'YaTeX:documentstyles-default + 'YaTeX:documentstyles-private + 'YaTeX:documentstyles-local))) + (if (string= "" sname) (setq sname YaTeX-default-document-style)) + (setq YaTeX-default-document-style sname)))) +) + ;;; -------------------- End of yatexadd -------------------- (provide 'yatexadd) diff -r a0640ff3f72f -r eb0512bfcb7f yatexenv.el --- a/yatexenv.el Mon Oct 31 17:49:43 1994 +0000 +++ b/yatexenv.el Fri Nov 25 08:26:13 1994 +0000 @@ -2,7 +2,7 @@ ;;; YaTeX environment-specific functions. ;;; yatexenv.el ;;; (c ) 1994 by HIROSE Yuuji.[yuuji@ae.keio.ac.jp] -;;; Last modified Tue Sep 20 01:35:46 1994 on figaro +;;; Last modified Thu Nov 24 04:33:18 1994 on 98fa ;;; $Id$ ;;; @@ -13,7 +13,8 @@ (defun YaTeX-array-what-column () "Show matching columne title of array environment. When calling from a program, make sure to be in array/tabular environment." - (let ((p (point)) beg eot bor (nlptn "\\\\\\\\") (andptn "[^\\]&") (n 0) + (let ((p (point)) beg eot bor (nlptn "\\\\\\\\") (andptn "[^\\]&") + (n 0) j (firsterr "This line might be the first row.")) (save-excursion (YaTeX-beginning-of-environment) @@ -46,24 +47,23 @@ -1))))) (message "%s" n) (goto-char (1- beg)) - (cond - ((= n 1) (message "Here is the FIRST column!")) - (t (while (> n 1) - (or (re-search-forward andptn p nil) - (error "This column exceeds the limit.")) - (setq n (1- n))) - (skip-chars-forward "\\s ") - (message - "Here is the column of: %s" - (buffer-substring - (point) - (progn - (re-search-forward (concat andptn "\\|" nlptn) eot) - (goto-char (match-beginning 0)) - (if (looking-at andptn) - (forward-char 1)) - (skip-chars-backward "\\s ") - (point)))))))) + (setq j n) + (while (> j 1) + (or (re-search-forward andptn p nil) + (error "This column exceeds the limit.")) + (setq j (1- j))) + (skip-chars-forward "\\s ") + (message + "This is the column(#%d) of: %s" n + (buffer-substring + (point) + (progn + (re-search-forward (concat andptn "\\|" nlptn) eot) + (goto-char (match-beginning 0)) + (if (looking-at andptn) + (forward-char 1)) + (skip-chars-backward "\\s ") + (point)))))) ) ;;;###autoload diff -r a0640ff3f72f -r eb0512bfcb7f yatexgen.el --- a/yatexgen.el Mon Oct 31 17:49:43 1994 +0000 +++ b/yatexgen.el Fri Nov 25 08:26:13 1994 +0000 @@ -2,7 +2,7 @@ ;;; YaTeX add-in function generator. ;;; yatexgen.el rev.3 ;;; (c )1991-1994 by HIROSE Yuuji.[yuuji@ae.keio.ac.jp] -;;; Last modified Tue Sep 20 01:34:46 1994 on figaro +;;; Last modified Thu Nov 17 03:54:56 1994 on VFR ;;; $Id$ (require 'yatex) @@ -587,7 +587,10 @@ singlecmd-table user-singlecmd-table tmp-singlecmd-table) nil nil) command (if (string= "" command) section-name command))) - (message "(o)追加型? (a)引数型? (yatexadd.docを参照のこと) :") + (message + (cond + (YaTeX-japan "(o)追加型? (a)引数型? (yatexadd.docを参照のこと) :") + (t "(O)ption? (A)rgument?"))) (YaTeX-showup-buffer (if (= (read-char) ?o) (YaTeX-generate-option-type command) diff -r a0640ff3f72f -r eb0512bfcb7f yatexhlp.el --- a/yatexhlp.el Mon Oct 31 17:49:43 1994 +0000 +++ b/yatexhlp.el Fri Nov 25 08:26:13 1994 +0000 @@ -2,15 +2,16 @@ ;;; YaTeX helper with LaTeX commands and macros. ;;; yatexhlp.el ;;; (c )1994 by HIROSE Yuuji.[yuuji@ae.keio.ac.jp] -;;; Last modified Tue Sep 20 01:35:12 1994 on figaro +;;; Last modified Sat Nov 12 04:20:26 1994 on VFR ;;; $Id$ (let ((help-file (concat "YATEXHLP." (cond (YaTeX-japan "jp") (t "eng")))) (help-dir - (cond (YaTeX-emacs-19 (expand-file-name "../etc" exec-directory)) - (t exec-directory)))) + (cond + (YaTeX-emacs-19 (expand-file-name "../../site-lisp" exec-directory)) + (t exec-directory)))) (defvar YaTeX-help-file (expand-file-name help-file help-dir) "*Help file of LaTeX/TeX commands or macros.") diff -r a0640ff3f72f -r eb0512bfcb7f yatexlib.el --- a/yatexlib.el Mon Oct 31 17:49:43 1994 +0000 +++ b/yatexlib.el Fri Nov 25 08:26:13 1994 +0000 @@ -2,7 +2,7 @@ ;;; YaTeX library of general functions. ;;; yatexlib.el ;;; (c )1994 by HIROSE Yuuji.[yuuji@ae.keio.ac.jp] -;;; Last modified Mon Oct 10 22:14:14 1994 on VFR +;;; Last modified Thu Nov 24 02:20:45 1994 on VFR ;;; $Id$ ;;;###autoload @@ -11,7 +11,7 @@ Optional arguments after BOUND, ERR, CNT are passed literally to search-forward or search-backward. Optional sixth argument FUNC changes search-function." - (let ((sfunc (if func func 'search-forward)) found md) + (let ((sfunc (or func 'search-forward)) found md) (while (and (prog1 (setq found (funcall sfunc string bound err cnt)) (setq md (match-data))) @@ -122,7 +122,7 @@ "Make BUFFER show up in certain window (but current window) that gives the maximum value by the FUNC. FUNC should take an argument of its window object. Non-nil for optional third argument SELECT selects -that window." +that window. This function never selects minibuffer window." (or (and (if YaTeX-emacs-19 (get-buffer-window buffer t) (get-buffer-window buffer)) @@ -158,7 +158,8 @@ (switch-to-buffer buffer) (or select (select-window window))) ((= (length wlist) 2) - (other-window 1) + ;(other-window 1);This does not work properly on Emacs-19 + (select-window (get-lru-window)) (switch-to-buffer buffer) (or select (select-window window))) (t ;if one-window @@ -208,23 +209,33 @@ "Return (buffer-substring (match-beginning n) (match-beginning m))." (if (match-beginning n) (buffer-substring (match-beginning n) - (match-end (if m m n)))) + (match-end (or m n)))) ) ;;;###autoload (defun YaTeX-minibuffer-complete () - "Complete in minibuffer" + "Complete in minibuffer. +If the symbol 'delim is bound and is string, its value is assumed to be +the character class of delimiters. Completion will be performed on +the last field separated by those delimiters." (interactive) - (let (beg word compl) - (setq beg (if (and (boundp 'delim) delim) + (let (beg word compl (md (match-data))) + (setq beg (if (and (boundp 'delim) (stringp delim)) (save-excursion (skip-chars-backward (concat "^" delim)) - (1- (point))) + (point)) (point-min)) word (buffer-substring beg (point-max)) compl (try-completion word minibuffer-completion-table)) (cond - ((eq compl t) nil) + ((eq compl t) + (let ((p (point)) (max (point-max))) + (goto-char max) + (insert " [Sole completion]") + (goto-char p) + (sit-for 1) + (delete-region max (point-max)) + (goto-char p))) ((eq compl nil) (ding) (save-excursion @@ -240,7 +251,8 @@ (all-completions word minibuffer-completion-table)))) (t (delete-region beg (point-max)) (insert compl)) - )) + ) + (store-match-data md)) ) diff -r a0640ff3f72f -r eb0512bfcb7f yatexprc.el --- a/yatexprc.el Mon Oct 31 17:49:43 1994 +0000 +++ b/yatexprc.el Fri Nov 25 08:26:13 1994 +0000 @@ -2,7 +2,7 @@ ;;; YaTeX process handler. ;;; yatexprc.el ;;; (c )1993-1994 by HIROSE Yuuji.[yuuji@ae.keio.ac.jp] -;;; Last modified Thu Oct 20 16:48:41 1994 on figaro +;;; Last modified Fri Nov 25 03:31:46 1994 on VFR ;;; $Id$ (require 'yatex) @@ -19,6 +19,11 @@ (defvar YaTeX-current-TeX-buffer nil "Keeps the buffer on which recently typeset run.") +(defvar YaTeX-shell-command-option + (or (and (boundp 'shell-command-option) shell-command-option) + (if YaTeX-dos "/c" "-c")) + "Shell option for command execution.") + (if YaTeX-typeset-buffer-syntax nil (setq YaTeX-typeset-buffer-syntax (make-syntax-table (standard-syntax-table))) @@ -50,12 +55,14 @@ (cond (YaTeX-dos ;if MS-DOS (YaTeX-put-nonstopmode) - (call-process shell-file-name nil buffer nil "/c" command) + (call-process + shell-file-name nil buffer nil YaTeX-shell-command-option command) (YaTeX-remove-nonstopmode)) (t ;if UNIX (set-process-buffer (setq YaTeX-typeset-process - (start-process "LaTeX" buffer shell-file-name "-c" command)) + (start-process "LaTeX" buffer shell-file-name + YaTeX-shell-command-option command)) (get-buffer buffer)) (set-process-sentinel YaTeX-typeset-process 'YaTeX-typeset-sentinel))) (message (format "Calling `%s'..." command)) @@ -302,9 +309,11 @@ (set-buffer (get-buffer-create buffer)) (erase-buffer) (if YaTeX-dos - (call-process shell-file-name nil buffer nil "/c " command) + (call-process + shell-file-name nil buffer nil YaTeX-shell-command-option command) (set-process-buffer - (start-process "system" buffer shell-file-name "-c" command) + (start-process + "system" buffer shell-file-name YaTeX-shell-command-option command) (get-buffer buffer)))) ) @@ -330,21 +339,24 @@ (setq dvi2-command preview-command) ;`dvi2command' is buffer local (save-excursion (YaTeX-visit-main t) - (let ((pbuffer "*dvi-preview*")) + (let ((pbuffer "*dvi-preview*") (dir default-directory)) (YaTeX-showup-buffer pbuffer (function (lambda (x) (nth 3 (window-edges x))))) (set-buffer (get-buffer-create pbuffer)) (erase-buffer) + (setq default-directory dir) ;for 18 + (cd dir) ;for 19 (cond (YaTeX-dos ;if MS-DOS (send-string-to-terminal "\e[2J\e[>5h") ;CLS & hide cursor (call-process shell-file-name "con" "*dvi-preview*" nil - "/c " preview-command preview-file) + YaTeX-shell-command-option preview-command preview-file) (send-string-to-terminal "\e[>5l") ;show cursor (redraw-display)) (t ;if UNIX (set-process-buffer - (start-process "preview" "*dvi-preview*" shell-file-name "-c" + (start-process "preview" "*dvi-preview*" shell-file-name + YaTeX-shell-command-option (concat preview-command " " preview-file)) (get-buffer pbuffer)) (message @@ -594,14 +606,15 @@ (erase-buffer) (cond (YaTeX-dos - (call-process shell-file-name "con" "*dvi-printing*" nil "/c " cmd)) + (call-process shell-file-name "con" "*dvi-printing*" nil + YaTeX-shell-command-option cmd)) (t (set-process-buffer - (start-process "print" "*dvi-printing*" shell-file-name "-c" cmd) + (start-process "print" "*dvi-printing*" shell-file-name + YaTeX-shell-command-option cmd) (get-buffer lbuffer)) - (message (concat "Starting " cmd " to printing " - (YaTeX-get-preview-file-name))))) - )) + (message "Starting printing command: %s..." cmd))) + )) ) (defun YaTeX-main-file-p () diff -r a0640ff3f72f -r eb0512bfcb7f yatexsec.el --- a/yatexsec.el Mon Oct 31 17:49:43 1994 +0000 +++ b/yatexsec.el Fri Nov 25 08:26:13 1994 +0000 @@ -2,13 +2,25 @@ ;;; YaTeX sectioning browser. ;;; yatexsec.el ;;; (c ) 1994 by HIROSE Yuuji [yuuji@ae.keio.ac.jp] -;;; Last modified Tue Sep 20 01:35:32 1994 on figaro +;;; Last modified Fri Nov 25 04:46:42 1994 on VFR ;;; $Id$ (defvar YaTeX-sectioning-level - '(("part" . 0) ("chapter" . 1) ("section" . 2) ("subsection" . 3) - ("subsubsection" . 4) ("paragraph" . 5) ("subparagraph" . 6)) - "Sectioning level.") + '(("part" . 0) + ("chapter" . 1) + ("section" . 2) + ("subsection" . 3) + ("subsubsection" . 4) + ("paragraph" . 5) + ("subparagraph" . 6)) + "*Alist of LaTeX's sectioning command and its level. +This value must be written in numerically ascending order and consecutive. +Needn't define the level of `*' commands such as `section*'.") + +(defvar YaTeX-sectioning-max-level + (cdr (nth (1- (length YaTeX-sectioning-level)) YaTeX-sectioning-level)) + "*The heighest(numerically) level of sectioning command. +This must be the heighest number in YaTeX-sectioning-level.") (defun YaTeX-sectioning-map-hide (map) (let ((ch ?0)) @@ -17,40 +29,40 @@ (setq ch (1+ ch)))) ) -(defvar YaTeX-minibuffer-sectioning-map nil +(defvar YaTeX-sectioning-minibuffer-map nil "Key map used in minibuffer for sectioning.") -(if YaTeX-minibuffer-sectioning-map nil - (setq YaTeX-minibuffer-sectioning-map +(if YaTeX-sectioning-minibuffer-map nil + (setq YaTeX-sectioning-minibuffer-map (copy-keymap minibuffer-local-completion-map)) - (define-key YaTeX-minibuffer-sectioning-map "\C-p" + (define-key YaTeX-sectioning-minibuffer-map "\C-p" 'YaTeX-sectioning-up) - (define-key YaTeX-minibuffer-sectioning-map "\C-e" + (define-key YaTeX-sectioning-minibuffer-map "\C-e" 'YaTeX-sectioning-up) - (define-key YaTeX-minibuffer-sectioning-map "\C-i" + (define-key YaTeX-sectioning-minibuffer-map "\C-i" 'YaTeX-minibuffer-complete) - (define-key YaTeX-minibuffer-sectioning-map " " + (define-key YaTeX-sectioning-minibuffer-map " " 'YaTeX-minibuffer-complete) - (define-key YaTeX-minibuffer-sectioning-map "\C-n" + (define-key YaTeX-sectioning-minibuffer-map "\C-n" 'YaTeX-sectioning-down) - (define-key YaTeX-minibuffer-sectioning-map "\C-x" + (define-key YaTeX-sectioning-minibuffer-map "\C-x" 'YaTeX-sectioning-down) - (define-key YaTeX-minibuffer-sectioning-map "\C-v" + (define-key YaTeX-sectioning-minibuffer-map "\C-v" 'YaTeX-sectioning-scroll-up) - (define-key YaTeX-minibuffer-sectioning-map "\C-c" + (define-key YaTeX-sectioning-minibuffer-map "\C-c" 'YaTeX-sectioning-scroll-up) - (define-key YaTeX-minibuffer-sectioning-map "\M-v" + (define-key YaTeX-sectioning-minibuffer-map "\M-v" 'YaTeX-sectioning-scroll-down) - (define-key YaTeX-minibuffer-sectioning-map "\C-r" + (define-key YaTeX-sectioning-minibuffer-map "\C-r" 'YaTeX-sectioning-scroll-down) - (define-key YaTeX-minibuffer-sectioning-map "\C-w" + (define-key YaTeX-sectioning-minibuffer-map "\C-w" '(lambda () (interactive) (YaTeX-sectioning-scroll-down 1))) - (define-key YaTeX-minibuffer-sectioning-map "\C-z" + (define-key YaTeX-sectioning-minibuffer-map "\C-z" '(lambda () (interactive) (YaTeX-sectioning-scroll-up 1))) - (define-key YaTeX-minibuffer-sectioning-map "\C-l" + (define-key YaTeX-sectioning-minibuffer-map "\C-l" 'YaTeX-sectioning-recenter) - (define-key YaTeX-minibuffer-sectioning-map "?" + (define-key YaTeX-sectioning-minibuffer-map "?" 'YaTeX-sectioning-help) - (YaTeX-sectioning-map-hide YaTeX-minibuffer-sectioning-map) + (YaTeX-sectioning-map-hide YaTeX-sectioning-minibuffer-map) ) (defvar YaTeX-sectioning-buffer-map nil @@ -85,13 +97,13 @@ "Hide sectioning commands under level N." (let ((cw (selected-window))) (YaTeX-showup-buffer YaTeX-sectioning-buffer nil t) - (if (>= n (1- (length YaTeX-sectioning-level))) + (if (>= n YaTeX-sectioning-max-level) (progn (set-selective-display nil) (message "Show all.")) (set-selective-display (1+ n)) - (if (nth n YaTeX-sectioning-level) - (message "Hide lower than %s" (car (nth n YaTeX-sectioning-level))) + (if (rassq n YaTeX-sectioning-level) + (message "Hide lower than %s" (car (rassq n YaTeX-sectioning-level))) (message ""))) (if (numberp selective-display) (setq mode-name (format "level %d" (1- selective-display))) @@ -118,9 +130,11 @@ C-n Down sectioning level. 1 and \\chapter, C-v Scroll up *Sectioning line* buffer. 2 and \\section, M-v Scroll down *Sectioning line* buffer. 3 and \\subsection, -SPC Complete word. 4 and \\subsubsection, -TAB Complete word. 5 and \\paragraph. -C-l Recenter recent line. 6 Show all. +C-z Scroll up by 1 line. 4 and \\subsubsection, +C-w Scroll down by 1 line. 5 and \\paragraph. +SPC Complete word. 6 Show all. +TAB Complete word. +C-l Recenter recent line. RET Select. ==== End of HELP ===== ") @@ -138,15 +152,18 @@ (interactive "p") (if (eq (selected-window) (minibuffer-window)) (let*((command (buffer-string)) + (aster (equal (substring command -1) "*")) + (command (if aster (substring command 0 -1) command)) (alist YaTeX-sectioning-level) - (level (cdr-safe (assoc command alist)))) - (or level (error "No such sectioning command.")) + (level 0)) + (or (assoc command alist) (error "No such sectioning command.")) + (while (not (string= (car (nth level alist)) command)) + (setq level (1+ level))) ;I want to use `member'.... (setq level (- level n)) (if (or (< level 0) (>= level (length alist))) (ding) (erase-buffer) - (insert (car (nth level alist)))) - )) + (insert (concat (car (nth level alist)) (if aster "*" "")))))) ) (defun YaTeX-sectioning-down (n) @@ -183,18 +200,19 @@ (progn (YaTeX-showup-buffer YaTeX-sectioning-buffer nil t) (or (search-forward "<<--" nil t) - (search-backward "<<--" nil t)) + (search-backward "<<--" nil)) (recenter (or arg (/ (window-height) 2)))) (select-window cw))) ) (defvar YaTeX-sectioning-minibuffer " *sectioning*" "Miniuffer used for sectioning") +;;;###autoload (defun YaTeX-read-section-in-minibuffer (prompt table &optional default delim) (interactive) (let ((minibuffer-completion-table table)) (read-from-minibuffer - prompt default YaTeX-minibuffer-sectioning-map)) + prompt default YaTeX-sectioning-minibuffer-map)) ) (defun YaTeX-get-sectioning-level () @@ -265,6 +283,7 @@ command)) ) +;;;###autoload (defun YaTeX-make-section-with-overview () "Input sectining command with previous overview." (interactive) @@ -278,4 +297,3 @@ ) (provide 'yatexsec) -;;(YaTeX-define-key "o" 'YaTeX-make-section-with-overview)