aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert J. Chassell1990-07-27 16:01:02 +0000
committerRobert J. Chassell1990-07-27 16:01:02 +0000
commitd5aa8b0229b8f844370f8b2efd73c3908be221a2 (patch)
tree986a54e2799043cfe9dec4d1e22acb8c3c96470b
parentf53a262dd96f26edada13fc21ced42a70080ac87 (diff)
downloademacs-d5aa8b0229b8f844370f8b2efd73c3908be221a2.tar.gz
emacs-d5aa8b0229b8f844370f8b2efd73c3908be221a2.zip
*** empty log message ***
-rw-r--r--lisp/textmodes/texinfo.el69
1 files changed, 35 insertions, 34 deletions
diff --git a/lisp/textmodes/texinfo.el b/lisp/textmodes/texinfo.el
index ce3123e0e22..bc0470a4f0f 100644
--- a/lisp/textmodes/texinfo.el
+++ b/lisp/textmodes/texinfo.el
@@ -61,6 +61,7 @@
61 61
62 (define-key texinfo-mode-map "\C-c\C-s" 'texinfo-show-structure) 62 (define-key texinfo-mode-map "\C-c\C-s" 'texinfo-show-structure)
63 63
64 (define-key texinfo-mode-map "\"" 'tex-insert-quote)
64 (define-key texinfo-mode-map "\e}" 'up-list) 65 (define-key texinfo-mode-map "\e}" 'up-list)
65 (define-key texinfo-mode-map "\e{" 'texinfo-insert-braces) 66 (define-key texinfo-mode-map "\e{" 'texinfo-insert-braces)
66 67
@@ -142,42 +143,42 @@ Use \\[up-list] to move forward out of the braces."
142 (backward-char)) 143 (backward-char))
143 144
144(defun texinfo-mode () 145(defun texinfo-mode ()
145 "Major mode for editing texinfo files. 146 "Major mode for editing Texinfo files.
146 147
147 It has these extra commands: 148 It has these extra commands:
148\\{texinfo-mode-map} 149\\{texinfo-mode-map}
149 150
150 These are files that are used as input for tex to make printed manuals 151 These are files that are used as input for TeX to make printed manuals
151and also to be turned into Info files by \\[texinfo-format-buffer]. 152and also to be turned into Info files by \\[texinfo-format-buffer] or
152These files must be written in a very restricted and modified version 153`makeinfo'. These files must be written in a very restricted and
153of tex input format. 154modified version of TeX input format.
154 155
155 Editing commands are like text-mode except that the syntax table is 156 Editing commands are like text-mode except that the syntax table is
156set up so expression commands skip texinfo bracket groups. To see 157set up so expression commands skip Texinfo bracket groups. To see
157what the Info version of a region of the texinfo file will look like, 158what the Info version of a region of the Texinfo file will look like,
158use \\[texinfo-format-region]. This command runs Info on the current region 159use \\[texinfo-format-region]. This command runs Info on the current region
159of the texinfo file and formats it properly. 160of the Texinfo file and formats it properly.
160 161
161 You can show the structure of a texinfo file with \\[texinfo-show-structure]. 162 You can show the structure of a Texinfo file with \\[texinfo-show-structure].
162This command shows the structure of a texinfo file by listing the 163This command shows the structure of a Texinfo file by listing the
163lines with the @-sign commands for @node, @chapter, @section and the 164lines with the @-sign commands for @chapter, @section, and the like.
164like. These lines are displayed in another window called the *Occur* 165These lines are displayed in another window called the *Occur* window.
165window. In that window, you can position the cursor over one of the 166In that window, you can position the cursor over one of the lines and
166lines and use \\[occur-mode-goto-occurrence], to jump to the 167use \\[occur-mode-goto-occurrence], to jump to the corresponding spot
167corresponding spot in the texinfo file. 168in the Texinfo file.
168 169
169 In addition, texinfo mode provides commands that insert various 170 In addition, Texinfo mode provides commands that insert various
170frequently used @-sign commands into the buffer. You can use these 171frequently used @-sign commands into the buffer. You can use these
171commands to save keystrokes. And you can insert balanced braces with 172commands to save keystrokes. And you can insert balanced braces with
172\\[texinfo-insert-braces] and later use the command \\[up-list] to 173\\[texinfo-insert-braces] and later use the command \\[up-list] to
173move forward past the closing brace. 174move forward past the closing brace.
174 175
175Also, texinfo mode provides functions for automatically creating or 176Also, Texinfo mode provides functions for automatically creating or
176updating menus and node pointers. These functions 177updating menus and node pointers. These functions
177 178
178 * insert the `Next', `Previous' and `Up' pointers of a node, 179 * insert the `Next', `Previous' and `Up' pointers of a node,
179 * insert or update the menu for a section, and 180 * insert or update the menu for a section, and
180 * create a master menu for a texinfo source file. 181 * create a master menu for a Texinfo source file.
181 182
182Here are the functions: 183Here are the functions:
183 184
@@ -198,15 +199,15 @@ Passed an argument (a prefix argument, if interactive), the
198`texinfo-update-node' and `texinfo-make-menu' functions do their jobs 199`texinfo-update-node' and `texinfo-make-menu' functions do their jobs
199in the region. 200in the region.
200 201
201To use the updating commands, you must structure your texinfo file 202To use the updating commands, you must structure your Texinfo file
202hierarchically, such that each `@node' line, with the exception of the 203hierarchically, such that each `@node' line, with the exception of the
203top node, is accompanied by some kind of section line, such as an 204Top node, is accompanied by some kind of section line, such as an
204`@chapter' or `@section' line. 205`@chapter' or `@section' line.
205 206
206If the file has a `top' node, it must be called `top' or `Top' and 207If the file has a `top' node, it must be called `top' or `Top' and
207be the first node in the file. 208be the first node in the file.
208 209
209Entering texinfo mode calls the value of text-mode-hook, and then the 210Entering Texinfo mode calls the value of text-mode-hook, and then the
210value of texinfo-mode-hook." 211value of texinfo-mode-hook."
211 (interactive) 212 (interactive)
212 (text-mode) 213 (text-mode)
@@ -237,34 +238,34 @@ value of texinfo-mode-hook."
237 (run-hooks 'text-mode-hook 'texinfo-mode-hook)) 238 (run-hooks 'text-mode-hook 'texinfo-mode-hook))
238 239
239 240
240(defvar texinfo-heading-pattern 241;;; Texinfo file structure
241 "^@\\(chapter\\|unnum\\|appendix\\|sect\\|sub\\|heading\\|major\\|node\\)"
242 "Regexp matching @node and chapter, section, and other headings.")
243 242
244; The following is defined in `texnfo-upd.el' 243; The following is defined in `texnfo-upd.el'
245; (defvar texinfo-section-types-regexp 244; (defvar texinfo-section-types-regexp
246; "^@\\(chapter \\|sect\\|sub\\|unnum\\|major\\|heading \\|appendix\\)" 245; "^@\\(chapter \\|sect\\|sub\\|unnum\\|major\\|heading \\|appendix\\)"
247; "Regexp matching chapter, section, other headings (but not the top node).") 246; "Regexp matching chapter, section, other headings (but not the top node).")
248 247
249(defun texinfo-show-structure (&optional sections-only) 248(defun texinfo-show-structure (&optional nodes-too)
250 "Show the structure of a Texinfo file. 249 "Show the structure of a Texinfo file.
251With optional argument (prefix if interactive), list lines with @-sign 250List the lines in the file that begin with the @-sign commands for
252commands for @chapter, @section and the like. With no argument, list 251@chapter, @section, and the like.
253both the lines with @-sign commands for @chapter, @section and the 252
254like and list @node lines. 253With optional argument (prefix if interactive), list both the lines
254with @-sign commands for @chapter, @section, and the like, and list
255@node lines.
255 256
256Lines with structuring commands beginning in them are displayed in 257Lines with structuring commands beginning in them are displayed in
257another window called the *Occur* window. In that window, you can 258another window called the *Occur* window. In that window, you can
258position the cursor over one of the lines and use 259position the cursor over one of the lines and use
259\\[occur-mode-goto-occurrence], to jump to the corresponding spot in 260\\[occur-mode-goto-occurrence],
260the texinfo file." 261to jump to the corresponding spot in the Texinfo file."
261 262
262 (interactive "P") 263 (interactive "P")
263 (save-excursion 264 (save-excursion
264 (goto-char (point-min)) 265 (goto-char (point-min))
265 (if sections-only 266 (if nodes-too
266 (occur texinfo-section-types-regexp) 267 (occur (concat "\\(^@node\\)\\|" texinfo-section-types-regexp))
267 (occur texinfo-heading-pattern))) 268 (occur texinfo-section-types-regexp)))
268 (pop-to-buffer "*Occur*") 269 (pop-to-buffer "*Occur*")
269 (goto-char (point-min)) 270 (goto-char (point-min))
270 (flush-lines "-----")) 271 (flush-lines "-----"))