annotate lisp/modes/texinfo.el @ 194:2947057885e5

Added tag r20-3b23 for changeset f53b5ca2e663
author cvs
date Mon, 13 Aug 2007 09:58:32 +0200
parents 489f57a838ef
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1 ;;; texinfo.el --- major mode for editing Texinfo files
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3 ;; Copyright (C) 1985, '88, '89,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4 ;; '90, '91, '92, '93 Free Software Foundation, Inc.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
5
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6 ;; Author: Robert J. Chassell
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7 ;; Maintainer: FSF
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8 ;; Keywords: tex wp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10 ;; This file is part of XEmacs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12 ;; XEmacs is free software; you can redistribute it and/or modify it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13 ;; under the terms of the GNU General Public License as published by
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14 ;; the Free Software Foundation; either version 2, or (at your option)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15 ;; any later version.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17 ;; XEmacs is distributed in the hope that it will be useful, but
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20 ;; General Public License for more details.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22 ;; You should have received a copy of the GNU General Public License
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
23 ;; along with XEmacs; see the file COPYING. If not, write to the
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
24 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
25 ;; Boston, MA 02111-1307, USA.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
26
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27 ;;; Synched up with: FSF 19.30.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28
120
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 16
diff changeset
29 (defgroup texinfo nil
189
489f57a838ef Import from CVS: tag r20-3b21
cvs
parents: 120
diff changeset
30 "Major mode for editing Texinfo files."
489f57a838ef Import from CVS: tag r20-3b21
cvs
parents: 120
diff changeset
31 :group 'docs
489f57a838ef Import from CVS: tag r20-3b21
cvs
parents: 120
diff changeset
32 :group 'tex
489f57a838ef Import from CVS: tag r20-3b21
cvs
parents: 120
diff changeset
33 :group 'wp)
120
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 16
diff changeset
34
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36 ;;; Autoloads:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38 (autoload 'makeinfo-region
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39 "makeinfo"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40 "Make Info file from region of current Texinfo file, and switch to it.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42 This command does not offer the `next-error' feature since it would
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43 apply to a temporary file, not the original; use the `makeinfo-buffer'
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44 command to gain use of `next-error'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45 t nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47 (autoload 'makeinfo-buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48 "makeinfo"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49 "Make Info file from current buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51 Use the \\[next-error] command to move to the next error
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52 \(if there are errors\)."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53 t nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55 (autoload 'kill-compilation
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56 "compile"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57 "Kill the process made by the \\[compile] command."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58 t nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60 (autoload 'makeinfo-recenter-compilation-buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61 "makeinfo"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62 "Redisplay `*compilation*' buffer so most recent output can be seen.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63 The last line of the buffer is displayed on
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64 line LINE of the window, or centered if LINE is nil."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65 t nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67 (autoload 'texinfo-make-menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68 "texnfo-upd"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69 "Without any prefix argument, make or update a menu.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70 Make the menu for the section enclosing the node found following point.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72 Non-nil argument (prefix, if interactive) means make or update menus
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73 for nodes within or part of the marked region.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75 Whenever a menu exists, and is being updated, the descriptions that
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76 are associated with node names in the pre-existing menu are
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77 incorporated into the new menu. Otherwise, the nodes' section titles
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78 are inserted as descriptions."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79 t nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
81 (autoload 'texinfo-all-menus-update
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
82 "texnfo-upd"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
83 "Update every regular menu in a Texinfo file.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
84 Remove pre-existing master menu, if there is one.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
85
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
86 If called with a non-nil argument, this function first updates all the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
87 nodes in the buffer before updating the menus."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
88 t nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
89
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
90 (autoload 'texinfo-master-menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
91 "texnfo-upd"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
92 "Make a master menu for a whole Texinfo file.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
93 Non-nil argument (prefix, if interactive) means first update all
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
94 existing nodes and menus. Remove pre-existing master menu, if there is one.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
95
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
96 This function creates a master menu that follows the top node. The
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
97 master menu includes every entry from all the other menus. It
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
98 replaces any existing ordinary menu that follows the top node.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
99
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
100 If called with a non-nil argument, this function first updates all the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
101 menus in the buffer (incorporating descriptions from pre-existing
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
102 menus) before it constructs the master menu.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
103
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
104 The function removes the detailed part of an already existing master
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
105 menu. This action depends on the pre-exisitng master menu using the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
106 standard `texinfo-master-menu-header'.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
107
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
108 The master menu has the following format, which is adapted from the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
109 recommendation in the Texinfo Manual:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
110
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
111 * The first part contains the major nodes in the Texinfo file: the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
112 nodes for the chapters, chapter-like sections, and the major
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
113 appendices. This includes the indices, so long as they are in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
114 chapter-like sections, such as unnumbered sections.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
115
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
116 * The second and subsequent parts contain a listing of the other,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
117 lower level menus, in order. This way, an inquirer can go
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
118 directly to a particular node if he or she is searching for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
119 specific information.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
120
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
121 Each of the menus in the detailed node listing is introduced by the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
122 title of the section containing the menu."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
123 t nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
124
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
125 (autoload 'texinfo-indent-menu-description
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
126 "texnfo-upd"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
127 "Indent every description in menu following point to COLUMN.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
128 Non-nil argument (prefix, if interactive) means indent every
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
129 description in every menu in the region. Does not indent second and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
130 subsequent lines of a multi-line description."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
131 t nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
132
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
133 (autoload 'texinfo-insert-node-lines
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
134 "texnfo-upd"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
135 "Insert missing `@node' lines in region of Texinfo file.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
136 Non-nil argument (prefix, if interactive) means also to insert the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
137 section titles as node names; and also to insert the section titles as
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
138 node names in pre-existing @node lines that lack names."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
139 t nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
140
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
141 (autoload 'texinfo-start-menu-description
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
142 "texnfo-upd"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
143 "In this menu entry, insert the node's section title as a description.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
144 Position point at beginning of description ready for editing.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
145 Do not insert a title if the line contains an existing description.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
146
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
147 You will need to edit the inserted text since a useful description
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
148 complements the node name rather than repeats it as a title does."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
149 t nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
150
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
151 (autoload 'texinfo-multiple-files-update
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
152 "texnfo-upd"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
153 "Update first node pointers in each file included in OUTER-FILE;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
154 create or update main menu in the outer file that refers to such nodes.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
155 This does not create or update menus or pointers within the included files.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
156
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
157 With optional MAKE-MASTER-MENU argument (prefix arg, if interactive),
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
158 insert a master menu in OUTER-FILE. This does not create or update
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
159 menus or pointers within the included files.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
160
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
161 With optional UPDATE-EVERYTHING argument (numeric prefix arg, if
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
162 interactive), update all the menus and all the `Next', `Previous', and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
163 `Up' pointers of all the files included in OUTER-FILE before inserting
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
164 a master menu in OUTER-FILE.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
165
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
166 The command also updates the `Top' level node pointers of OUTER-FILE.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
167
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
168 Notes:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
169
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
170 * this command does NOT save any files--you must save the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
171 outer file and any modified, included files.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
172
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
173 * except for the `Top' node, this command does NOT handle any
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
174 pre-existing nodes in the outer file; hence, indices must be
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
175 enclosed in an included file.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
176
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
177 Requirements:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
178
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
179 * each of the included files must contain exactly one highest
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
180 hierarchical level node,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
181 * this highest node must be the first node in the included file,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
182 * each highest hierarchical level node must be of the same type.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
183
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
184 Thus, normally, each included file contains one, and only one,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
185 chapter."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
186 t nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
187
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
188
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
189 ;;; Code:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
190
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
191 ;;; Don't you dare insert any `require' calls at top level in this file--rms.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
192
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
193 ;;; Syntax table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
194
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
195 (defvar texinfo-mode-syntax-table nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
196
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
197 (if texinfo-mode-syntax-table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
198 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
199 (setq texinfo-mode-syntax-table (make-syntax-table))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
200 (modify-syntax-entry ?\" " " texinfo-mode-syntax-table)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
201 (modify-syntax-entry ?\\ " " texinfo-mode-syntax-table)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
202 (modify-syntax-entry ?@ "\\" texinfo-mode-syntax-table)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
203 (modify-syntax-entry ?\^q "\\" texinfo-mode-syntax-table)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
204 (modify-syntax-entry ?\[ "(]" texinfo-mode-syntax-table)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
205 (modify-syntax-entry ?\] ")[" texinfo-mode-syntax-table)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
206 (modify-syntax-entry ?{ "(}" texinfo-mode-syntax-table)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
207 (modify-syntax-entry ?} "){" texinfo-mode-syntax-table)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
208 (modify-syntax-entry ?\' "w" texinfo-mode-syntax-table))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
209
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
210 ;; Written by Wolfgang Bangerth <zcg51122@rpool1.rus.uni-stuttgart.de>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
211 ;; To overide this example, set either `imenu-generic-expression'
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
212 ;; or `imenu-create-index-function'.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
213 ;(defvar texinfo-imenu-generic-expression
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
214 ; '((nil "^@node[ \t]+\\([^,\n]*\\)" 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
215 ; ("Chapters" "^@chapter[ \t]+\\(.*\\)$" 1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
216
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
217 ; "Imenu generic expression for TexInfo mode. See `imenu-generic-expression'.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
218
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
219 (defvar texinfo-font-lock-keywords
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
220 (list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
221 ;; All but the first 2 had an OVERRIDE of t.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
222 ;; It didn't seem to be any better, and it's slower--simon.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
223 '("^\\(@c\\|@comment\\)\\>.*" . font-lock-comment-face) ;comments
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
224 ;; Robert J. Chassell <bob@gnu.ai.mit.edu> says remove this line.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
225 ;'("\\$\\([^$]*\\)\\$" 1 font-lock-string-face t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
226 "@\\(@\\|[^}\t \n{]+\\)" ;commands
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
227 '("^\\(*.*\\)[\t ]*$" 1 font-lock-function-name-face t) ;menu items
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
228 '("@\\(emph\\|strong\\|b\\|i\\){\\([^}]+\\)" 2 font-lock-comment-face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
229 '("@\\(file\\|kbd\\|key\\){\\([^}]+\\)" 2 font-lock-string-face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
230 '("@\\(samp\\|code\\|var\\|math\\){\\([^}]+\\)"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
231 2 font-lock-variable-name-face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
232 '("@\\(cite\\|xref\\|pxref\\){\\([^}]+\\)" 2 font-lock-reference-face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
233 '("@\\(end\\|item\\) *\\(.+\\)" 2 font-lock-function-name-face keep)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
234 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
235 "Additional expressions to highlight in TeXinfo mode.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
236
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
237 ;; An older version.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
238 ;(defconst texinfo-font-lock-keywords (purecopy
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
239 ; (list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
240 ; "@\\(@\\|[^}\t \n{]+\\)" ;commands
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
241 ; '("^\\(@c\\|@comment\\)[ \t].*$" 0 font-lock-comment-face t) ;comments
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
242 ; '("^\\(*.*\\)[\t ]*$" 1 font-lock-function-name-face t) ;menu items
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
243 ; '("@\\(emph\\|strong\\|b\\|i\\){\\([^}]+\\)" 2 font-lock-comment-face t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
244 ; '("@\\(file\\|kbd\\|key\\){\\([^}]+\\)" 2 font-lock-string-face t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
245 ; '("@\\(samp\\|code\\|var\\){\\([^}]+\\)" 2 font-lock-function-name-face t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
246 ; '("@\\(xref\\|pxref\\){\\([^}]+\\)" 2 font-lock-keyword-face t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
247 ; '("@end *\\([a-zA-Z0-9]+\\)[ \t]*$" 1 font-lock-function-name-face t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
248 ; '("@item \\(.*\\)$" 1 font-lock-function-name-face t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
249 ; '("\\$\\([^$]*\\)\\$" 1 font-lock-string-face t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
250 ; ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
251 ; "Additional expressions to highlight in TeXinfo mode.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
252
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
253 (put 'texinfo-mode 'font-lock-defaults '(texinfo-font-lock-keywords t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
254
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
255 ;;; Keybindings
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
256 (defvar texinfo-mode-map nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
257
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
258 ;;; Keys common both to Texinfo mode and to TeX shell.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
259
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
260 (defun texinfo-define-common-keys (keymap)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
261 "Define the keys both in Texinfo mode and in the texinfo-tex-shell."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
262 (define-key keymap "\C-c\C-t\C-k" 'tex-kill-job)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
263 (define-key keymap "\C-c\C-t\C-x" 'texinfo-quit-job)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
264 (define-key keymap "\C-c\C-t\C-l" 'tex-recenter-output-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
265 (define-key keymap "\C-c\C-t\C-d" 'texinfo-delete-from-print-queue)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
266 (define-key keymap "\C-c\C-t\C-q" 'tex-show-print-queue)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
267 (define-key keymap "\C-c\C-t\C-p" 'texinfo-tex-print)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
268 (define-key keymap "\C-c\C-t\C-i" 'texinfo-texindex)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
269
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
270 (define-key keymap "\C-c\C-t\C-r" 'texinfo-tex-region)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
271 (define-key keymap "\C-c\C-t\C-b" 'texinfo-tex-buffer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
272
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
273 ;; Mode documentation displays commands in reverse order
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
274 ;; from how they are listed in the texinfo-mode-map.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
275
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
276 (if texinfo-mode-map
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
277 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
278 (setq texinfo-mode-map (make-sparse-keymap))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
279
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
280 ;; bindings for `texnfo-tex.el'
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
281 (texinfo-define-common-keys texinfo-mode-map)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
282
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
283 ;; bindings for `makeinfo.el'
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
284 (define-key texinfo-mode-map "\C-c\C-m\C-k" 'kill-compilation)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
285 (define-key texinfo-mode-map "\C-c\C-m\C-l"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
286 'makeinfo-recenter-compilation-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
287 (define-key texinfo-mode-map "\C-c\C-m\C-r" 'makeinfo-region)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
288 (define-key texinfo-mode-map "\C-c\C-m\C-b" 'makeinfo-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
289
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
290 ; Bindings for texinfmt.el.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
291 (define-key texinfo-mode-map "\C-c\C-e\C-r" 'texinfo-format-region)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
292 (define-key texinfo-mode-map "\C-c\C-e\C-b" 'texinfo-format-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
293
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
294 ;; bindings for updating nodes and menus
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
295
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
296 (define-key texinfo-mode-map "\C-c\C-um" 'texinfo-master-menu)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
297
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
298 (define-key texinfo-mode-map "\C-c\C-u\C-m" 'texinfo-make-menu)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
299 (define-key texinfo-mode-map "\C-c\C-u\C-n" 'texinfo-update-node)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
300 (define-key texinfo-mode-map "\C-c\C-u\C-e" 'texinfo-every-node-update)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
301 (define-key texinfo-mode-map "\C-c\C-u\C-a" 'texinfo-all-menus-update)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
302
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
303 (define-key texinfo-mode-map "\C-c\C-s" 'texinfo-show-structure)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
304
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
305 (define-key texinfo-mode-map "\C-c}" 'up-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
306 (define-key texinfo-mode-map "\C-c{" 'texinfo-insert-braces)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
307
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
308 ;; bindings for inserting strings
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
309
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
310 (define-key texinfo-mode-map "\C-c\C-c\C-d" 'texinfo-start-menu-description)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
311
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
312 (define-key texinfo-mode-map "\C-c\C-cv" 'texinfo-insert-@var)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
313 (define-key texinfo-mode-map "\C-c\C-ct" 'texinfo-insert-@table)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
314 (define-key texinfo-mode-map "\C-c\C-cs" 'texinfo-insert-@samp)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
315 (define-key texinfo-mode-map "\C-c\C-co" 'texinfo-insert-@noindent)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
316 (define-key texinfo-mode-map "\C-c\C-cn" 'texinfo-insert-@node)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
317 (define-key texinfo-mode-map "\C-c\C-ck" 'texinfo-insert-@kbd)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
318 (define-key texinfo-mode-map "\C-c\C-ci" 'texinfo-insert-@item)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
319 (define-key texinfo-mode-map "\C-c\C-cf" 'texinfo-insert-@file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
320 (define-key texinfo-mode-map "\C-c\C-cx" 'texinfo-insert-@example)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
321 (define-key texinfo-mode-map "\C-c\C-ce" 'texinfo-insert-@end)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
322 (define-key texinfo-mode-map "\C-c\C-cd" 'texinfo-insert-@dfn)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
323 (define-key texinfo-mode-map "\C-c\C-cc" 'texinfo-insert-@code))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
324
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
325
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
326 ;;; Texinfo mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
327
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
328 (defvar texinfo-chapter-level-regexp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
329 "chapter\\|unnumbered \\|appendix \\|majorheading\\|chapheading"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
330 "Regular expression matching Texinfo chapter-level headings.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
331 This does not match `@node' and does not match the `@top' command.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
332
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
333 ;;;###autoload
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
334 (defun texinfo-mode ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
335 "Major mode for editing Texinfo files.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
336
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
337 It has these extra commands:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
338 \\{texinfo-mode-map}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
339
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
340 These are files that are used as input for TeX to make printed manuals
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
341 and also to be turned into Info files with \\[makeinfo-buffer] or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
342 the `makeinfo' program. These files must be written in a very restricted and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
343 modified version of TeX input format.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
344
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
345 Editing commands are like text-mode except that the syntax table is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
346 set up so expression commands skip Texinfo bracket groups. To see
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
347 what the Info version of a region of the Texinfo file will look like,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
348 use \\[makeinfo-region], which runs `makeinfo' on the current region.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
349
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
350 You can show the structure of a Texinfo file with \\[texinfo-show-structure].
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
351 This command shows the structure of a Texinfo file by listing the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
352 lines with the @-sign commands for @chapter, @section, and the like.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
353 These lines are displayed in another window called the *Occur* window.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
354 In that window, you can position the cursor over one of the lines and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
355 use \\[occur-mode-goto-occurrence], to jump to the corresponding spot
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
356 in the Texinfo file.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
357
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
358 In addition, Texinfo mode provides commands that insert various
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
359 frequently used @-sign commands into the buffer. You can use these
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
360 commands to save keystrokes. And you can insert balanced braces with
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
361 \\[texinfo-insert-braces] and later use the command \\[up-list] to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
362 move forward past the closing brace.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
363
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
364 Also, Texinfo mode provides functions for automatically creating or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
365 updating menus and node pointers. These functions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
366
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
367 * insert the `Next', `Previous' and `Up' pointers of a node,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
368 * insert or update the menu for a section, and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
369 * create a master menu for a Texinfo source file.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
370
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
371 Here are the functions:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
372
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
373 texinfo-update-node \\[texinfo-update-node]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
374 texinfo-every-node-update \\[texinfo-every-node-update]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
375 texinfo-sequential-node-update
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
376
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
377 texinfo-make-menu \\[texinfo-make-menu]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
378 texinfo-all-menus-update \\[texinfo-all-menus-update]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
379 texinfo-master-menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
380
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
381 texinfo-indent-menu-description (column &optional region-p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
382
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
383 The `texinfo-column-for-description' variable specifies the column to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
384 which menu descriptions are indented.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
385
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
386 Passed an argument (a prefix argument, if interactive), the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
387 `texinfo-update-node' and `texinfo-make-menu' functions do their jobs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
388 in the region.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
389
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
390 To use the updating commands, you must structure your Texinfo file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
391 hierarchically, such that each `@node' line, with the exception of the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
392 Top node, is accompanied by some kind of section line, such as an
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
393 `@chapter' or `@section' line.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
394
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
395 If the file has a `top' node, it must be called `top' or `Top' and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
396 be the first node in the file.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
397
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
398 Entering Texinfo mode calls the value of text-mode-hook, and then the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
399 value of texinfo-mode-hook."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
400 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
401 (text-mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
402 (setq mode-name "Texinfo")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
403 (setq major-mode 'texinfo-mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
404 (use-local-map texinfo-mode-map)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
405 (set-syntax-table texinfo-mode-syntax-table)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
406 (make-local-variable 'page-delimiter)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
407 (setq page-delimiter
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
408 (concat
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
409 "^@node [ \t]*[Tt]op\\|^@\\("
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
410 texinfo-chapter-level-regexp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
411 "\\)"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
412 (make-local-variable 'require-final-newline)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
413 (setq require-final-newline t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
414 (make-local-variable 'indent-tabs-mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
415 (setq indent-tabs-mode nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
416 (make-local-variable 'paragraph-separate)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
417 (setq paragraph-separate (concat "\b\\|@[a-zA-Z]*[ \n]\\|" paragraph-separate))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
418 (make-local-variable 'paragraph-start)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
419 (setq paragraph-start (concat "\b\\|@[a-zA-Z]*[ \n]\\|" paragraph-start))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
420 (make-local-variable 'fill-column)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
421 (setq fill-column 72)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
422 (make-local-variable 'comment-start)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
423 (setq comment-start "@c ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
424 (make-local-variable 'comment-start-skip)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
425 (setq comment-start-skip "@c +")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
426 (make-local-variable 'words-include-escapes)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
427 (setq words-include-escapes t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
428 ; (make-local-variable 'imenu-generic-expression)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
429 ; (setq imenu-generic-expression texinfo-imenu-generic-expression)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
430 (make-local-variable 'tex-start-of-header)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
431 (setq tex-start-of-header "%**start")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
432 (make-local-variable 'tex-end-of-header)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
433 (setq tex-end-of-header "%**end")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
434 (run-hooks 'text-mode-hook 'texinfo-mode-hook))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
435
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
436
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
437 ;;; Insert string commands
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
438
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
439 (defconst texinfo-environment-regexp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
440 "^[ \t]*@\\(f?table\\|enumerate\\|itemize\
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
441 \\|ifhtml\\|ifinfo\\|iftex\\|ifset\\|ifclear\
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
442 \\|example\\|quotation\\|lisp\\|smallexample\\|smalllisp\\|display\\|format\
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
443 \\|flushleft\\|flushright\\|ignore\\|group\\|tex\\|html\\|cartouche\\|menu\
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
444 \\|titlepage\\|end\\|def[a-z]*[a-wyz]\\>\\)"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
445 "Regexp for environment-like Texinfo list commands.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
446 Subexpression 1 is what goes into the corresponding `@end' statement.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
447
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
448 (defun texinfo-insert-@end ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
449 "Insert the matching `@end' for the last Texinfo command that needs one."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
450 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
451 (let ((depth 1) string)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
452 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
453 (while (and (> depth 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
454 (re-search-backward texinfo-environment-regexp nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
455 (if (looking-at "@end")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
456 (setq depth (1+ depth))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
457 (setq depth (1- depth)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
458 (looking-at texinfo-environment-regexp)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
459 (if (zerop depth)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
460 (setq string
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
461 (buffer-substring (match-beginning 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
462 (match-end 1)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
463 (insert "@end ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
464 (if string (insert string "\n"))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
465
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
466 ;; The following insert commands accept a prefix arg N, which is the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
467 ;; number of words (actually s-exprs) that should be surrounded by
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
468 ;; braces. Thus you can first paste a variable name into a .texinfo
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
469 ;; buffer, then say C-u 1 C-c C-c v at the beginning of the just
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
470 ;; pasted variable name to put @var{...} *around* the variable name.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
471 ;; Operate on previous word or words with negative arg.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
472
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
473 ;; These commands use texinfo-insert-@-with-arg
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
474 (defun texinfo-insert-@-with-arg (string &optional arg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
475 (if arg
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
476 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
477 (setq arg (prefix-numeric-value arg))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
478 (if (< arg 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
479 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
480 (skip-chars-backward " \t\n\r\f")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
481 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
482 (forward-sexp arg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
483 (insert "@" string "{"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
484 (insert "}"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
485 (skip-chars-forward " \t\n\r\f")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
486 (insert "@" string "{")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
487 (forward-sexp arg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
488 (insert "}")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
489 (insert "@" string "{}")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
490 (backward-char)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
491
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
492 (defun texinfo-insert-braces ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
493 "Make a pair of braces and be poised to type inside of them.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
494 Use \\[up-list] to move forward out of the braces."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
495 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
496 (insert "{}")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
497 (backward-char))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
498
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
499 (defun texinfo-insert-@code (&optional arg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
500 "Insert a `@code{...}' command in a Texinfo buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
501 A numeric argument says how many words the braces should surround.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
502 The default is not to surround any existing words with the braces."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
503 (interactive "P")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
504 (texinfo-insert-@-with-arg "code" arg))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
505
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
506 (defun texinfo-insert-@dfn (&optional arg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
507 "Insert a `@dfn{...}' command in a Texinfo buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
508 A numeric argument says how many words the braces should surround.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
509 The default is not to surround any existing words with the braces."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
510 (interactive "P")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
511 (texinfo-insert-@-with-arg "dfn" arg))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
512
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
513 (defun texinfo-insert-@example ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
514 "Insert the string `@example' in a Texinfo buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
515 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
516 (insert "@example\n"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
517
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
518 (defun texinfo-insert-@file (&optional arg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
519 "Insert a `@file{...}' command in a Texinfo buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
520 A numeric argument says how many words the braces should surround.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
521 The default is not to surround any existing words with the braces."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
522 (interactive "P")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
523 (texinfo-insert-@-with-arg "file" arg))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
524
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
525 (defun texinfo-insert-@item ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
526 "Insert the string `@item' in a Texinfo buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
527 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
528 (insert "@item")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
529 (newline))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
530
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
531 (defun texinfo-insert-@kbd (&optional arg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
532 "Insert a `@kbd{...}' command in a Texinfo buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
533 A numeric argument says how many words the braces should surround.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
534 The default is not to surround any existing words with the braces."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
535 (interactive "P")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
536 (texinfo-insert-@-with-arg "kbd" arg))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
537
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
538 (defun texinfo-insert-@node ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
539 "Insert the string `@node' in a Texinfo buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
540 This also inserts on the following line a comment indicating
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
541 the order of arguments to @node."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
542 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
543 (insert "@node \n@comment node-name, next, previous, up")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
544 (forward-line -1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
545 (forward-char 6))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
546
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
547 (defun texinfo-insert-@noindent ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
548 "Insert the string `@noindent' in a Texinfo buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
549 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
550 (insert "@noindent\n"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
551
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
552 (defun texinfo-insert-@samp (&optional arg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
553 "Insert a `@samp{...}' command in a Texinfo buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
554 A numeric argument says how many words the braces should surround.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
555 The default is not to surround any existing words with the braces."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
556 (interactive "P")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
557 (texinfo-insert-@-with-arg "samp" arg))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
558
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
559 (defun texinfo-insert-@table (&optional arg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
560 "Insert the string `@table' in a Texinfo buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
561 (interactive "P")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
562 (insert "@table "))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
563
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
564 (defun texinfo-insert-@var (&optional arg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
565 "Insert a `@var{}' command in a Texinfo buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
566 A numeric argument says how many words the braces should surround.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
567 The default is not to surround any existing words with the braces."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
568 (interactive "P")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
569 (texinfo-insert-@-with-arg "var" arg))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
570
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
571 ;;; Texinfo file structure
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
572
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
573 (defun texinfo-show-structure (&optional nodes-too)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
574 "Show the structure of a Texinfo file.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
575 List the lines in the file that begin with the @-sign commands for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
576 @chapter, @section, and the like.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
577
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
578 With optional argument (prefix if interactive), list both the lines
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
579 with @-sign commands for @chapter, @section, and the like, and list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
580 @node lines.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
581
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
582 Lines with structuring commands beginning in them are displayed in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
583 another buffer named `*Occur*'. In that buffer, you can move point to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
584 one of those lines and then use \\<occur-mode-map>\\[occur-mode-goto-occurrence],
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
585 to jump to the corresponding spot in the Texinfo source file."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
586
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
587 (interactive "P")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
588 (require 'texnfo-upd)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
589 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
590 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
591 (if nodes-too
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
592 (occur (concat "\\(^@node\\)\\|" texinfo-section-types-regexp))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
593 (occur texinfo-section-types-regexp)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
594 (pop-to-buffer "*Occur*")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
595 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
596 (flush-lines "-----")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
597 ;; Now format the "*Occur*" buffer to show the structure.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
598 ;; Thanks to ceder@signum.se (Per Cederqvist)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
599 (goto-char (point-max))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
600 (let ((margin 5))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
601 (while (re-search-backward "^ *[0-9]*:" nil 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
602 (re-search-forward ":")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
603 (setq margin
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
604 (cond
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
605 ((looking-at
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
606 (concat "@\\(" texinfo-chapter-level-regexp "\\)")) 5)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
607 ;; ((looking-at "@chapter ") 5)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
608 ;; ((looking-at "@unnumbered ") 5)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
609 ;; ((looking-at "@appendix ") 5)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
610 ;; ((looking-at "@majorheading ") 5)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
611 ;; ((looking-at "@chapheading ") 5)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
612
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
613 ((looking-at
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
614 (concat "@\\(" texinfo-section-level-regexp "\\)")) 9)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
615 ;; ((looking-at "@section ") 9)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
616 ;; ((looking-at "@unnumberedsec ") 9)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
617 ;; ((looking-at "@appendixsec ") 9)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
618 ;; ((looking-at "@heading ") 9)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
619
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
620 ((looking-at
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
621 (concat "@\\(" texinfo-subsection-level-regexp "\\)")) 13)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
622 ;; ((looking-at "@subsection ") 13)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
623 ;; ((looking-at "@unnumberedsubsec ") 13)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
624 ;; ((looking-at "@appendixsubsec ") 13)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
625 ;; ((looking-at "@subheading ") 13)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
626
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
627 ((looking-at
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
628 (concat "@\\(" texinfo-subsubsection-level-regexp "\\)")) 17)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
629 ;; ((looking-at "@subsubsection ") 17)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
630 ;; ((looking-at "@unnumberedsubsubsec ") 17)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
631 ;; ((looking-at "@appendixsubsubsec ") 17)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
632 ;; ((looking-at "@subsubheading ") 17)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
633 (t margin)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
634 (indent-to-column margin)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
635 (beginning-of-line))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
636
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
637 ;;; The tex and print function definitions:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
638
120
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 16
diff changeset
639 (defcustom texinfo-texi2dvi-command "texi2dvi"
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 16
diff changeset
640 "*Command used by `texinfo-tex-buffer' to run TeX and texindex on a buffer."
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 16
diff changeset
641 :type 'string
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 16
diff changeset
642 :group 'texinfo)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
643
120
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 16
diff changeset
644 (defcustom texinfo-tex-command "tex"
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 16
diff changeset
645 "*Command used by `texinfo-tex-region' to run TeX on a region."
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 16
diff changeset
646 :type 'string
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 16
diff changeset
647 :group 'texinfo)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
648
120
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 16
diff changeset
649 (defcustom texinfo-texindex-command "texindex"
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 16
diff changeset
650 "*Command used by `texinfo-texindex' to sort unsorted index files."
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 16
diff changeset
651 :type 'string
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 16
diff changeset
652 :group 'texinfo)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
653
120
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 16
diff changeset
654 (defcustom texinfo-delete-from-print-queue-command "lprm"
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
655 "*Command string used to delete a job from the line printer queue.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
656 Command is used by \\[texinfo-delete-from-print-queue] based on
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
657 number provided by a previous \\[tex-show-print-queue]
120
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 16
diff changeset
658 command."
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 16
diff changeset
659 :type 'string
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 16
diff changeset
660 :group 'texinfo)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
661
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
662 (defvar texinfo-tex-trailer "@bye"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
663 "String appended after a region sent to TeX by `texinfo-tex-region'.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
664
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
665 (defun texinfo-tex-region (beg end)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
666 "Run TeX on the current region.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
667 This works by writing a temporary file (`tex-zap-file') in the directory
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
668 that is the value of `tex-directory', then running TeX on that file.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
669
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
670 The first line of the buffer is copied to the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
671 temporary file; and if the buffer has a header, it is written to the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
672 temporary file before the region itself. The buffer's header is all lines
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
673 between the strings defined by `tex-start-of-header' and `tex-end-of-header'
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
674 inclusive. The header must start in the first 100 lines.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
675
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
676 The value of `texinfo-tex-trailer' is appended to the temporary file after the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
677 (interactive "r")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
678 (require 'tex-mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
679 (if (get-buffer "*tex-shell*")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
680 (tex-kill-job)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
681 (tex-start-shell))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
682 (or tex-zap-file (setq tex-zap-file (make-temp-name "#tz")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
683 (let ((tex-out-file (concat tex-zap-file ".tex"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
684 (temp-buffer (get-buffer-create " tex-Output-Buffer"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
685 (zap-directory
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
686 (file-name-as-directory (expand-file-name tex-directory))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
687 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
688 (save-restriction
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
689 (widen)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
690 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
691 (forward-line 100)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
692 (let ((search-end (point))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
693 (hbeg (point-min)) (hend (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
694 (default-directory zap-directory))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
695 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
696
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
697 ;; Copy first line, the `\input texinfo' line, to temp file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
698 (write-region (point)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
699 (save-excursion (end-of-line) (point))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
700 tex-out-file nil nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
701
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
702 ;; Don't copy first line twice if region includes it.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
703 (forward-line 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
704 (if (< beg (point)) (setq beg (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
705
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
706 ;; Initialize the temp file with either the header or nothing
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
707 (if (search-forward tex-start-of-header search-end t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
708 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
709 (beginning-of-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
710 (setq hbeg (point)) ; Mark beginning of header.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
711 (if (search-forward tex-end-of-header nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
712 (progn (beginning-of-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
713 (setq hend (point))) ; Mark end of header.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
714 (setq hbeg (point-min))))) ; Else no header.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
715
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
716 ;; Copy header to temp file.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
717 (write-region (min hbeg beg) hend tex-out-file t nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
718
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
719 ;; Copy region to temp file.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
720 (write-region (max beg hend) end tex-out-file t nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
721
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
722 ;; This is a kludge to insert the tex-trailer into the tex-out-file.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
723 ;; We have to create a special buffer in which to insert
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
724 ;; the tex-trailer first because there is no function with
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
725 ;; which to append a literal string directly to a file.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
726 (let ((local-tex-trailer texinfo-tex-trailer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
727 (set-buffer temp-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
728 (erase-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
729 ;; make sure trailer isn't hidden by a comment
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
730 (insert-string "\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
731 (if local-tex-trailer (insert-string local-tex-trailer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
732 (tex-set-buffer-directory temp-buffer zap-directory)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
733 (write-region (point-min) (point-max) tex-out-file t nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
734
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
735 ;;; The following is sufficient in Emacs 19.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
736 ;;; (write-region (concat "\n" texinfo-tex-trailer) nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
737 ;;; tex-out-file t nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
738 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
739
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
740 (tex-set-buffer-directory "*tex-shell*" zap-directory)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
741 (tex-send-command tex-shell-cd-command zap-directory)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
742 (tex-send-command texinfo-tex-command tex-out-file))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
743 (tex-recenter-output-buffer 0))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
744
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
745 (defun texinfo-tex-buffer ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
746 "Run TeX on visited file, once or twice, to make a correct `.dvi' file."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
747 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
748
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
749 ;; Make sure TeX shell is running.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
750 (require 'tex-mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
751 (if (get-buffer "*tex-shell*")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
752 (quit-process (get-process "tex-shell") t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
753 (tex-start-shell))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
754
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
755 (cond ((null buffer-file-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
756 (error "Buffer not visiting any file!"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
757 ((buffer-modified-p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
758 (error "Buffer has been modified since last saved!")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
759
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
760 (setq tex-zap-file buffer-file-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
761
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
762 (tex-send-command tex-shell-cd-command (file-name-directory tex-zap-file))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
763
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
764 (tex-send-command texinfo-texi2dvi-command tex-zap-file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
765
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
766 (tex-recenter-output-buffer 0))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
767
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
768 (defun texinfo-texindex ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
769 "Run `texindex' on unsorted index files.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
770 The index files are made by \\[texinfo-tex-region] or \\[texinfo-tex-buffer].
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
771 This runs the shell command defined by `texinfo-texindex-command'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
772 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
773 (require 'tex-mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
774 (tex-send-command texinfo-texindex-command (concat tex-zap-file ".??"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
775 (tex-recenter-output-buffer nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
776
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
777 (defun texinfo-tex-print ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
778 "Print `.dvi' file made by \\[texinfo-tex-region] or \\[texinfo-tex-buffer].
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
779 This runs the shell command defined by `tex-dvi-print-command'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
780 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
781 (require 'tex-mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
782 (tex-send-command tex-dvi-print-command (concat tex-zap-file ".dvi"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
783 (tex-recenter-output-buffer nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
784
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
785 (defun texinfo-quit-job ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
786 "Quit currently running TeX job, by sending an `x' to it."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
787 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
788 (if (not (get-process "tex-shell"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
789 (error "No TeX shell running"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
790 (tex-send-command "x"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
791
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
792 (defun texinfo-delete-from-print-queue (job-number)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
793 "Delete job from the line printer spooling queue.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
794 You are prompted for the job number (use a number shown by a previous
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
795 \\[texinfo-show-print-queue] command)."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
796 (interactive "nPrinter job number for deletion: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
797 (require 'tex-mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
798 (if (tex-shell-running)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
799 (tex-kill-job)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
800 (tex-start-shell))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
801 (tex-send-command texinfo-delete-from-print-queue-command job-number)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
802 (tex-recenter-output-buffer nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
803
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
804 (provide 'texinfo)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
805
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
806 ;;; texinfo.el ends here