0
|
1 ;;; info.el --- info package for Emacs.
|
|
2 ;; Keywords: help
|
|
3
|
|
4 ;; Copyright (C) 1985, 1986, 1993 Free Software Foundation, Inc.
|
|
5
|
|
6 ;; Author: Dave Gillespie <daveg@synaptics.com>
|
|
7 ;; Richard Stallman <rms@gnu.ai.mit.edu>
|
|
8 ;; Maintainer: Dave Gillespie <daveg@synaptics.com>
|
|
9 ;; Version: 1.07 of 7/22/93
|
|
10
|
|
11 ;; This file is part of XEmacs.
|
|
12
|
|
13 ;; XEmacs is free software; you can redistribute it and/or modify it
|
|
14 ;; under the terms of the GNU General Public License as published by
|
|
15 ;; the Free Software Foundation; either version 2, or (at your option)
|
|
16 ;; any later version.
|
|
17
|
|
18 ;; XEmacs is distributed in the hope that it will be useful, but
|
|
19 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
20 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
21 ;; General Public License for more details.
|
|
22
|
|
23 ;; You should have received a copy of the GNU General Public License
|
16
|
24 ;; along with XEmacs; see the file COPYING. If not, write to the
|
|
25 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
26 ;; Boston, MA 02111-1307, USA.
|
0
|
27
|
|
28 ;;; Synched up with: Not synched with FSF.
|
|
29
|
|
30 ;; Commentary:
|
|
31
|
|
32 ;; This is based on an early Emacs 19 info.el file.
|
|
33 ;;
|
|
34 ;; Note that Info-directory has been replaced by Info-directory-list,
|
|
35 ;; a search path of directories in which to find Info files.
|
|
36 ;; Also, Info tries adding ".info" to a file name if the name itself
|
|
37 ;; is not found.
|
|
38 ;;
|
|
39 ;; See the change log below for further details.
|
|
40
|
|
41
|
|
42 ;; LCD Archive Entry:
|
|
43 ;; info-dg|Dave Gillespie|daveg@synaptics.com
|
|
44 ;; |Info reader with many enhancements; replaces standard info.el.
|
|
45 ;; |93-07-22|1.07|~/modes/info.el
|
|
46
|
|
47 ;; Also available from anonymous FTP on csvax.cs.caltech.edu.
|
|
48
|
|
49
|
|
50 ;; Change Log:
|
|
51
|
|
52 ;; Modified 3/7/1991 by Dave Gillespie:
|
|
53 ;; (Author's address: daveg@synaptics.com or daveg@csvax.cs.caltech.edu)
|
|
54 ;;
|
|
55 ;; Added keys: i, t, <, >, [, ], {, }, 6, 7, 8, 9, 0.
|
|
56 ;; Look at help for info-mode (type ? in Info) for descriptions.
|
|
57 ;;
|
|
58 ;; If Info-directory-list is undefined and there is no INFOPATH
|
|
59 ;; in the environment, use value of Info-directory for compatibility
|
|
60 ;; with Emacs 18.57.
|
|
61 ;;
|
|
62 ;; All files named "localdir" found in the path are appended to "dir",
|
|
63 ;; the Info directory. For this to work, "dir" should contain only
|
|
64 ;; one node (Top), and each "localdir" should contain no ^_ or ^L
|
|
65 ;; characters. Generally they will contain only one or several
|
|
66 ;; additional lines for the top-level menu. Note that "dir" is
|
|
67 ;; modified in memory each time it is loaded, but not on disk.
|
|
68 ;;
|
|
69 ;; If "dir" contains a line of the form: "* Locals:"
|
|
70 ;; then the "localdir"s are inserted there instead of at the end.
|
|
71
|
|
72
|
|
73 ;; Modified 4/3/1991 by Dave Gillespie:
|
|
74 ;;
|
|
75 ;; Added Info-mode-hook (suggested by Sebastian Kremer).
|
|
76 ;; Also added epoch-info-startup/select-hooks from Simon Spero's info.el.
|
|
77 ;;
|
|
78 ;; Added automatic decoding of compressed Info files.
|
|
79 ;; See documentation for the variable Info-suffix-list. Default is to
|
|
80 ;; run "uncompress" on ".Z" files and "unyabba" on ".Y" files.
|
|
81 ;; (See comp.sources.unix v24i073-076 for yabba/unyabba, a free software
|
|
82 ;; alternative to compress/uncompress.)
|
|
83 ;; Note: "dir" and "localdir" files should not be compressed.
|
|
84 ;;
|
|
85 ;; Changed variables like Info-enable-edit to be settable by M-x set-variable.
|
|
86 ;;
|
|
87 ;; Added Info-auto-advance variable. If t, SPC and DEL will act like
|
|
88 ;; } and {, i.e., they advance to the next/previous node if at the end
|
|
89 ;; of the buffer.
|
|
90 ;;
|
|
91 ;; Changed `u' to restore point to most recent location in that node.
|
|
92 ;; Added `=' to do this manually at any time. (Suggested by David Fox).
|
|
93 ;;
|
|
94 ;; Changed `m' and `0-9' to try interpreting menu name as a file name
|
|
95 ;; if not found as a node name. This allows (dir) menus of the form,
|
|
96 ;; Emacs:: Cool text editor
|
|
97 ;; as a shorthand for
|
|
98 ;; Emacs:(emacs). Cool text editor
|
|
99 ;;
|
|
100 ;; Enhanced `i' to use line-number information in the index.
|
|
101 ;; Added `,' to move among all matches to a previous `i' command.
|
|
102 ;;
|
|
103 ;; Added `a' (Info-annotate) for adding personal notes to any Info node.
|
|
104 ;; Notes are not stored in the actual Info files, but in the user's own
|
|
105 ;; ~/.infonotes file.
|
|
106 ;;
|
|
107 ;; Added Info-footnote-tag, made default be "Ref" instead of "Note".
|
|
108 ;;
|
|
109 ;; Got mouse-click stuff to work under Emacs version 18. Check it out!
|
|
110 ;; Left and right clicks scroll the Info window.
|
|
111 ;; Middle click goes to clicked-on node, e.g., "Next:", a menu, or a note.
|
|
112
|
|
113
|
|
114 ;; Modified 6/29/1991 by Dave Gillespie:
|
|
115 ;;
|
|
116 ;; Renamed epoch-info-startup/select-hooks to Info-startup/select-hook.
|
|
117 ;;
|
|
118 ;; Made Info-select-node into a command on the `!' key.
|
|
119 ;;
|
|
120 ;; Added Info-mouse-support user option.
|
|
121 ;;
|
|
122 ;; Cleaned up the implementation of some routines.
|
|
123 ;;
|
|
124 ;; Added special treatment of quoted words in annotations: The `g'
|
|
125 ;; command for a nonexistent node name scans for an annotation
|
|
126 ;; (in any node of any file) containing that name in quotes: g foo RET
|
|
127 ;; looks for an annotation containing: "foo" or: <<foo>>
|
|
128 ;; If found, it goes to that file and node.
|
|
129 ;;
|
|
130 ;; Added a call to set up Info-directory-list in Info-find-node to
|
|
131 ;; work around a bug in GNUS where it calls Info-goto-node before info.
|
|
132 ;;
|
|
133 ;; Added completion for `g' command (inspired by Richard Kim's infox.el).
|
|
134 ;; Completion knows all node names for the current file, and all annotation
|
|
135 ;; tags (see above). It does not complete file names or node names in
|
|
136 ;; other files.
|
|
137 ;;
|
|
138 ;; Added `k' (Info-emacs-key) and `*' (Info-elisp-ref) commands. You may
|
|
139 ;; wish to bind these to global keys outside of Info mode.
|
|
140 ;;
|
|
141 ;; Allowed localdir files to be full dir-like files; only the menu part
|
|
142 ;; of each localdir is copied. Also, redundant menu items are omitted.
|
|
143 ;;
|
|
144 ;; Changed Info-history to hold only one entry at a time for each node,
|
|
145 ;; and to be circular so that multiple `l's come back again to the most
|
|
146 ;; recent node. Note that the format of Info-history entries has changed,
|
|
147 ;; which may interfere with external programs that try to operate on it.
|
|
148 ;; (Also inspired by Kim's infox.el).
|
|
149 ;;
|
|
150 ;; Changed `n', `]', `l', etc. to accept prefix arguments to move several
|
|
151 ;; steps at once. Most accept negative arguments to move oppositely.
|
|
152 ;;
|
|
153 ;; Changed `?' to bury *Help* buffer afterwards to keep it out of the way.
|
|
154 ;;
|
|
155 ;; Rearranged `?' key's display to be a little better for new users.
|
|
156 ;;
|
|
157 ;; Changed `a' to save whole window configuration and restore on C-c C-c.
|
|
158 ;;
|
|
159 ;; Fixed the bug reported by Bill Reynolds on gnu.emacs.bugs.
|
|
160 ;;
|
|
161 ;; Changed Info-last to restore window-start as well as cursor position.
|
|
162 ;;
|
|
163 ;; Changed middle mouse button in space after end of node to do Info-last
|
|
164 ;; if we got here by following a cross reference, else do Info-global-next.
|
|
165 ;;
|
|
166 ;; Added some new mouse bindings: shift-left = Info-global-next,
|
|
167 ;; shift-right = Info-global-prev, shift-middle = Info-last.
|
|
168 ;;
|
|
169 ;; Fixed Info-follow-reference not to make assumptions about length
|
|
170 ;; of Info-footnote-tag [Linus Tolke].
|
|
171 ;;
|
|
172 ;; Changed default for Info-auto-advance mode to be press-twice-for-next-node.
|
|
173 ;;
|
|
174 ;; Modified x-mouse-ignore to preserve last-command variable, so that
|
|
175 ;; press-twice Info-auto-advance mode works with the mouse.
|
|
176
|
|
177
|
|
178 ;; Modified 3/4/1992 by Dave Gillespie:
|
|
179 ;;
|
|
180 ;; Added an "autoload" command to help autoload.el.
|
|
181 ;;
|
|
182 ;; Changed `*' command to look for file `elisp' as well as for `lispref'.
|
|
183 ;;
|
|
184 ;; Fixed a bug involving footnote names containing regexp special characters.
|
|
185 ;;
|
|
186 ;; Fixed a bug in completion during `f' (or `r') command.
|
|
187 ;;
|
|
188 ;; Added TAB (Info-next-reference), M-TAB, and RET keys to Info mode.
|
|
189 ;;
|
|
190 ;; Added new bindings, `C-h C-k' for Info-emacs-key and `C-h C-f' for
|
|
191 ;; Info-elisp-ref. These bindings are made when info.el is loaded, and
|
|
192 ;; only if those key sequences were previously unbound. These bindings
|
|
193 ;; work at any time, not just when Info is already running.
|
|
194
|
|
195
|
|
196 ;; Modified 3/8/1992 by Dave Gillespie:
|
|
197 ;;
|
|
198 ;; Fixed some long lines that were causing trouble with mailers.
|
|
199
|
|
200
|
|
201 ;; Modified 3/9/1992 by Dave Gillespie:
|
|
202 ;;
|
|
203 ;; Added `C-h C-i' (Info-query).
|
|
204 ;;
|
|
205 ;; Added Info-novice mode, warns if the user attempts to switch to
|
|
206 ;; a different Info file.
|
|
207 ;;
|
|
208 ;; Fixed a bug that caused problems using compressed Info files
|
|
209 ;; and Info-directory-list at the same time.
|
|
210 ;;
|
|
211 ;; Disabled Info-mouse-support by default if Epoch or Hyperbole is in use.
|
|
212 ;;
|
|
213 ;; Added an expand-file-name call to Info-find-node to fix a small bug.
|
|
214
|
|
215
|
|
216 ;; Modified 5/22/1992 by Dave Gillespie:
|
|
217 ;;
|
|
218 ;; Added "standalone" operation: "emacs -f info" runs Emacs specifically
|
|
219 ;; for use as an Info browser. In this mode, the `q' key quits Emacs
|
|
220 ;; itself. Also, "emacs -f info arg" starts in Info file "arg" instead
|
|
221 ;; of "dir".
|
|
222 ;;
|
|
223 ;; Changed to prefer "foo.info" over "foo". If both exist, "foo" is
|
|
224 ;; probably a directory or executable program!
|
|
225 ;;
|
|
226 ;; Made control-mouse act like regular-mouse does in other buffers.
|
|
227 ;; (In most systems, this will be set-cursor for left-mouse, x-cut
|
|
228 ;; for right-mouse, and x-paste, which will be an error, for
|
|
229 ;; middle-mouse.)
|
|
230 ;;
|
|
231 ;; Improved prompting and searching for `,' key.
|
|
232 ;;
|
|
233 ;; Fixed a bug where some "* Menu:" lines disappeared when "dir"
|
|
234 ;; contained several nodes.
|
|
235
|
|
236
|
|
237 ;; Modified 9/10/1992 by Dave Gillespie:
|
|
238 ;;
|
|
239 ;; Mixed in support for XEmacs. Mouse works the same as in
|
|
240 ;; the other Emacs versions by default; added Info-lucid-mouse-style
|
|
241 ;; variable, which enables mouse operation similar to XEmacs's default.
|
|
242 ;;
|
|
243 ;; Fixed a bug where RET couldn't understand "* Foo::" if "Foo" was a
|
|
244 ;; file name instead of a node name.
|
|
245 ;;
|
|
246 ;; Added `x' (Info-bookmark), a simple interface to the annotation
|
|
247 ;; tags feature. Added `j' (Info-goto-bookmark), like `g' but only
|
|
248 ;; completes bookmarks.
|
|
249 ;;
|
|
250 ;; Added `<<tag>>' as alternate to `"tag"' in annotations.
|
|
251 ;;
|
|
252 ;; Added `v' (Info-visit-file), like Info-goto-node but specialized
|
|
253 ;; for going to a new Info file (with file name completion).
|
|
254 ;;
|
|
255 ;; Added recognition of gzip'd ".z" files.
|
|
256
|
|
257
|
|
258 ;; Modified 5/9/1993 by Dave Gillespie:
|
|
259 ;;
|
|
260 ;; Merged in various things from FSF's latest Emacs 19 info.el.
|
|
261 ;; Notably: Added Info-default-directory-list.
|
|
262
|
|
263
|
|
264 ;; Modified 6/2/1993 by Dave Gillespie:
|
|
265 ;;
|
|
266 ;; Changed to use new suffix ".gz" for gzip files.
|
|
267
|
|
268
|
|
269 ;; Modified 7/22/1993 by Dave Gillespie:
|
|
270 ;;
|
|
271 ;; Changed Info-footnote-tag to "See" instead of "Ref".
|
|
272 ;;
|
|
273 ;; Extended Info-fontify-node to work with FSF version of Emacs 19.
|
|
274
|
|
275 ;; Modified 7/30/1993 by Jamie Zawinski:
|
|
276 ;;
|
|
277 ;; Commented out the tty and fsf19 mouse support, because why bother.
|
|
278 ;; Commented out the politically incorrect version of XEmacs mouse support.
|
|
279 ;; Commented out mouse scrolling bindings because the party line on that
|
|
280 ;; is "scrollbars are coming soon."
|
|
281 ;; Commented out munging of help-for-help's doc; put it in help.el.
|
|
282 ;; Did Info-edit-map the modern XEmacs way.
|
|
283 ;; Pruned extra cruft from fontification and mouse handling code.
|
|
284 ;; Fixed ASCII-centric bogosity in unreading of events.
|
|
285
|
|
286 ;; Modified 8/11/95 by Chuck Thompson:
|
|
287 ;;
|
|
288 ;; Removed any pretense of ever referencing Info-directory since it
|
|
289 ;; wasn't working anyhow.
|
|
290
|
120
|
291 ;; Modified 4/5/97 by Tomasz J. Cholewo:
|
|
292 ;;
|
|
293 ;; Modified Info-search to use with-caps-disable-folding
|
|
294
|
0
|
295 ;; Code:
|
|
296
|
120
|
297 (defgroup info nil
|
|
298 "Info subsystem"
|
|
299 :group 'help)
|
0
|
300
|
120
|
301 (defcustom Info-inhibit-toolbar nil
|
|
302 "*Non-nil means don't use the specialized Info toolbar."
|
|
303 :type 'boolean
|
|
304 :group 'info)
|
|
305
|
|
306 (defcustom Info-novice nil
|
|
307 "*Non-nil means to ask for confirmation before switching Info files."
|
|
308 :type 'boolean
|
|
309 :group 'info)
|
0
|
310
|
|
311 (defvar Info-history nil
|
|
312 "List of info nodes user has visited.
|
|
313 Each element of list is a list (\"(FILENAME)NODENAME\" BUFPOS WINSTART).")
|
|
314
|
|
315 (defvar Info-keeping-history t
|
|
316 "Non-nil if Info-find-node should modify Info-history.
|
|
317 This is for use only by certain internal Info routines.")
|
|
318
|
120
|
319 (defcustom Info-enable-edit nil
|
0
|
320 "*Non-nil means the \\<Info-mode-map>\\[Info-edit] command in Info
|
|
321 can edit the current node.
|
|
322 This is convenient if you want to write info files by hand.
|
|
323 However, we recommend that you not do this.
|
|
324 It is better to write a Texinfo file and generate the Info file from that,
|
120
|
325 because that gives you a printed manual as well."
|
|
326 :type 'boolean
|
|
327 :group 'info)
|
0
|
328
|
120
|
329 (defcustom Info-enable-active-nodes t
|
0
|
330 "*Non-nil allows Info to execute Lisp code associated with nodes.
|
120
|
331 The Lisp code is executed when the node is selected."
|
|
332 :type 'boolean
|
|
333 :group 'info)
|
0
|
334
|
120
|
335 (defcustom Info-restoring-point t
|
|
336 "*Non-nil means to restore the cursor position when re-entering a node."
|
|
337 :type 'boolean
|
|
338 :group 'info)
|
0
|
339
|
120
|
340 (defcustom Info-auto-advance 'twice
|
0
|
341 "*Control what SPC and DEL do when they can't scroll any further.
|
|
342 If nil, they beep and remain in the current node.
|
|
343 If t, they move to the next node (like Info-global-next/prev).
|
120
|
344 If anything else, they must be pressed twice to move to the next node."
|
|
345 :type '(radio (const :tag "off" nil)
|
|
346 (const :tag "advance" t)
|
|
347 (const :tag "confirm" twice))
|
|
348 :group 'info)
|
0
|
349
|
120
|
350 (defcustom Info-fontify t
|
0
|
351 "*Non-nil enables font features in XEmacs.
|
120
|
352 This variable is ignored unless running under XEmacs."
|
|
353 :type 'boolean
|
|
354 :group 'info)
|
0
|
355
|
120
|
356 (defcustom Info-default-directory-list nil
|
|
357 "*List of default directories to search for Info documentation files.
|
0
|
358 This value is used as the default for `Info-directory-list'. It is set
|
120
|
359 in startup.el."
|
|
360 :type '(repeat directory)
|
|
361 :group 'info)
|
0
|
362
|
|
363 (defvar Info-directory-list
|
|
364 (let ((path (getenv "INFOPATH")))
|
|
365 (if path
|
|
366 (let ((list nil)
|
|
367 idx)
|
|
368 (while (> (length path) 0)
|
|
369 (setq idx (or (string-match ":" path) (length path))
|
|
370 list (cons (substring path 0 idx) list)
|
|
371 path (substring path (min (1+ idx)
|
|
372 (length path)))))
|
|
373 (nreverse list))
|
|
374 Info-default-directory-list))
|
|
375 "List of directories to search for Info documentation files.
|
|
376 Default is to use the environment variable INFOPATH if it exists,
|
|
377 else to use Info-default-directory-list.")
|
|
378
|
|
379 (defvar Info-suffix-list '( (".info" . nil)
|
|
380 (".info.gz" . "gzip -dc %s")
|
|
381 (".info-z" . "gzip -dc %s")
|
|
382 (".info.Z" . "uncompress -c %s")
|
|
383 (".gz" . "gzip -dc %s")
|
|
384 (".Z" . "uncompress -c %s") )
|
|
385 "List of file name suffixes and associated decoding commands.
|
|
386 Each entry should be (SUFFIX . STRING); if STRING contains %s, that is
|
|
387 changed to name of the file to decode, otherwise the file is given to
|
|
388 the command as standard input. If STRING is nil, no decoding is done.")
|
|
389
|
136
|
390 (defvar Info-footnote-tag "Note"
|
0
|
391 "*Symbol that identifies a footnote or cross-reference.
|
|
392 All \"*Note\" references will be changed to use this word instead.")
|
|
393
|
|
394 (defvar Info-current-file nil
|
|
395 "Info file that Info is now looking at, or nil.")
|
|
396
|
|
397 (defvar Info-current-subfile nil
|
|
398 "Info subfile that is actually in the *info* buffer now,
|
|
399 or nil if current info file is not split into subfiles.")
|
|
400
|
|
401 (defvar Info-current-node nil
|
|
402 "Name of node that Info is now looking at, or nil.")
|
|
403
|
|
404 (defvar Info-tag-table-marker (make-marker)
|
|
405 "Marker pointing at beginning of current Info file's tag table.
|
|
406 Marker points nowhere if file has no tag table.")
|
|
407
|
|
408 (defvar Info-current-file-completions nil
|
|
409 "Cached completion list for current Info file.")
|
|
410
|
|
411 (defvar Info-current-annotation-completions nil
|
|
412 "Cached completion list for current annotation files.")
|
|
413
|
|
414 (defvar Info-index-alternatives nil
|
|
415 "List of possible matches for last Info-index command.")
|
|
416 (defvar Info-index-first-alternative nil)
|
|
417
|
120
|
418 (defcustom Info-annotations-path '("~/.infonotes" "/usr/lib/info.notes")
|
0
|
419 "*Names of files that contain annotations for different Info nodes.
|
|
420 By convention, the first one should reside in your personal directory.
|
120
|
421 The last should be a world-writable \"public\" annotations file."
|
|
422 :type '(repeat file)
|
|
423 :group 'info)
|
0
|
424
|
149
|
425 (defcustom Info-button1-follows-hyperlink nil
|
|
426 "*Non-nil means mouse button1 click will follow hyperlink."
|
|
427 :type 'boolean
|
|
428 :group 'info)
|
|
429
|
0
|
430 (defvar Info-standalone nil
|
|
431 "Non-nil if Emacs was started solely as an Info browser.")
|
|
432
|
|
433 (defvar Info-in-cross-reference nil)
|
|
434 (defvar Info-window-configuration nil)
|
|
435
|
|
436 ;;;###autoload
|
|
437 (defun info (&optional file)
|
|
438 "Enter Info, the documentation browser.
|
|
439 Optional argument FILE specifies the file to examine;
|
|
440 the default is the top-level directory of Info.
|
|
441
|
|
442 In interactive use, a prefix argument directs this command
|
|
443 to read a file name from the minibuffer."
|
|
444 (interactive (if current-prefix-arg
|
|
445 (list (read-file-name "Info file name: " nil nil t))))
|
|
446 (let ((p command-line-args))
|
|
447 (while p
|
|
448 (and (string-match "^-[fe]" (car p))
|
|
449 (equal (nth 1 p) "info")
|
|
450 (not Info-standalone)
|
|
451 (setq Info-standalone t)
|
|
452 (= (length p) 3)
|
|
453 (not (string-match "^-" (nth 2 p)))
|
|
454 (setq file (nth 2 p))
|
|
455 (setq command-line-args-left nil))
|
|
456 (setq p (cdr p))))
|
|
457 ; (Info-setup-x)
|
|
458 (if file
|
|
459 (unwind-protect
|
|
460 (Info-goto-node (concat "(" file ")"))
|
|
461 (and Info-standalone (info)))
|
|
462 (if (get-buffer "*info*")
|
|
463 (switch-to-buffer "*info*")
|
|
464 (Info-directory))))
|
|
465
|
|
466 ;;;###autoload
|
|
467 (defun Info-query (file)
|
|
468 "Enter Info, the documentation browser. Prompt for name of Info file."
|
|
469 (interactive "sInfo topic (default = menu): ")
|
|
470 (info)
|
|
471 (if (equal file "")
|
|
472 (Info-goto-node "(dir)")
|
|
473 (Info-goto-node (concat "(" file ")"))))
|
|
474
|
|
475 (defun Info-setup-initial ()
|
|
476 (let ((f Info-annotations-path))
|
|
477 (while f
|
|
478 (if (and (file-exists-p (car f)) (not (get-file-buffer (car f))))
|
|
479 (bury-buffer (find-file-noselect (car f))))
|
|
480 (setq f (cdr f)))))
|
|
481
|
|
482 (defconst Info-emacs-info-file-name "xemacs")
|
|
483
|
|
484 ;; Go to an info node specified as separate filename and nodename.
|
|
485 ;; no-going-back is non-nil if recovering from an error in this function;
|
|
486 ;; it says do not attempt further (recursive) error recovery.
|
|
487 (defun Info-find-node (filename &optional nodename no-going-back tryfile line)
|
|
488 ;; Look for a plausible filename, or if not found then look for URls
|
|
489 ;; &c, and dispatch to the appropriate fn.
|
|
490
|
|
491 (Info-setup-initial)
|
|
492
|
|
493 (cond
|
|
494 ;; empty filename is simple case
|
|
495 ((null filename)
|
|
496 (Info-find-file-node nil nodename no-going-back tryfile line))
|
|
497 ;; Convert filename to lower case if not found as specified.
|
|
498 ;; Expand it, look harder...
|
|
499 ((let (temp temp-downcase found
|
|
500 (fname (substitute-in-file-name filename)))
|
|
501 ;; horrible kludge so that I can call the emacs doc
|
|
502 ;; "XEmacs" without having to make .../info/dir be ugly.
|
|
503 ;; I'd like to do this only if the "emacs" node wasn't
|
|
504 ;; found, but this 200+ line function is too hairy for me
|
|
505 ;; to want to think about any longer than I have to.
|
|
506 (if (equal (downcase fname) "emacs")
|
|
507 (setq fname Info-emacs-info-file-name))
|
|
508 (let ((dirs (if (string-match "^\\./" fname)
|
|
509 ;; If specified name starts with `./'
|
|
510 ;; then just try current directory.
|
|
511 (list default-directory) ; '("./")
|
|
512 Info-directory-list)))
|
|
513 ;; Search the directory list for file FNAME.
|
|
514 (while (and dirs (not found))
|
|
515 (setq temp (expand-file-name fname (car dirs)))
|
|
516 (setq temp-downcase
|
|
517 (expand-file-name (downcase fname) (car dirs)))
|
|
518 (if (equal temp-downcase temp) (setq temp-downcase nil))
|
|
519 ;; Try several variants of specified name.
|
|
520 ;; Try downcasing, appending a suffix, or both.
|
|
521 (setq found (Info-suffixed-file temp temp-downcase))
|
|
522 (setq dirs (cdr dirs)))
|
|
523 (if found
|
|
524 (progn (setq filename (expand-file-name found))
|
|
525 t))))
|
|
526 (Info-find-file-node filename nodename no-going-back tryfile line))
|
|
527 ;; Look for a URL. This pattern is stolen from w3.el to prevent
|
|
528 ;; loading it if we won't need it.
|
|
529 ((string-match "^\\(wais\\|solo\\|x-exec\\|newspost\\|www\\|mailto\\|news\\|tn3270\\|ftp\\|http\\|file\\|telnet\\|gopher\\):" filename)
|
|
530 (w3-fetch filename))
|
|
531 (t
|
|
532 (error "Info file %s does not exist" filename))))
|
|
533
|
|
534 (defun Info-find-file-node (filename nodename
|
|
535 &optional no-going-back tryfile line)
|
|
536 ;; This is the guts of what was Info-find-node. Whoever wrote this
|
|
537 ;; should be locked up where they can't do any more harm.
|
|
538
|
|
539 ;; Go into info buffer.
|
|
540 (switch-to-buffer "*info*")
|
|
541 (if (fboundp 'buffer-disable-undo)
|
|
542 (buffer-disable-undo (current-buffer)))
|
|
543 (run-hooks 'Info-startup-hook)
|
|
544 (or (eq major-mode 'Info-mode)
|
|
545 (Info-mode))
|
|
546 (or (null filename)
|
|
547 (equal Info-current-file filename)
|
|
548 (not Info-novice)
|
|
549 (string-match "^dir$" (file-name-nondirectory Info-current-file))
|
|
550 (if (y-or-n-p (format "Leave Info file `%s'? "
|
|
551 (file-name-nondirectory Info-current-file)))
|
|
552 (message "")
|
|
553 (keyboard-quit)))
|
|
554 ;; Record the node we are leaving.
|
|
555 (if (and Info-current-file (not no-going-back))
|
|
556 (Info-history-add Info-current-file Info-current-node (point)))
|
|
557 (widen)
|
|
558 (setq Info-current-node nil
|
|
559 Info-in-cross-reference nil)
|
|
560 (unwind-protect
|
|
561 (progn
|
|
562 ;; Switch files if necessary
|
|
563 (or (null filename)
|
|
564 (equal Info-current-file filename)
|
|
565 (let ((buffer-read-only nil))
|
|
566 (setq Info-current-file nil
|
|
567 Info-current-subfile nil
|
|
568 Info-index-alternatives nil
|
|
569 Info-current-file-completions nil
|
|
570 buffer-file-name nil)
|
|
571 (erase-buffer)
|
|
572 (Info-insert-file-contents filename t)
|
|
573 ;; Add all "localdir" files in search path to "dir" file.
|
|
574 (if (string-match "^dir$" (file-name-nondirectory filename))
|
|
575 (let ((d Info-directory-list)
|
|
576 name (lim -1))
|
|
577 (goto-char (point-max))
|
|
578 (if (re-search-backward "^ *\\* *Locals *: *\n" nil t)
|
|
579 (delete-region (match-beginning 0) (match-end 0))
|
|
580 (search-backward "\^L" nil t))
|
|
581 (while d
|
|
582 (setq name (expand-file-name "localdir" (car d)))
|
|
583 (if (or (file-exists-p name)
|
|
584 (file-exists-p
|
|
585 (setq name (concat name ".info"))))
|
|
586 ;; Insert menu part of the file
|
|
587 (let* ((pt (point))
|
|
588 (len (nth 1 (insert-file-contents name))))
|
|
589 ;; be careful to put the local info entries
|
|
590 ;; in the buffer in the order they were found
|
|
591 ;; in the search path.
|
|
592 (goto-char (+ pt len))
|
|
593 (save-excursion
|
|
594 (goto-char pt)
|
|
595 (if (search-forward "* menu:" (+ pt len) t)
|
|
596 (progn
|
|
597 (forward-line 1)
|
|
598 (delete-region pt (point)))))))
|
|
599 (setq d (cdr d)))
|
|
600 ;; Eliminate redundant menu entries.
|
|
601 (goto-char (point-min))
|
|
602 (while (re-search-forward "\n\\* \\([^:\n]*\\):" nil t)
|
|
603 (let ((str (buffer-substring (match-beginning 1)
|
|
604 (match-end 1))))
|
|
605 (if (> (point) lim)
|
|
606 (save-excursion
|
|
607 (setq lim (if (search-forward "\^_" nil t)
|
|
608 (point)
|
|
609 (point-max)))))
|
|
610 (save-excursion
|
|
611 (if (search-forward (format "\n* %s:" str) lim t)
|
|
612 (let ((pt (- (point) 3 (length str))))
|
|
613 (forward-line 1)
|
|
614 (delete-region pt (point)))))))))
|
|
615 (set-buffer-modified-p nil)
|
|
616 (setq default-directory (file-name-directory filename))
|
|
617 ;; See whether file has a tag table. Record the location if yes.
|
|
618 (set-marker Info-tag-table-marker nil)
|
|
619 (goto-char (point-max))
|
|
620 (forward-line -8)
|
|
621 (or (equal nodename "*")
|
|
622 (not (search-forward "\^_\nEnd tag table\n" nil t))
|
|
623 (let (pos)
|
|
624 ;; We have a tag table. Find its beginning.
|
|
625 ;; Is this an indirect file?
|
|
626 (search-backward "\nTag table:\n")
|
|
627 (setq pos (point))
|
|
628 (if (save-excursion
|
|
629 (forward-line 2)
|
|
630 (looking-at "(Indirect)\n"))
|
|
631 ;; It is indirect. Copy it to another buffer
|
|
632 ;; and record that the tag table is in that buffer.
|
|
633 (save-excursion
|
|
634 (let ((buf (current-buffer)))
|
|
635 (set-buffer
|
|
636 (get-buffer-create " *info tag table*"))
|
|
637 (if (fboundp 'buffer-disable-undo)
|
|
638 (buffer-disable-undo (current-buffer)))
|
|
639 (setq case-fold-search t)
|
|
640 (erase-buffer)
|
|
641 (insert-buffer-substring buf)
|
|
642 (set-marker Info-tag-table-marker
|
|
643 (match-end 0))))
|
|
644 (set-marker Info-tag-table-marker pos))))
|
|
645 (setq Info-current-file
|
|
646 (file-name-sans-versions buffer-file-name))))
|
|
647 (if (equal nodename "*")
|
|
648 (progn (setq Info-current-node nodename)
|
|
649 (Info-set-mode-line)
|
|
650 (goto-char (point-min)))
|
|
651 ;; Search file for a suitable node.
|
|
652 (let* ((qnode (regexp-quote nodename))
|
|
653 (regexp (concat "Node: *" qnode " *[,\t\n\177]"))
|
|
654 (guesspos (point-min))
|
|
655 (found t))
|
|
656 ;; First get advice from tag table if file has one.
|
|
657 ;; Also, if this is an indirect info file,
|
|
658 ;; read the proper subfile into this buffer.
|
|
659 (if (marker-position Info-tag-table-marker)
|
|
660 (save-excursion
|
|
661 (set-buffer (marker-buffer Info-tag-table-marker))
|
|
662 (goto-char Info-tag-table-marker)
|
|
663 (if (re-search-forward regexp nil t)
|
|
664 (progn
|
|
665 (setq guesspos (read (current-buffer)))
|
|
666 ;; If this is an indirect file,
|
|
667 ;; determine which file really holds this node
|
|
668 ;; and read it in.
|
|
669 (if (not (eq (current-buffer) (get-buffer "*info*")))
|
|
670 (setq guesspos
|
|
671 (Info-read-subfile guesspos)))))))
|
|
672 (goto-char (max (point-min) (- guesspos 1000)))
|
|
673 ;; Now search from our advised position (or from beg of buffer)
|
|
674 ;; to find the actual node.
|
|
675 (catch 'foo
|
|
676 (while (search-forward "\n\^_" nil t)
|
|
677 (forward-line 1)
|
|
678 (let ((beg (point)))
|
|
679 (forward-line 1)
|
|
680 (if (re-search-backward regexp beg t)
|
|
681 (throw 'foo t))))
|
|
682 (setq found nil)
|
|
683 (let ((bufs (delq nil (mapcar 'get-file-buffer
|
|
684 Info-annotations-path)))
|
|
685 (pattern (if (string-match "\\`<<.*>>\\'" qnode) qnode
|
|
686 (format "\"%s\"\\|<<%s>>" qnode qnode)))
|
|
687 (pat2 (concat "------ *File: *\\([^ ].*[^ ]\\) *Node: "
|
|
688 "*\\([^ ].*[^ ]\\) *Line: *\\([0-9]+\\)"))
|
|
689 (afile nil) anode aline)
|
|
690 (while (and bufs (not anode))
|
|
691 (save-excursion
|
|
692 (set-buffer (car bufs))
|
|
693 (goto-char (point-min))
|
|
694 (if (re-search-forward pattern nil t)
|
|
695 (if (re-search-backward pat2 nil t)
|
|
696 (setq afile (buffer-substring (match-beginning 1)
|
|
697 (match-end 1))
|
|
698 anode (buffer-substring (match-beginning 2)
|
|
699 (match-end 2))
|
|
700 aline (string-to-int
|
|
701 (buffer-substring (match-beginning 3)
|
|
702 (match-end 3)))))))
|
|
703 (setq bufs (cdr bufs)))
|
|
704 (if anode
|
|
705 (Info-find-node afile anode t nil aline)
|
|
706 (if tryfile
|
|
707 (condition-case nil
|
|
708 (Info-find-node nodename "Top" t)
|
|
709 (error nil)))))
|
|
710 (or Info-current-node
|
|
711 (error "No such node: %s" nodename)))
|
|
712 (if found
|
|
713 (progn
|
|
714 (Info-select-node)
|
|
715 (goto-char (point-min))
|
|
716 (if line (forward-line line)))))))
|
|
717 ;; If we did not finish finding the specified node,
|
|
718 ;; go back to the previous one.
|
|
719 (or Info-current-node no-going-back
|
|
720 (let ((hist (car Info-history)))
|
|
721 ;; The following is no longer safe with new Info-history system
|
|
722 ;; (setq Info-history (cdr Info-history))
|
|
723 (Info-goto-node (car hist) t)
|
|
724 (goto-char (+ (point-min) (nth 1 hist)))))))
|
|
725
|
|
726 (defun Info-history-add (file node point)
|
|
727 (if Info-keeping-history
|
|
728 (let* ((name (format "(%s)%s" (Info-file-name-only file) node))
|
|
729 (found (assoc name Info-history)))
|
|
730 (if found
|
|
731 (setq Info-history (delq found Info-history)))
|
|
732 (setq Info-history (cons (list name (- point (point-min))
|
|
733 (and (eq (window-buffer)
|
|
734 (current-buffer))
|
|
735 (- (window-start) (point-min))))
|
|
736 Info-history)))))
|
|
737
|
|
738 (defun Info-file-name-only (file)
|
|
739 (let ((dir (file-name-directory file))
|
|
740 (p Info-directory-list))
|
|
741 (while (and p (not (equal (car p) dir)))
|
|
742 (setq p (cdr p)))
|
|
743 (if p (file-name-nondirectory file) file)))
|
|
744
|
|
745 (defun Info-read-subfile (nodepos)
|
|
746 (set-buffer (marker-buffer Info-tag-table-marker))
|
|
747 (goto-char (point-min))
|
|
748 (search-forward "\n\^_")
|
|
749 (let (lastfilepos
|
|
750 lastfilename)
|
|
751 (forward-line 2)
|
|
752 (catch 'foo
|
|
753 (while (not (looking-at "\^_"))
|
|
754 (if (not (eolp))
|
|
755 (let ((beg (point))
|
|
756 thisfilepos thisfilename)
|
|
757 (search-forward ": ")
|
|
758 (setq thisfilename (buffer-substring beg (- (point) 2)))
|
|
759 (setq thisfilepos (read (current-buffer)))
|
|
760 ;; read in version 19 stops at the end of number.
|
|
761 ;; Advance to the next line.
|
|
762 (if (eolp)
|
|
763 (forward-line 1))
|
|
764 (if (> thisfilepos nodepos)
|
|
765 (throw 'foo t))
|
|
766 (setq lastfilename thisfilename)
|
|
767 (setq lastfilepos thisfilepos))
|
|
768 (throw 'foo t))))
|
|
769 (set-buffer (get-buffer "*info*"))
|
|
770 (or (equal Info-current-subfile lastfilename)
|
|
771 (let ((buffer-read-only nil))
|
|
772 (setq buffer-file-name nil)
|
|
773 (widen)
|
|
774 (erase-buffer)
|
|
775 (Info-insert-file-contents (Info-suffixed-file
|
|
776 (expand-file-name lastfilename
|
|
777 (file-name-directory
|
|
778 Info-current-file)))
|
|
779 t)
|
|
780 (set-buffer-modified-p nil)
|
|
781 (setq Info-current-subfile lastfilename)))
|
|
782 (goto-char (point-min))
|
|
783 (search-forward "\n\^_")
|
|
784 (+ (- nodepos lastfilepos) (point))))
|
|
785
|
|
786 (defun Info-suffixed-file (name &optional name2)
|
|
787 (let ((suff Info-suffix-list)
|
|
788 (found nil))
|
|
789 (while (and suff (not found))
|
|
790 (if (file-exists-p (concat name (car (car suff))))
|
|
791 (setq found (concat name (car (car suff))))
|
|
792 (if (and name2 (file-exists-p (concat name2 (car (car suff)))))
|
|
793 (setq found (concat name2 (car (car suff))))
|
|
794 (setq suff (cdr suff)))))
|
|
795 (or found
|
|
796 (and (file-exists-p name) name)
|
|
797 (and name2 (file-exists-p name2) name2))))
|
|
798
|
|
799 (defun Info-insert-file-contents (file &optional visit)
|
|
800 (setq file (expand-file-name file default-directory))
|
|
801 (let ((suff Info-suffix-list))
|
|
802 (while (and suff (or (<= (length file) (length (car (car suff))))
|
|
803 (not (equal (substring file
|
|
804 (- (length (car (car suff)))))
|
|
805 (car (car suff))))))
|
|
806 (setq suff (cdr suff)))
|
|
807 (if (stringp (cdr (car suff)))
|
|
808 (let ((command (if (string-match "%s" (cdr (car suff)))
|
|
809 (format (cdr (car suff)) file)
|
|
810 (concat (cdr (car suff)) " < " file))))
|
|
811 (message "%s..." command)
|
|
812 (if (eq system-type 'vax-vms)
|
|
813 (call-process command nil t nil)
|
|
814 (call-process shell-file-name nil t nil "-c" command))
|
|
815 (message "")
|
|
816 (if visit
|
|
817 (progn
|
|
818 (setq buffer-file-name file)
|
|
819 (set-buffer-modified-p nil)
|
|
820 (clear-visited-file-modtime))))
|
|
821 (insert-file-contents file visit))))
|
|
822
|
|
823 (defun Info-select-node ()
|
|
824 "Select the node that point is in, after using `g *' to select whole file."
|
|
825 (interactive)
|
|
826 (widen)
|
|
827 (save-excursion
|
|
828 ;; Find beginning of node.
|
|
829 (search-backward "\n\^_")
|
|
830 (forward-line 2)
|
|
831 ;; Get nodename spelled as it is in the node.
|
|
832 (re-search-forward "Node:[ \t]*")
|
|
833 (setq Info-current-node
|
|
834 (buffer-substring (point)
|
|
835 (progn
|
|
836 (skip-chars-forward "^,\t\n")
|
|
837 (point))))
|
|
838 (Info-set-mode-line)
|
|
839 ;; Find the end of it, and narrow.
|
|
840 (beginning-of-line)
|
|
841 (let (active-expression)
|
|
842 (narrow-to-region (point)
|
|
843 (if (re-search-forward "\n[\^_\f]" nil t)
|
|
844 (prog1
|
|
845 (1- (point))
|
|
846 (if (looking-at "[\n\^_\f]*execute: ")
|
|
847 (progn
|
|
848 (goto-char (match-end 0))
|
|
849 (setq active-expression
|
|
850 (read (current-buffer))))))
|
|
851 (point-max)))
|
|
852 (or (equal Info-footnote-tag "Note")
|
|
853 (progn
|
|
854 (goto-char (point-min))
|
|
855 (let ((buffer-read-only nil)
|
|
856 (bufmod (buffer-modified-p))
|
|
857 (case-fold-search t))
|
|
858 (while (re-search-forward "\\*Note\\([ \n]\\)" nil t)
|
|
859 (replace-match (concat "*" Info-footnote-tag "\ ")))
|
|
860 (set-buffer-modified-p bufmod))))
|
|
861 (Info-reannotate-node)
|
|
862 ;; XEmacs: remove v19 test
|
|
863 (and Info-fontify
|
|
864 (Info-fontify-node))
|
|
865 (run-hooks 'Info-select-hook)
|
|
866 (if Info-enable-active-nodes (eval active-expression)))))
|
|
867
|
|
868 (defun Info-set-mode-line ()
|
|
869 (setq modeline-buffer-identification
|
82
|
870 (list (cons modeline-buffer-id-left-extent "Info: ")
|
|
871 (cons modeline-buffer-id-right-extent
|
|
872 (concat
|
|
873 "("
|
|
874 (if Info-current-file
|
|
875 (let ((name (file-name-nondirectory Info-current-file)))
|
|
876 (if (string-match "\\.info$" name)
|
|
877 (substring name 0 -5)
|
|
878 name))
|
|
879 "")
|
|
880 ")"
|
|
881 (or Info-current-node ""))))))
|
|
882
|
0
|
883 ;; Go to an info node specified with a filename-and-nodename string
|
|
884 ;; of the sort that is found in pointers in nodes.
|
|
885
|
|
886 ;;;###autoload
|
|
887 (defun Info-goto-node (nodename &optional no-going-back tryfile)
|
|
888 "Go to info node named NAME. Give just NODENAME or (FILENAME)NODENAME.
|
|
889 Actually, the following interpretations of NAME are tried in order:
|
|
890 (FILENAME)NODENAME
|
|
891 (FILENAME) (using Top node)
|
|
892 NODENAME (in current file)
|
|
893 TAGNAME (see below)
|
|
894 FILENAME (using Top node)
|
|
895 where TAGNAME is a string that appears in quotes: \"TAGNAME\", in an
|
|
896 annotation for any node of any file. (See `a' and `x' commands.)"
|
|
897 (interactive (list (Info-read-node-name "Goto node, file or tag: ")
|
|
898 nil t))
|
|
899 (let (filename)
|
|
900 (string-match "\\s *\\((\\s *\\([^\t)]*\\)\\s *)\\s *\\|\\)\\(.*\\)"
|
|
901 nodename)
|
|
902 (setq filename (if (= (match-beginning 1) (match-end 1))
|
|
903 ""
|
|
904 (substring nodename (match-beginning 2) (match-end 2)))
|
|
905 nodename (substring nodename (match-beginning 3) (match-end 3)))
|
|
906 (let ((trim (string-match "\\s *\\'" filename)))
|
|
907 (if trim (setq filename (substring filename 0 trim))))
|
|
908 (let ((trim (string-match "\\s *\\'" nodename)))
|
|
909 (if trim (setq nodename (substring nodename 0 trim))))
|
|
910 (Info-find-node (if (equal filename "") nil filename)
|
|
911 (if (equal nodename "") "Top" nodename)
|
|
912 no-going-back (and tryfile (equal filename "")))))
|
|
913
|
|
914 (defun Info-goto-bookmark ()
|
|
915 (interactive)
|
|
916
|
|
917 (let ((completion-ignore-case nil)
|
|
918 (tag (completing-read "Goto tag: "
|
|
919 (Info-build-annotation-completions)
|
|
920 nil t)))
|
|
921 (or (equal tag "") (Info-find-node nil (format "<<%s>>" tag)))))
|
|
922
|
|
923 ;;;###autoload
|
|
924 (defun Info-visit-file ()
|
|
925 "Directly visit an info file."
|
|
926 (interactive)
|
|
927 (let* ((insert-default-directory nil)
|
|
928 (file (read-file-name "Goto Info file: " "" "")))
|
|
929 (or (equal file "") (Info-find-node (expand-file-name file) "Top"))))
|
|
930
|
|
931 (defun Info-restore-point (&optional always)
|
|
932 "Restore point to same location it had last time we were in this node."
|
|
933 (interactive "p")
|
|
934 (if (or Info-restoring-point always)
|
|
935 (let* ((name (format "(%s)%s"
|
|
936 (Info-file-name-only Info-current-file)
|
|
937 Info-current-node))
|
|
938 (p (assoc name Info-history)))
|
|
939 (if p (Info-restore-history-entry p)))))
|
|
940
|
|
941 (defun Info-restore-history-entry (entry)
|
|
942 (goto-char (+ (nth 1 entry) (point-min)))
|
|
943 (and (nth 2 entry)
|
|
944 (get-buffer-window (current-buffer))
|
|
945 (set-window-start (get-buffer-window (current-buffer))
|
|
946 (+ (nth 2 entry) (point-min)))))
|
|
947
|
|
948 (defun Info-read-node-name (prompt &optional default)
|
|
949 (Info-setup-initial)
|
|
950 (let* ((completion-ignore-case t)
|
|
951 (nodename (completing-read prompt (Info-build-node-completions))))
|
|
952 (if (equal nodename "")
|
|
953 (or default
|
|
954 (Info-read-node-name prompt))
|
|
955 nodename)))
|
|
956
|
|
957 (defun Info-build-annotation-completions ()
|
|
958 (or Info-current-annotation-completions
|
|
959 (save-excursion
|
|
960 (let ((bufs (delq nil (mapcar 'get-file-buffer
|
|
961 Info-annotations-path)))
|
|
962 (compl nil))
|
|
963 (while bufs
|
|
964 (set-buffer (car bufs))
|
|
965 (goto-char (point-min))
|
|
966 (while (re-search-forward "<<\\(.*\\)>>" nil t)
|
|
967 (setq compl (cons (list (buffer-substring (match-beginning 1)
|
|
968 (match-end 1)))
|
|
969 compl)))
|
|
970 (setq bufs (cdr bufs)))
|
|
971 (setq Info-current-annotation-completions compl)))))
|
|
972
|
|
973 (defun Info-build-node-completions ()
|
|
974 (or Info-current-file-completions
|
|
975 (let ((compl (Info-build-annotation-completions)))
|
|
976 (save-excursion
|
|
977 (save-restriction
|
|
978 (if (marker-buffer Info-tag-table-marker)
|
|
979 (progn
|
|
980 (set-buffer (marker-buffer Info-tag-table-marker))
|
|
981 (goto-char Info-tag-table-marker)
|
|
982 (while (re-search-forward "\nNode: \\(.*\\)\177" nil t)
|
|
983 (setq compl
|
|
984 (cons (list (buffer-substring (match-beginning 1)
|
|
985 (match-end 1)))
|
|
986 compl))))
|
|
987 (widen)
|
|
988 (goto-char (point-min))
|
|
989 (while (search-forward "\n\^_" nil t)
|
|
990 (forward-line 1)
|
|
991 (let ((beg (point)))
|
|
992 (forward-line 1)
|
|
993 (if (re-search-backward "Node: *\\([^,\n]*\\) *[,\n\t]"
|
|
994 beg t)
|
|
995 (setq compl
|
|
996 (cons (list (buffer-substring (match-beginning 1)
|
|
997 (match-end 1)))
|
|
998 compl))))))))
|
|
999 (setq Info-current-file-completions compl))))
|
|
1000
|
|
1001 (defvar Info-last-search nil
|
|
1002 "Default regexp for \\<Info-mode-map>\\[Info-search] command to search for.")
|
|
1003
|
|
1004 ;;;###autoload
|
|
1005 (defun Info-search (regexp)
|
|
1006 "Search for REGEXP, starting from point, and select node it's found in."
|
|
1007 (interactive "sSearch (regexp): ")
|
|
1008 (if (equal regexp "")
|
|
1009 (setq regexp Info-last-search)
|
|
1010 (setq Info-last-search regexp))
|
120
|
1011 (with-caps-disable-folding regexp
|
|
1012 (let ((found ())
|
|
1013 (onode Info-current-node)
|
|
1014 (ofile Info-current-file)
|
|
1015 (opoint (point))
|
|
1016 (osubfile Info-current-subfile))
|
|
1017 (save-excursion
|
|
1018 (save-restriction
|
|
1019 (widen)
|
|
1020 (if (null Info-current-subfile)
|
|
1021 (progn (re-search-forward regexp) (setq found (point)))
|
|
1022 (condition-case nil
|
|
1023 (progn (re-search-forward regexp) (setq found (point)))
|
|
1024 (search-failed nil)))))
|
|
1025 (if (not found) ;can only happen in subfile case -- else would have erred
|
|
1026 (unwind-protect
|
|
1027 (let ((list ()))
|
|
1028 (set-buffer (marker-buffer Info-tag-table-marker))
|
|
1029 (goto-char (point-min))
|
|
1030 (search-forward "\n\^_\nIndirect:")
|
|
1031 (save-restriction
|
|
1032 (narrow-to-region (point)
|
|
1033 (progn (search-forward "\n\^_")
|
|
1034 (1- (point))))
|
|
1035 (goto-char (point-min))
|
|
1036 (search-forward (concat "\n" osubfile ": "))
|
|
1037 (beginning-of-line)
|
|
1038 (while (not (eobp))
|
|
1039 (re-search-forward "\\(^.*\\): [0-9]+$")
|
|
1040 (goto-char (+ (match-end 1) 2))
|
|
1041 (setq list (cons (cons (read (current-buffer))
|
|
1042 (buffer-substring (match-beginning 1)
|
|
1043 (match-end 1)))
|
|
1044 list))
|
|
1045 (goto-char (1+ (match-end 0))))
|
|
1046 (setq list (nreverse list)
|
|
1047 list (cdr list)))
|
|
1048 (while list
|
|
1049 (message "Searching subfile %s..." (cdr (car list)))
|
|
1050 (Info-read-subfile (car (car list)))
|
|
1051 (setq list (cdr list))
|
|
1052 (goto-char (point-min))
|
|
1053 (if (re-search-forward regexp nil t)
|
|
1054 (setq found (point) list ())))
|
|
1055 (if found
|
|
1056 (message "")
|
|
1057 (signal 'search-failed (list regexp))))
|
|
1058 (if (not found)
|
|
1059 (progn (Info-read-subfile opoint)
|
|
1060 (goto-char opoint)
|
|
1061 (Info-select-node)))))
|
|
1062 (widen)
|
|
1063 (goto-char found)
|
|
1064 (Info-select-node)
|
|
1065 (or (and (equal onode Info-current-node)
|
|
1066 (equal ofile Info-current-file))
|
|
1067 (Info-history-add ofile onode opoint)))))
|
0
|
1068
|
|
1069 ;; Extract the value of the node-pointer named NAME.
|
|
1070 ;; If there is none, use ERRORNAME in the error message;
|
|
1071 ;; if ERRORNAME is nil, just return nil.
|
|
1072 (defun Info-extract-pointer (name &optional errorname)
|
|
1073 (save-excursion
|
|
1074 (goto-char (point-min))
|
|
1075 (forward-line 1)
|
|
1076 (let ((case-fold-search t))
|
|
1077 (if (re-search-backward (concat name ":") nil t)
|
|
1078 (progn
|
|
1079 (goto-char (match-end 0))
|
|
1080 (Info-following-node-name))
|
|
1081 (if (eq errorname t)
|
|
1082 nil
|
|
1083 (error (concat "Node has no " (capitalize (or errorname name)))))))))
|
|
1084
|
|
1085 ;; Return the node name in the buffer following point.
|
|
1086 ;; ALLOWEDCHARS, if non-nil, goes within [...] to make a regexp
|
|
1087 ;; saying which chas may appear in the node name.
|
|
1088 (defun Info-following-node-name (&optional allowedchars)
|
|
1089 (skip-chars-forward " \t")
|
|
1090 (buffer-substring
|
|
1091 (point)
|
|
1092 (progn
|
|
1093 (while (looking-at (concat "[" (or allowedchars "^,\t\n") "]"))
|
|
1094 (skip-chars-forward (concat (or allowedchars "^,\t\n") "("))
|
|
1095 (if (looking-at "(")
|
|
1096 (skip-chars-forward "^)")))
|
|
1097 (skip-chars-backward " ")
|
|
1098 (point))))
|
|
1099
|
|
1100 (defun Info-next (&optional n)
|
|
1101 "Go to the next node of this node.
|
|
1102 A positive or negative prefix argument moves by multiple nodes."
|
|
1103 (interactive "p")
|
|
1104 (or n (setq n 1))
|
|
1105 (if (< n 0)
|
|
1106 (Info-prev (- n))
|
|
1107 (while (>= (setq n (1- n)) 0)
|
|
1108 (Info-goto-node (Info-extract-pointer "next")))))
|
|
1109
|
|
1110 (defun Info-prev (&optional n)
|
|
1111 "Go to the previous node of this node.
|
|
1112 A positive or negative prefix argument moves by multiple nodes."
|
|
1113 (interactive "p")
|
|
1114 (or n (setq n 1))
|
|
1115 (if (< n 0)
|
|
1116 (Info-next (- n))
|
|
1117 (while (>= (setq n (1- n)) 0)
|
|
1118 (Info-goto-node (Info-extract-pointer "prev[ious]*" "previous")))))
|
|
1119
|
|
1120 (defun Info-up (&optional n)
|
|
1121 "Go to the superior node of this node.
|
|
1122 A positive prefix argument moves up several times."
|
|
1123 (interactive "p")
|
|
1124 (or n (setq n 1))
|
|
1125 (while (>= (setq n (1- n)) 0)
|
|
1126 (Info-goto-node (Info-extract-pointer "up")))
|
|
1127 (if (interactive-p) (Info-restore-point)))
|
|
1128
|
|
1129 (defun Info-last (&optional n)
|
|
1130 "Go back to the last node visited.
|
|
1131 With a prefix argument, go to Nth most recently visited node. History is
|
|
1132 circular; after oldest node, history comes back around to most recent one.
|
|
1133 Argument can be negative to go through the circle in the other direction.
|
|
1134 \(In other words, `l' is like \"undo\" and `C-u - l' is like \"redo\".)"
|
|
1135 (interactive "p")
|
|
1136 (or n (setq n 1))
|
|
1137 (or Info-history
|
|
1138 (error "This is the first Info node you looked at"))
|
|
1139 (let ((len (1+ (length Info-history))))
|
|
1140 (setq n (% (+ n (* len 100)) len)))
|
|
1141 (if (> n 0)
|
|
1142 (let ((entry (nth (1- n) Info-history)))
|
|
1143 (Info-history-add Info-current-file Info-current-node (point))
|
|
1144 (while (>= (setq n (1- n)) 0)
|
|
1145 (setq Info-history (nconc (cdr Info-history)
|
|
1146 (list (car Info-history)))))
|
|
1147 (setq Info-history (cdr Info-history))
|
|
1148 (let ((Info-keeping-history nil))
|
|
1149 (Info-goto-node (car entry)))
|
|
1150 (Info-restore-history-entry entry))))
|
|
1151
|
|
1152 (defun Info-directory ()
|
|
1153 "Go to the Info directory node."
|
|
1154 (interactive)
|
|
1155 (Info-find-node "dir" "top"))
|
|
1156
|
|
1157 (defun Info-follow-reference (footnotename)
|
|
1158 "Follow cross reference named NAME to the node it refers to.
|
|
1159 NAME may be an abbreviation of the reference name."
|
|
1160 (interactive
|
|
1161 (let ((completion-ignore-case t)
|
|
1162 completions default (start-point (point)) str i)
|
|
1163 (save-excursion
|
|
1164 (goto-char (point-min))
|
|
1165 (while (re-search-forward (format "\\*%s[ \n\t]*\\([^:]*\\):"
|
|
1166 Info-footnote-tag)
|
|
1167 nil t)
|
|
1168 (setq str (buffer-substring
|
|
1169 (match-beginning 1)
|
|
1170 (1- (point))))
|
|
1171 ;; See if this one should be the default.
|
|
1172 (and (null default)
|
|
1173 (< (match-beginning 0) start-point)
|
|
1174 (<= start-point (point))
|
|
1175 (setq default t))
|
|
1176 (setq i 0)
|
|
1177 (while (setq i (string-match "[ \n\t]+" str i))
|
|
1178 (setq str (concat (substring str 0 i) " "
|
|
1179 (substring str (match-end 0))))
|
|
1180 (setq i (1+ i)))
|
|
1181 ;; Record as a completion and perhaps as default.
|
|
1182 (if (eq default t) (setq default str))
|
|
1183 (setq completions
|
|
1184 (cons (cons str nil)
|
|
1185 completions))))
|
|
1186 (if completions
|
|
1187 (let ((item (completing-read (if default
|
|
1188 (concat "Follow reference named: ("
|
|
1189 default ") ")
|
|
1190 "Follow reference named: ")
|
|
1191 completions nil t)))
|
|
1192 (if (and (string= item "") default)
|
|
1193 (list default)
|
|
1194 (list item)))
|
|
1195 (error "No cross-references in this node"))))
|
|
1196 (let (target i (str (concat "\\*" Info-footnote-tag " "
|
|
1197 (regexp-quote footnotename))))
|
|
1198 (while (setq i (string-match " " str i))
|
|
1199 (setq str (concat (substring str 0 i) "\\([ \t\n]+\\)"
|
|
1200 (substring str (1+ i))))
|
|
1201 (setq i (+ i 10)))
|
|
1202 (save-excursion
|
|
1203 (goto-char (point-min))
|
|
1204 (or (re-search-forward str nil t)
|
|
1205 (error "No cross-reference named %s" footnotename))
|
|
1206 (goto-char (match-end 1))
|
|
1207 (setq target
|
|
1208 (Info-extract-menu-node-name "Bad format cross reference" t)))
|
|
1209 (while (setq i (string-match "[ \t\n]+" target i))
|
|
1210 (setq target (concat (substring target 0 i) " "
|
|
1211 (substring target (match-end 0))))
|
|
1212 (setq i (+ i 1)))
|
|
1213 (Info-goto-node target)
|
|
1214 (setq Info-in-cross-reference t)))
|
|
1215
|
|
1216 (defun Info-next-reference (n)
|
|
1217 (interactive "p")
|
|
1218 (let ((pat (format "\\*%s[ \n\t]*\\([^:]*\\):\\|^\\* .*:\\|<<.*>>"
|
|
1219 Info-footnote-tag))
|
|
1220 (case-fold-search nil)
|
|
1221 (old-pt (point)))
|
|
1222 (while (< n 0)
|
|
1223 (save-excursion
|
|
1224 (goto-char (point-min))
|
|
1225 (while (re-search-forward pat nil t)
|
|
1226 (setq n (1+ n)))
|
|
1227 (goto-char (point-min))
|
|
1228 (if (re-search-forward "^\\* Menu:" nil t)
|
|
1229 (setq n (1- n)))))
|
|
1230 (while (>= (setq n (1- n)) 0)
|
|
1231 (or (eobp) (forward-char 1))
|
|
1232 (or (re-search-forward pat nil t)
|
|
1233 (progn
|
|
1234 (goto-char (point-min))
|
|
1235 (or (re-search-forward pat nil t)
|
|
1236 (progn
|
|
1237 (goto-char old-pt)
|
|
1238 (error "No cross references in this node")))))
|
|
1239 (goto-char (match-beginning 0))
|
|
1240 (if (looking-at "\\* Menu:")
|
|
1241 (setq n (1+ n))))))
|
|
1242
|
|
1243 (defun Info-prev-reference (n)
|
|
1244 (interactive "p")
|
|
1245 (Info-next-reference (- n)))
|
|
1246
|
|
1247 (defun Info-extract-menu-node-name (&optional errmessage multi-line)
|
|
1248 (skip-chars-forward " \t\n")
|
|
1249 (let ((beg (point))
|
|
1250 str i)
|
|
1251 (skip-chars-forward "^:")
|
|
1252 (forward-char 1)
|
|
1253 (setq str
|
|
1254 (if (looking-at ":")
|
|
1255 (buffer-substring beg (1- (point)))
|
|
1256 (skip-chars-forward " \t\n")
|
|
1257 (Info-following-node-name (if multi-line "^.,\t" "^.,\t\n"))))
|
|
1258 (while (setq i (string-match "\n" str i))
|
|
1259 (aset str i ?\ ))
|
|
1260 str))
|
|
1261
|
|
1262 (defun Info-menu (menu-item)
|
|
1263 "Go to node for menu item named (or abbreviated) NAME.
|
|
1264 Completion is allowed, and the menu item point is on is the default."
|
|
1265 (interactive
|
|
1266 (let ((completions '())
|
|
1267 ;; If point is within a menu item, use that item as the default
|
|
1268 (default nil)
|
|
1269 (p (point))
|
|
1270 (last nil))
|
|
1271 (save-excursion
|
|
1272 (goto-char (point-min))
|
|
1273 (let ((case-fold-search t))
|
|
1274 (if (not (search-forward "\n* menu:" nil t))
|
|
1275 (error "No menu in this node")))
|
|
1276 (while (re-search-forward
|
|
1277 "\n\\* \\([^:\t\n]*\\):" nil t)
|
|
1278 (if (and (null default)
|
|
1279 (prog1 (if last (< last p) nil)
|
|
1280 (setq last (match-beginning 0)))
|
|
1281 (<= p last))
|
|
1282 (setq default (car (car completions))))
|
|
1283 (setq completions (cons (cons (buffer-substring
|
|
1284 (match-beginning 1)
|
|
1285 (match-end 1))
|
|
1286 (match-beginning 1))
|
|
1287 completions)))
|
|
1288 (if (and (null default) last
|
|
1289 (< last p)
|
|
1290 (<= p (progn (end-of-line) (point))))
|
|
1291 (setq default (car (car completions)))))
|
|
1292 (let ((item nil))
|
|
1293 (while (null item)
|
|
1294 (setq item (let ((completion-ignore-case t))
|
|
1295 (completing-read (if default
|
|
1296 (format "Menu item (default %s): "
|
|
1297 default)
|
|
1298 "Menu item: ")
|
|
1299 completions nil t)))
|
|
1300 ;; we rely on the fact that completing-read accepts an input
|
|
1301 ;; of "" even when the require-match argument is true and ""
|
|
1302 ;; is not a valid possibility
|
|
1303 (if (string= item "")
|
|
1304 (if default
|
|
1305 (setq item default)
|
|
1306 ;; ask again
|
|
1307 (setq item nil))))
|
|
1308 (list item))))
|
|
1309 ;; there is a problem here in that if several menu items have the same
|
|
1310 ;; name you can only go to the node of the first with this command.
|
|
1311 (Info-goto-node (Info-extract-menu-item menu-item) nil t))
|
|
1312
|
|
1313 (defun Info-extract-menu-item (menu-item &optional noerror)
|
|
1314 (save-excursion
|
|
1315 (goto-char (point-min))
|
|
1316 (if (let ((case-fold-search t))
|
|
1317 (search-forward "\n* menu:" nil t))
|
|
1318 (if (or (search-forward (concat "\n* " menu-item ":") nil t)
|
|
1319 (search-forward (concat "\n* " menu-item) nil t))
|
|
1320 (progn
|
|
1321 (beginning-of-line)
|
|
1322 (forward-char 2)
|
|
1323 (Info-extract-menu-node-name))
|
|
1324 (and (not noerror) (error "No such item in menu")))
|
|
1325 (and (not noerror) (error "No menu in this node")))))
|
|
1326
|
|
1327 ;; If COUNT is nil, use the last item in the menu.
|
|
1328 (defun Info-extract-menu-counting (count &optional noerror noindex)
|
|
1329 (save-excursion
|
|
1330 (goto-char (point-min))
|
|
1331 (if (let ((case-fold-search t))
|
|
1332 (and (search-forward "\n* menu:" nil t)
|
|
1333 (or (not noindex)
|
|
1334 (not (string-match "\\<Index\\>" Info-current-node)))))
|
|
1335 (if (search-forward "\n* " nil t count)
|
|
1336 (progn
|
|
1337 (or count
|
|
1338 (while (search-forward "\n* " nil t)))
|
|
1339 (Info-extract-menu-node-name))
|
|
1340 (and (not noerror) (error "Too few items in menu")))
|
|
1341 (and (not noerror) (error "No menu in this node")))))
|
|
1342
|
|
1343 (defun Info-nth-menu-item (n)
|
|
1344 "Go to the node of the Nth menu item."
|
|
1345 (interactive "P")
|
|
1346 (or n (setq n (- last-command-char ?0)))
|
|
1347 (if (< n 1) (error "Index must be at least 1"))
|
|
1348 (Info-goto-node (Info-extract-menu-counting n) nil t))
|
|
1349
|
|
1350 (defun Info-last-menu-item ()
|
|
1351 "Go to the node of the tenth menu item."
|
|
1352 (interactive)
|
|
1353 (Info-goto-node (Info-extract-menu-counting nil) nil t))
|
|
1354
|
|
1355 (defun Info-top ()
|
|
1356 "Go to the Top node of this file."
|
|
1357 (interactive)
|
|
1358 (Info-goto-node "Top"))
|
|
1359
|
|
1360 (defun Info-end ()
|
|
1361 "Go to the final node in this file."
|
|
1362 (interactive)
|
|
1363 (Info-top)
|
|
1364 (let ((Info-keeping-history nil)
|
|
1365 node)
|
|
1366 (Info-last-menu-item)
|
|
1367 (while (setq node (or (Info-extract-pointer "next" t)
|
|
1368 (Info-extract-menu-counting nil t t)))
|
|
1369 (Info-goto-node node))
|
|
1370 (or (equal (Info-extract-pointer "up" t) "Top")
|
|
1371 (let ((executing-kbd-macro "")) ; suppress messages
|
|
1372 (condition-case nil
|
|
1373 (Info-global-next 10000)
|
|
1374 (error nil))))))
|
|
1375
|
|
1376 (defun Info-global-next (&optional n)
|
|
1377 "Go to the next node in this file, traversing node structure as necessary.
|
|
1378 This works only if the Info file is structured as a hierarchy of nodes.
|
|
1379 A positive or negative prefix argument moves by multiple nodes."
|
|
1380 (interactive "p")
|
|
1381 (or n (setq n 1))
|
|
1382 (if (< n 0)
|
|
1383 (Info-global-prev (- n))
|
|
1384 (while (>= (setq n (1- n)) 0)
|
|
1385 (let (node)
|
|
1386 (cond ((and (string-match "^Top$" Info-current-node)
|
|
1387 (setq node (Info-extract-pointer "next" t))
|
|
1388 (Info-extract-menu-item node t))
|
|
1389 (Info-goto-node node))
|
|
1390 ((setq node (Info-extract-menu-counting 1 t t))
|
|
1391 (message "Going down...")
|
|
1392 (Info-goto-node node))
|
|
1393 (t
|
|
1394 (let ((Info-keeping-history Info-keeping-history)
|
|
1395 (orignode Info-current-node)
|
|
1396 (ups ""))
|
|
1397 (while (not (Info-extract-pointer "next" t))
|
|
1398 (if (and (setq node (Info-extract-pointer "up" t))
|
|
1399 (not (equal node "Top")))
|
|
1400 (progn
|
|
1401 (message "Going%s..." (setq ups (concat ups " up")))
|
|
1402 (Info-goto-node node)
|
|
1403 (setq Info-keeping-history nil))
|
|
1404 (if orignode
|
|
1405 (let ((Info-keeping-history nil))
|
|
1406 (Info-goto-node orignode)))
|
|
1407 (error "Last node in file")))
|
|
1408 (Info-next))))))))
|
|
1409
|
|
1410 (defun Info-page-next (&optional n)
|
|
1411 "Scroll forward one screenful, or go to next global node.
|
|
1412 A positive or negative prefix argument moves by multiple screenfuls."
|
|
1413 (interactive "p")
|
|
1414 (or n (setq n 1))
|
|
1415 (if (< n 0)
|
|
1416 (Info-page-prev (- n))
|
|
1417 (while (>= (setq n (1- n)) 0)
|
|
1418 (if (pos-visible-in-window-p (point-max))
|
|
1419 (progn
|
|
1420 (Info-global-next)
|
|
1421 (message "Node: %s" Info-current-node))
|
|
1422 (scroll-up)))))
|
|
1423
|
|
1424 (defun Info-scroll-next (arg)
|
|
1425 (interactive "P")
|
|
1426 (if Info-auto-advance
|
|
1427 (if (and (pos-visible-in-window-p (point-max))
|
|
1428 (not (eq Info-auto-advance t))
|
|
1429 (not (eq last-command this-command)))
|
|
1430 (message "Hit %s again to go to next node"
|
|
1431 (if (= last-command-char 0)
|
|
1432 "mouse button"
|
|
1433 (key-description (char-to-string last-command-char))))
|
|
1434 (Info-page-next)
|
|
1435 (setq this-command 'Info))
|
|
1436 (scroll-up arg)))
|
|
1437
|
|
1438 (defun Info-global-prev (&optional n)
|
|
1439 "Go to the previous node in this file, traversing structure as necessary.
|
|
1440 This works only if the Info file is structured as a hierarchy of nodes.
|
|
1441 A positive or negative prefix argument moves by multiple nodes."
|
|
1442 (interactive "p")
|
|
1443 (or n (setq n 1))
|
|
1444 (if (< n 0)
|
|
1445 (Info-global-next (- n))
|
|
1446 (while (>= (setq n (1- n)) 0)
|
|
1447 (let ((upnode (Info-extract-pointer "up" t))
|
|
1448 (prevnode (Info-extract-pointer "prev[ious]*" t)))
|
|
1449 (if (or (not prevnode)
|
|
1450 (equal prevnode upnode))
|
|
1451 (if (string-match "^Top$" Info-current-node)
|
|
1452 (error "First node in file")
|
|
1453 (message "Going up...")
|
|
1454 (Info-up))
|
|
1455 (Info-goto-node prevnode)
|
|
1456 (let ((downs "")
|
|
1457 (Info-keeping-history nil)
|
|
1458 node)
|
|
1459 (while (setq node (Info-extract-menu-counting nil t t))
|
|
1460 (message "Going%s..." (setq downs (concat downs " down")))
|
|
1461 (Info-goto-node node))))))))
|
|
1462
|
|
1463 (defun Info-page-prev (&optional n)
|
|
1464 "Scroll backward one screenful, or go to previous global node.
|
|
1465 A positive or negative prefix argument moves by multiple screenfuls."
|
|
1466 (interactive "p")
|
|
1467 (or n (setq n 1))
|
|
1468 (if (< n 0)
|
|
1469 (Info-page-next (- n))
|
|
1470 (while (>= (setq n (1- n)) 0)
|
|
1471 (if (pos-visible-in-window-p (point-min))
|
|
1472 (progn
|
|
1473 (Info-global-prev)
|
|
1474 (message "Node: %s" Info-current-node)
|
|
1475 (sit-for 0)
|
|
1476 ;;(scroll-up 1) ; work around bug in pos-visible-in-window-p
|
|
1477 ;;(scroll-down 1)
|
|
1478 (while (not (pos-visible-in-window-p (point-max)))
|
|
1479 (scroll-up)))
|
|
1480 (scroll-down)))))
|
|
1481
|
|
1482 (defun Info-scroll-prev (arg)
|
|
1483 (interactive "P")
|
|
1484 (if Info-auto-advance
|
|
1485 (if (and (pos-visible-in-window-p (point-min))
|
|
1486 (not (eq Info-auto-advance t))
|
|
1487 (not (eq last-command this-command)))
|
|
1488 (message "Hit %s again to go to previous node"
|
|
1489 (if (= last-command-char 0)
|
|
1490 "mouse button"
|
|
1491 (key-description (char-to-string last-command-char))))
|
|
1492 (Info-page-prev)
|
|
1493 (setq this-command 'Info))
|
|
1494 (scroll-down arg)))
|
|
1495
|
|
1496 (defun Info-index (topic)
|
|
1497 "Look up a string in the index for this file.
|
|
1498 The index is defined as the first node in the top-level menu whose
|
|
1499 name contains the word \"Index\", plus any immediately following
|
|
1500 nodes whose names also contain the word \"Index\".
|
|
1501 If there are no exact matches to the specified topic, this chooses
|
|
1502 the first match which is a case-insensitive substring of a topic.
|
|
1503 Use the `,' command to see the other matches.
|
|
1504 Give a blank topic name to go to the Index node itself."
|
|
1505 (interactive "sIndex topic: ")
|
|
1506 (let ((pattern (format "\n\\* \\([^\n:]*%s[^\n:]*\\):[ \t]*%s"
|
|
1507 (regexp-quote topic)
|
|
1508 "\\([^.\n]*\\)\\.[ t]*\\([0-9]*\\)"))
|
|
1509 node)
|
|
1510 (message "Searching index for `%s'..." topic)
|
|
1511 (Info-goto-node "Top")
|
|
1512 (let ((case-fold-search t))
|
|
1513 (or (search-forward "\n* menu:" nil t)
|
|
1514 (error "No index"))
|
|
1515 (or (re-search-forward "\n\\* \\(.*\\<Index\\>\\)" nil t)
|
|
1516 (error "No index")))
|
|
1517 (goto-char (match-beginning 1))
|
|
1518 (let ((Info-keeping-history nil)
|
|
1519 (Info-fontify (and Info-fontify (equal topic ""))))
|
|
1520 (Info-goto-node (Info-extract-menu-node-name)))
|
|
1521 (or (equal topic "")
|
|
1522 (let ((matches nil)
|
|
1523 (exact nil)
|
|
1524 (Info-keeping-history nil)
|
|
1525 found)
|
|
1526 (while
|
|
1527 (progn
|
|
1528 (goto-char (point-min))
|
|
1529 (while (re-search-forward pattern nil t)
|
|
1530 (setq matches
|
|
1531 (cons (list (buffer-substring (match-beginning 1)
|
|
1532 (match-end 1))
|
|
1533 (buffer-substring (match-beginning 2)
|
|
1534 (match-end 2))
|
|
1535 Info-current-node
|
|
1536 (string-to-int (concat "0"
|
|
1537 (buffer-substring
|
|
1538 (match-beginning 3)
|
|
1539 (match-end 3)))))
|
|
1540 matches)))
|
|
1541 (and (setq node (Info-extract-pointer "next" t))
|
|
1542 (string-match "\\<Index\\>" node)))
|
|
1543 (let ((Info-fontify nil))
|
|
1544 (Info-goto-node node)))
|
|
1545 (or matches
|
|
1546 (progn
|
|
1547 (Info-last)
|
|
1548 (error "No \"%s\" in index" topic)))
|
|
1549 ;; Here it is a feature that assoc is case-sensitive.
|
|
1550 (while (setq found (assoc topic matches))
|
|
1551 (setq exact (cons found exact)
|
|
1552 matches (delq found matches)))
|
|
1553 (setq Info-index-alternatives (nconc exact (nreverse matches))
|
|
1554 Info-index-first-alternative (car Info-index-alternatives))
|
|
1555 (Info-index-next 0)))))
|
|
1556
|
|
1557 (defun Info-index-next (num)
|
|
1558 "Go to the next matching index item from the last `i' command."
|
|
1559 (interactive "p")
|
|
1560 (or Info-index-alternatives
|
|
1561 (error "No previous `i' command in this file"))
|
|
1562 (while (< num 0)
|
|
1563 (setq num (+ num (length Info-index-alternatives))))
|
|
1564 (while (> num 0)
|
|
1565 (setq Info-index-alternatives
|
|
1566 (nconc (cdr Info-index-alternatives)
|
|
1567 (list (car Info-index-alternatives)))
|
|
1568 num (1- num)))
|
|
1569 (Info-goto-node (nth 1 (car Info-index-alternatives)))
|
|
1570 (if (> (nth 3 (car Info-index-alternatives)) 0)
|
|
1571 (forward-line (nth 3 (car Info-index-alternatives)))
|
|
1572 (forward-line 3) ; don't search in headers
|
|
1573 (let ((name (car (car Info-index-alternatives))))
|
|
1574 (if (or (re-search-forward (format
|
|
1575 "\\(Function\\|Command\\): %s\\( \\|$\\)"
|
|
1576 (regexp-quote name)) nil t)
|
|
1577 (re-search-forward (format "^`%s[ ']" (regexp-quote name)) nil t)
|
|
1578 (search-forward (format "`%s'" name) nil t)
|
|
1579 (and (string-match "\\`.*\\( (.*)\\)\\'" name)
|
|
1580 (search-forward
|
|
1581 (format "`%s'" (substring name 0 (match-beginning 1)))
|
|
1582 nil t))
|
|
1583 (search-forward name nil t))
|
|
1584 (beginning-of-line)
|
|
1585 (goto-char (point-min)))))
|
|
1586 (message "Found \"%s\" in %s. %s"
|
|
1587 (car (car Info-index-alternatives))
|
|
1588 (nth 2 (car Info-index-alternatives))
|
|
1589 (if (cdr Info-index-alternatives)
|
|
1590 (if (eq (car (cdr Info-index-alternatives))
|
|
1591 Info-index-first-alternative)
|
|
1592 "(Press `,' to repeat)"
|
|
1593 (format "(Press `,' for %d more)"
|
|
1594 (- (1- (length Info-index-alternatives))
|
|
1595 (length (memq Info-index-first-alternative
|
|
1596 (cdr Info-index-alternatives))))))
|
|
1597 "(Only match)")))
|
|
1598
|
|
1599
|
|
1600 ;;;###autoload
|
|
1601 (defun Info-emacs-command (command)
|
|
1602 "Look up an Emacs command in the Emacs manual in the Info system.
|
|
1603 This command is designed to be used whether you are already in Info or not."
|
|
1604 (interactive "CLook up command in Emacs manual: ")
|
|
1605 (save-window-excursion
|
|
1606 (info)
|
|
1607 (Info-find-node Info-emacs-info-file-name "Top")
|
|
1608 (Info-index (symbol-name command)))
|
|
1609 (pop-to-buffer "*info*"))
|
|
1610
|
|
1611 ;;;###autoload
|
|
1612 (defun Info-goto-emacs-command-node (key)
|
|
1613 "Look up an Emacs command in the Emacs manual in the Info system.
|
|
1614 This command is designed to be used whether you are already in Info or not."
|
|
1615 (interactive "CLook up command in Emacs manual: ")
|
|
1616 (Info-emacs-command key))
|
|
1617
|
|
1618 ;;;###autoload
|
|
1619 (defun Info-goto-emacs-key-command-node (key)
|
|
1620 "Look up an Emacs key sequence in the Emacs manual in the Info system.
|
|
1621 This command is designed to be used whether you are already in Info or not."
|
|
1622 (interactive "kLook up key in Emacs manual: ")
|
|
1623 (let ((command (key-binding key)))
|
|
1624 (cond ((eq command 'keyboard-quit)
|
|
1625 (keyboard-quit))
|
|
1626 ((null command)
|
|
1627 (error "%s is undefined" (key-description key)))
|
|
1628 ((and (interactive-p) (eq command 'execute-extended-command))
|
|
1629 (call-interactively 'Info-goto-emacs-command-node))
|
|
1630 (t
|
|
1631 (Info-goto-emacs-command-node command)))))
|
|
1632
|
|
1633 ;;;###autoload
|
|
1634 (defun Info-emacs-key (key)
|
|
1635 "Look up an Emacs key sequence in the Emacs manual in the Info system.
|
|
1636 This command is designed to be used whether you are already in Info or not."
|
|
1637 (interactive "kLook up key in Emacs manual: ")
|
|
1638 (cond ((eq (key-binding key) 'keyboard-quit)
|
|
1639 (keyboard-quit))
|
|
1640 ((and (interactive-p) (eq (key-binding key) 'execute-extended-command))
|
|
1641 (call-interactively 'Info-goto-emacs-command-node))
|
|
1642 (t
|
|
1643 (save-window-excursion
|
|
1644 (info)
|
|
1645 (Info-find-node Info-emacs-info-file-name "Top")
|
|
1646 (setq key (key-description key))
|
|
1647 (let (p)
|
|
1648 (if (setq p (string-match "[@{}]" key))
|
|
1649 (setq key (concat (substring key 0 p) "@" (substring key p))))
|
|
1650 (if (string-match "^ESC " key)
|
|
1651 (setq key (concat "M-" (substring key 4))))
|
|
1652 (if (string-match "^M-C-" key)
|
|
1653 (setq key (concat "C-M-" (substring key 4)))))
|
|
1654 (Info-index key))
|
|
1655 (pop-to-buffer "*info*"))))
|
|
1656
|
|
1657 ;;;###autoload
|
|
1658 (defun Info-elisp-ref (func)
|
|
1659 "Look up an Emacs Lisp function in the Elisp manual in the Info system.
|
|
1660 This command is designed to be used whether you are already in Info or not."
|
|
1661 (interactive (let ((fn (function-called-at-point))
|
|
1662 (enable-recursive-minibuffers t)
|
|
1663 val)
|
|
1664 (setq val (completing-read
|
|
1665 (format "Look up Emacs Lisp function%s: "
|
|
1666 (if fn
|
|
1667 (format " (default %s)" fn)
|
|
1668 ""))
|
|
1669 obarray 'fboundp t))
|
|
1670 (list (if (equal val "")
|
|
1671 fn (intern val)))))
|
|
1672 (save-window-excursion
|
|
1673 (info)
|
|
1674 (condition-case nil
|
116
|
1675 (Info-find-node "lispref" "Top")
|
|
1676 (error (Info-find-node "elisp" "Top")))
|
0
|
1677 (Info-index (symbol-name func)))
|
|
1678 (pop-to-buffer "*info*"))
|
|
1679
|
|
1680 (defun Info-reannotate-node ()
|
|
1681 (let ((bufs (delq nil (mapcar 'get-file-buffer Info-annotations-path))))
|
|
1682 (if bufs
|
|
1683 (let ((ibuf (current-buffer))
|
|
1684 (file (concat "\\(" (regexp-quote
|
|
1685 (file-name-nondirectory Info-current-file))
|
|
1686 "\\|" (regexp-quote Info-current-file) "\\)"))
|
|
1687 (node (regexp-quote Info-current-node))
|
|
1688 (savept (point)))
|
|
1689 (goto-char (point-min))
|
|
1690 (if (search-forward "\n------ NOTE:\n" nil t)
|
|
1691 (let ((buffer-read-only nil)
|
|
1692 (bufmod (buffer-modified-p))
|
|
1693 top)
|
|
1694 (setq savept (copy-marker savept))
|
|
1695 (goto-char (point-min))
|
|
1696 (while (search-forward "\n------ NOTE:" nil t)
|
|
1697 (setq top (1+ (match-beginning 0)))
|
|
1698 (if (search-forward "\n------\n" nil t)
|
|
1699 (delete-region top (point)))
|
|
1700 (backward-char 1))
|
|
1701 (set-buffer-modified-p bufmod)))
|
|
1702 (save-excursion
|
|
1703 (while bufs
|
|
1704 (set-buffer (car bufs))
|
|
1705 (goto-char (point-min))
|
|
1706 (while (re-search-forward
|
|
1707 (format
|
|
1708 "------ *File: *%s *Node: *%s *Line: *\\([0-9]+\\) *\n"
|
|
1709 file node)
|
|
1710 nil t)
|
|
1711 (let ((line (string-to-int
|
|
1712 (buffer-substring (match-beginning 2)
|
|
1713 (match-end 2))))
|
|
1714 (top (point))
|
|
1715 bot)
|
|
1716 (search-forward "\n------\n" nil t)
|
|
1717 (setq bot (point))
|
|
1718 (save-excursion
|
|
1719 (set-buffer ibuf)
|
|
1720 (if (integerp savept) (setq savept (copy-marker savept)))
|
|
1721 (if (= line 0)
|
|
1722 (goto-char (point-max))
|
|
1723 (goto-char (point-min))
|
|
1724 (forward-line line))
|
|
1725 (let ((buffer-read-only nil)
|
|
1726 (bufmod (buffer-modified-p)))
|
|
1727 (insert "------ NOTE:\n")
|
|
1728 (insert-buffer-substring (car bufs) top bot)
|
|
1729 (set-buffer-modified-p bufmod)))))
|
|
1730 (setq bufs (cdr bufs))))
|
|
1731 (goto-char savept)))))
|
|
1732
|
|
1733 (defvar Info-annotate-map nil
|
|
1734 "Local keymap used within `a' command of Info.")
|
|
1735 (if Info-annotate-map
|
|
1736 nil
|
|
1737 ;; (setq Info-annotate-map (nconc (make-sparse-keymap) text-mode-map))
|
|
1738 (setq Info-annotate-map (copy-keymap text-mode-map))
|
|
1739 (define-key Info-annotate-map "\C-c\C-c" 'Info-cease-annotate))
|
|
1740
|
|
1741 (defun Info-annotate-mode ()
|
|
1742 "Major mode for adding an annotation to an Info node.
|
|
1743 Like text mode with the addition of Info-cease-annotate
|
|
1744 which returns to Info mode for browsing.
|
|
1745 \\{Info-annotate-map}")
|
|
1746
|
|
1747 (defun Info-annotate (arg)
|
|
1748 "Add a personal annotation to the current Info node.
|
|
1749 Only you will be able to see this annotation.
|
|
1750 Annotations are stored in the file ~/.infonotes by default.
|
|
1751 If point is inside an existing annotation, edit that annotation.
|
|
1752 A prefix argument specifies which annotations file (from
|
|
1753 Info-annotations-path) is to be edited; default is 1."
|
|
1754 (interactive "p")
|
|
1755 (setq arg (1- arg))
|
|
1756 (if (or (< arg 0) (not (nth arg Info-annotations-path)))
|
|
1757 (if (= arg 0)
|
|
1758 (setq Info-annotations-path
|
|
1759 (list (read-file-name
|
|
1760 "Annotations file: " "~/" "~/.infonotes")))
|
|
1761 (error "File number must be in the range from 1 to %d"
|
|
1762 (length Info-annotations-path))))
|
|
1763 (let ((which nil)
|
|
1764 (file (file-name-nondirectory Info-current-file))
|
|
1765 (d Info-directory-list)
|
|
1766 where pt)
|
|
1767 (while (and d (not (equal (expand-file-name file (car d))
|
|
1768 Info-current-file)))
|
|
1769 (setq d (cdr d)))
|
|
1770 (or d (setq file Info-current-file))
|
|
1771 (if (and (save-excursion
|
|
1772 (goto-char (min (point-max) (+ (point) 13)))
|
|
1773 (and (search-backward "------ NOTE:\n" nil t)
|
|
1774 (setq pt (match-end 0))
|
|
1775 (search-forward "\n------\n" nil t)))
|
|
1776 (< (point) (match-end 0)))
|
|
1777 (setq which (format "File: *%s *Node: *%s *Line:.*\n%s"
|
|
1778 (regexp-quote file)
|
|
1779 (regexp-quote Info-current-node)
|
|
1780 (regexp-quote
|
|
1781 (buffer-substring pt (match-beginning 0))))
|
|
1782 where (max (- (point) pt) 0)))
|
|
1783 (let ((node Info-current-node)
|
|
1784 (line (if (looking-at "[ \n]*\\'") 0
|
|
1785 (count-lines (point-min) (point)))))
|
|
1786 (or which
|
|
1787 (let ((buffer-read-only nil)
|
|
1788 (bufmod (buffer-modified-p)))
|
|
1789 (beginning-of-line)
|
|
1790 (if (bobp) (goto-char (point-max)))
|
|
1791 (insert "------ NOTE:\n------\n")
|
|
1792 (backward-char 20)
|
|
1793 (set-buffer-modified-p bufmod)))
|
|
1794 ;; (setq Info-window-start (window-start))
|
|
1795 (setq Info-window-configuration (current-window-configuration))
|
|
1796 (pop-to-buffer (find-file-noselect (nth arg Info-annotations-path)))
|
|
1797 (use-local-map Info-annotate-map)
|
|
1798 (setq major-mode 'Info-annotate-mode)
|
|
1799 (setq mode-name "Info Annotate")
|
|
1800 (if which
|
|
1801 (if (save-excursion
|
|
1802 (goto-char (point-min))
|
|
1803 (re-search-forward which nil t))
|
|
1804 (progn
|
|
1805 (goto-char (match-beginning 0))
|
|
1806 (forward-line 1)
|
|
1807 (forward-char where)))
|
|
1808 (let ((bufmod (buffer-modified-p)))
|
|
1809 (goto-char (point-max))
|
|
1810 (insert (format "\n------ File: %s Node: %s Line: %d\n"
|
|
1811 file node line))
|
|
1812 (setq pt (point))
|
|
1813 (insert "\n------\n"
|
|
1814 "\nPress C-c C-c to save and return to Info.\n")
|
|
1815 (goto-char pt)
|
|
1816 (set-buffer-modified-p bufmod))))))
|
|
1817
|
|
1818 (defun Info-cease-annotate ()
|
|
1819 (interactive)
|
|
1820 (let ((bufmod (buffer-modified-p)))
|
|
1821 (while (save-excursion
|
|
1822 (goto-char (point-min))
|
|
1823 (re-search-forward "\n\n?Press .* to save and return to Info.\n"
|
|
1824 nil t))
|
|
1825 (delete-region (1+ (match-beginning 0)) (match-end 0)))
|
|
1826 (while (save-excursion
|
|
1827 (goto-char (point-min))
|
|
1828 (re-search-forward "\n------ File:.*Node:.*Line:.*\n+------\n"
|
|
1829 nil t))
|
|
1830 (delete-region (match-beginning 0) (match-end 0)))
|
|
1831 (set-buffer-modified-p bufmod))
|
|
1832 (save-buffer)
|
|
1833 (fundamental-mode)
|
|
1834 (bury-buffer)
|
|
1835 (or (one-window-p) (delete-window))
|
|
1836 (info)
|
|
1837 (setq Info-current-annotation-completions nil)
|
|
1838 (set-window-configuration Info-window-configuration)
|
|
1839 (Info-reannotate-node))
|
|
1840
|
|
1841 (defun Info-bookmark (arg tag)
|
|
1842 (interactive "p\nsBookmark name: ")
|
|
1843 (Info-annotate arg)
|
|
1844 (if (or (string-match "^\"\\(.*\\)\"$" tag)
|
|
1845 (string-match "^<<\\(.*\\)>>$" tag))
|
|
1846 (setq tag (substring tag (match-beginning 1) (match-end 1))))
|
|
1847 (let ((pt (point)))
|
|
1848 (search-forward "\n------\n")
|
|
1849 (let ((end (- (point) 8)))
|
|
1850 (goto-char pt)
|
|
1851 (if (re-search-forward "<<[^>\n]*>>" nil t)
|
|
1852 (delete-region (match-beginning 0) (match-end 0))
|
|
1853 (goto-char end))
|
|
1854 (or (equal tag "")
|
|
1855 (insert "<<" tag ">>"))))
|
|
1856 (Info-cease-annotate))
|
|
1857
|
|
1858 (defun Info-exit ()
|
|
1859 "Exit Info by selecting some other buffer."
|
|
1860 (interactive)
|
|
1861 (if Info-standalone
|
|
1862 (save-buffers-kill-emacs)
|
98
|
1863 (bury-buffer (current-buffer))
|
|
1864 (if (and (featurep 'toolbar)
|
|
1865 (eq toolbar-info-frame (selected-frame)))
|
|
1866 (delete-frame toolbar-info-frame)
|
|
1867 (switch-to-buffer (other-buffer (current-buffer))))))
|
0
|
1868
|
|
1869 (defun Info-undefined ()
|
|
1870 "Make command be undefined in Info."
|
|
1871 (interactive)
|
|
1872 (ding))
|
|
1873
|
|
1874 (defun Info-help ()
|
|
1875 "Enter the Info tutorial."
|
|
1876 (interactive)
|
|
1877 (delete-other-windows)
|
|
1878 (Info-find-node "info"
|
|
1879 (if (< (window-height) 23)
|
|
1880 "Help-Small-Screen"
|
|
1881 "Help")))
|
|
1882
|
|
1883 (defun Info-summary ()
|
|
1884 "Display a brief summary of all Info commands."
|
|
1885 (interactive)
|
|
1886 (save-window-excursion
|
|
1887 (switch-to-buffer "*Help*")
|
|
1888 (erase-buffer)
|
|
1889 (insert (documentation 'Info-mode))
|
|
1890 (goto-char (point-min))
|
|
1891 (let (flag)
|
|
1892 (while (progn (setq flag (not (pos-visible-in-window-p (point-max))))
|
|
1893 (message (if flag "Type Space to see more"
|
|
1894 "Type Space to return to Info"))
|
|
1895 (let ((e (next-command-event)))
|
|
1896 (if (/= ?\ (event-to-character e))
|
|
1897 (progn (setq unread-command-event e) nil)
|
|
1898 flag)))
|
|
1899 (scroll-up)))
|
|
1900 (message "")
|
|
1901 (bury-buffer "*Help*")))
|
|
1902
|
|
1903 (defun Info-get-token (pos start all &optional errorstring)
|
|
1904 "Return the token around POS,
|
|
1905 POS must be somewhere inside the token
|
|
1906 START is a regular expression which will match the
|
|
1907 beginning of the tokens delimited string
|
|
1908 ALL is a regular expression with a single
|
|
1909 parenthized subpattern which is the token to be
|
|
1910 returned. E.g. '{\(.*\)}' would return any string
|
|
1911 enclosed in braces around POS.
|
|
1912 SIG optional fourth argument, controls action on no match
|
|
1913 nil: return nil
|
|
1914 t: beep
|
|
1915 a string: signal an error, using that string."
|
|
1916 (save-excursion
|
|
1917 (goto-char (point-min))
|
|
1918 (re-search-backward "\\`") ; Bug fix due to Nicholas J. Foskett.
|
|
1919 (goto-char pos)
|
|
1920 (re-search-backward start (max (point-min) (- pos 200)) 'yes)
|
|
1921 (let (found)
|
|
1922 (while (and (re-search-forward all (min (point-max) (+ pos 200)) 'yes)
|
|
1923 (not (setq found (and (<= (match-beginning 0) pos)
|
|
1924 (> (match-end 0) pos))))))
|
|
1925 (if (and found (<= (match-beginning 0) pos)
|
|
1926 (> (match-end 0) pos))
|
|
1927 (buffer-substring (match-beginning 1) (match-end 1))
|
|
1928 (cond ((null errorstring)
|
|
1929 nil)
|
|
1930 ((eq errorstring t)
|
|
1931 (beep)
|
|
1932 nil)
|
|
1933 (t
|
|
1934 (error "No %s around position %d" errorstring pos)))))))
|
|
1935
|
|
1936 (defun Info-follow-clicked-node (event)
|
|
1937 "Follow a node reference near clicked point. Like M, F, N, P or U command.
|
|
1938 At end of the node's text, moves to the next node."
|
|
1939 (interactive "@e")
|
|
1940 (or (and (event-point event)
|
|
1941 (Info-follow-nearest-node
|
|
1942 (max (progn
|
|
1943 (select-window (event-window event))
|
|
1944 (event-point event))
|
|
1945 (1+ (point-min)))))
|
|
1946 (error "click on a cross-reference to follow")))
|
|
1947
|
|
1948 (defun Info-maybe-follow-clicked-node (event &optional click-count)
|
|
1949 "Follow a node reference (if any) near clicked point.
|
|
1950 Like M, F, N, P or U command. At end of the node's text, moves to the
|
|
1951 next node. No error is given if there is no node to follow."
|
|
1952 (interactive "@e")
|
149
|
1953 (and Info-button1-follows-hyperlink
|
|
1954 (event-point event)
|
0
|
1955 (Info-follow-nearest-node
|
|
1956 (max (progn
|
|
1957 (select-window (event-window event))
|
|
1958 (event-point event))
|
|
1959 (1+ (point-min))))))
|
|
1960
|
|
1961 (defun Info-find-nearest-node (point)
|
|
1962 (let (node)
|
|
1963 (cond
|
|
1964 ((= point (point-min)) nil) ; don't trigger on accidental RET.
|
|
1965 ((setq node (Info-get-token point
|
|
1966 (format "\\*%s[ \n]" Info-footnote-tag)
|
|
1967 (format "\\*%s[ \n]\\([^:]*\\):"
|
|
1968 Info-footnote-tag)))
|
|
1969 (list "Following cross-reference %s..."
|
|
1970 (list 'Info-follow-reference node)))
|
|
1971 ((setq node (Info-get-token point "\\* " "\\* \\([^:]*\\)::"))
|
|
1972 (list "Selecting menu item %s..."
|
|
1973 (list 'Info-goto-node node nil t)))
|
|
1974 ((setq node (Info-get-token point "\\* " "\\* \\([^:]*\\):"))
|
|
1975 (list "Selecting menu item %s..."
|
|
1976 (list 'Info-menu node)))
|
|
1977 ((setq node (Info-get-token point "Up: " "Up: \\([^,\n\t]*\\)"))
|
|
1978 (list "Going up..."
|
|
1979 (list 'Info-goto-node node)))
|
|
1980 ((setq node (Info-get-token point "Next: " "Next: \\([^,\n\t]*\\)"))
|
|
1981 (list "Next node..."
|
|
1982 (list 'Info-goto-node node)))
|
|
1983 ((setq node (Info-get-token point "File: " "File: \\([^,\n\t]*\\)"))
|
|
1984 (list "Top node..."
|
|
1985 (list 'Info-goto-node "Top")))
|
|
1986 ((setq node (Info-get-token point "Prev[ious]*: "
|
|
1987 "Prev[ious]*: \\([^,\n\t]*\\)"))
|
|
1988 (list "Previous node..."
|
|
1989 (list 'Info-goto-node node)))
|
|
1990 ((setq node (Info-get-token point "Node: " "Node: \\([^,\n\t]*\\)"))
|
|
1991 (list "Reselecting %s..."
|
|
1992 (list 'Info-goto-node node)))
|
|
1993 ((save-excursion (goto-char point) (looking-at "[ \n]*\\'"))
|
|
1994 (if Info-in-cross-reference
|
|
1995 (list "Back to last node..."
|
|
1996 '(Info-last))
|
|
1997 (list "Next node..."
|
|
1998 '(Info-global-next)))))
|
|
1999 ))
|
|
2000
|
|
2001 (defun Info-follow-nearest-node (point)
|
|
2002 "Follow a node reference near point. Like M, F, N, P or U command.
|
|
2003 At end of the node's text, moves to the next node."
|
|
2004 (interactive "d")
|
|
2005 (let ((data (Info-find-nearest-node point)))
|
|
2006 (if (null data)
|
|
2007 nil
|
|
2008 (let ((msg (format (car data) (nth 1 (nth 1 data)))))
|
|
2009 (message "%s" msg)
|
|
2010 (eval (nth 1 data))
|
|
2011 (message "%sdone" msg))
|
|
2012 t)))
|
|
2013
|
|
2014 (defun Info-indicated-node (event)
|
|
2015 (condition-case ()
|
|
2016 (save-excursion
|
|
2017 (cond ((eventp event)
|
|
2018 (set-buffer (event-buffer event))
|
|
2019 (setq event (event-point event))))
|
|
2020 (let* ((data (Info-find-nearest-node event))
|
|
2021 (name (nth 1 (nth 1 data))))
|
|
2022 (and name (nth 1 data))))
|
|
2023 (error nil)))
|
|
2024
|
|
2025
|
|
2026 (defvar Info-mode-map nil
|
|
2027 "Keymap containing Info commands.")
|
|
2028 (if Info-mode-map
|
|
2029 nil
|
|
2030 (setq Info-mode-map (make-keymap))
|
|
2031 (suppress-keymap Info-mode-map)
|
|
2032 (define-key Info-mode-map "." 'beginning-of-buffer)
|
|
2033 (define-key Info-mode-map " " 'Info-scroll-next)
|
|
2034 (define-key Info-mode-map "1" 'Info-nth-menu-item)
|
|
2035 (define-key Info-mode-map "2" 'Info-nth-menu-item)
|
|
2036 (define-key Info-mode-map "3" 'Info-nth-menu-item)
|
|
2037 (define-key Info-mode-map "4" 'Info-nth-menu-item)
|
|
2038 (define-key Info-mode-map "5" 'Info-nth-menu-item)
|
|
2039 (define-key Info-mode-map "6" 'Info-nth-menu-item)
|
|
2040 (define-key Info-mode-map "7" 'Info-nth-menu-item)
|
|
2041 (define-key Info-mode-map "8" 'Info-nth-menu-item)
|
|
2042 (define-key Info-mode-map "9" 'Info-nth-menu-item)
|
|
2043 (define-key Info-mode-map "0" 'Info-last-menu-item)
|
|
2044 (define-key Info-mode-map "?" 'Info-summary)
|
|
2045 (define-key Info-mode-map "a" 'Info-annotate)
|
|
2046 (define-key Info-mode-map "b" 'beginning-of-buffer)
|
|
2047 (define-key Info-mode-map "d" 'Info-directory)
|
|
2048 (define-key Info-mode-map "e" 'Info-edit)
|
|
2049 (define-key Info-mode-map "f" 'Info-follow-reference)
|
|
2050 (define-key Info-mode-map "g" 'Info-goto-node)
|
|
2051 (define-key Info-mode-map "h" 'Info-help)
|
|
2052 (define-key Info-mode-map "i" 'Info-index)
|
|
2053 (define-key Info-mode-map "j" 'Info-goto-bookmark)
|
|
2054 (define-key Info-mode-map "k" 'Info-emacs-key)
|
|
2055 (define-key Info-mode-map "l" 'Info-last)
|
|
2056 (define-key Info-mode-map "m" 'Info-menu)
|
|
2057 (define-key Info-mode-map "n" 'Info-next)
|
|
2058 (define-key Info-mode-map "p" 'Info-prev)
|
|
2059 (define-key Info-mode-map "q" 'Info-exit)
|
|
2060 (define-key Info-mode-map "r" 'Info-follow-reference)
|
|
2061 (define-key Info-mode-map "s" 'Info-search)
|
|
2062 (define-key Info-mode-map "t" 'Info-top)
|
|
2063 (define-key Info-mode-map "u" 'Info-up)
|
|
2064 (define-key Info-mode-map "v" 'Info-visit-file)
|
|
2065 (define-key Info-mode-map "x" 'Info-bookmark)
|
|
2066 (define-key Info-mode-map "<" 'Info-top)
|
|
2067 (define-key Info-mode-map ">" 'Info-end)
|
|
2068 (define-key Info-mode-map "[" 'Info-global-prev)
|
|
2069 (define-key Info-mode-map "]" 'Info-global-next)
|
|
2070 (define-key Info-mode-map "{" 'Info-page-prev)
|
|
2071 (define-key Info-mode-map "}" 'Info-page-next)
|
|
2072 (define-key Info-mode-map "=" 'Info-restore-point)
|
|
2073 (define-key Info-mode-map "!" 'Info-select-node)
|
|
2074 (define-key Info-mode-map "@" 'Info-follow-nearest-node)
|
|
2075 (define-key Info-mode-map "," 'Info-index-next)
|
|
2076 (define-key Info-mode-map "*" 'Info-elisp-ref)
|
|
2077 (define-key Info-mode-map "\t" 'Info-next-reference)
|
|
2078 (define-key Info-mode-map "\e\t" 'Info-prev-reference)
|
|
2079 (define-key Info-mode-map "\r" 'Info-follow-nearest-node)
|
|
2080 ;; XEmacs addition
|
161
|
2081 (define-key Info-mode-map 'backspace 'Info-scroll-prev)
|
|
2082 (define-key Info-mode-map 'delete 'Info-scroll-prev)
|
0
|
2083 (define-key Info-mode-map 'button2 'Info-follow-clicked-node)
|
|
2084 (define-key Info-mode-map 'button3 'Info-select-node-menu))
|
|
2085
|
|
2086
|
|
2087 ;; Info mode is suitable only for specially formatted data.
|
|
2088 (put 'info-mode 'mode-class 'special)
|
|
2089
|
|
2090 (defun Info-mode ()
|
|
2091 "Info mode is for browsing through the Info documentation tree.
|
|
2092 Documentation in Info is divided into \"nodes\", each of which
|
|
2093 discusses one topic and contains references to other nodes
|
|
2094 which discuss related topics. Info has commands to follow
|
|
2095 the references and show you other nodes.
|
|
2096
|
|
2097 h Invoke the Info tutorial.
|
|
2098 q Quit Info: return to the previously selected file or buffer.
|
|
2099
|
|
2100 Selecting other nodes:
|
|
2101 n Move to the \"next\" node of this node.
|
|
2102 p Move to the \"previous\" node of this node.
|
|
2103 m Pick menu item specified by name (or abbreviation).
|
|
2104 1-9, 0 Pick first..ninth, last item in node's menu.
|
|
2105 Menu items select nodes that are \"subsections\" of this node.
|
|
2106 u Move \"up\" from this node (i.e., from a subsection to a section).
|
|
2107 f or r Follow a cross reference by name (or abbrev). Type `l' to get back.
|
|
2108 RET Follow cross reference or menu item indicated by cursor.
|
|
2109 i Look up a topic in this file's Index and move to that node.
|
|
2110 , (comma) Move to the next match from a previous `i' command.
|
|
2111 l (letter L) Move back to the last node you were in.
|
|
2112
|
|
2113 Moving within a node:
|
|
2114 Space Scroll forward a full screen. DEL Scroll backward.
|
|
2115 b Go to beginning of node. Meta-> Go to end of node.
|
|
2116 TAB Go to next cross-reference. Meta-TAB Go to previous ref.
|
|
2117
|
|
2118 Mouse commands:
|
|
2119 Left Button Set point.
|
|
2120 Middle Button Click on a highlighted node reference to go to it.
|
|
2121 Right Button Pop up a menu of applicable Info commands.
|
|
2122
|
|
2123 Advanced commands:
|
|
2124 g Move to node, file, or annotation tag specified by name.
|
|
2125 Examples: `g Rectangles' `g (Emacs)Rectangles' `g Emacs'.
|
|
2126 v Move to file, with filename completion.
|
|
2127 k Look up a key sequence in Emacs manual (also C-h C-k at any time).
|
|
2128 * Look up a function name in Emacs Lisp manual (also C-h C-f).
|
|
2129 d Go to the main directory of Info files.
|
|
2130 < or t Go to Top (first) node of this file.
|
|
2131 > Go to last node in this file.
|
|
2132 \[ Go to previous node, treating file as one linear document.
|
|
2133 \] Go to next node, treating file as one linear document.
|
|
2134 { Scroll backward, or go to previous node if at top.
|
|
2135 } Scroll forward, or go to next node if at bottom.
|
|
2136 = Restore cursor position from last time in this node.
|
|
2137 a Add a private note (annotation) to the current node.
|
|
2138 x, j Add, jump to a bookmark (annotation tag).
|
|
2139 s Search this Info file for a node containing the specified regexp.
|
|
2140 e Edit the contents of the current node."
|
|
2141 (kill-all-local-variables)
|
|
2142 (setq major-mode 'Info-mode)
|
|
2143 (setq mode-name "Info")
|
|
2144 (use-local-map Info-mode-map)
|
|
2145 (set-syntax-table text-mode-syntax-table)
|
|
2146 (setq local-abbrev-table text-mode-abbrev-table)
|
|
2147 (setq case-fold-search t)
|
|
2148 (setq buffer-read-only t)
|
|
2149 ; (setq buffer-mouse-map Info-mode-mouse-map)
|
|
2150 (make-local-variable 'Info-current-file)
|
|
2151 (make-local-variable 'Info-current-subfile)
|
|
2152 (make-local-variable 'Info-current-node)
|
|
2153 (make-local-variable 'Info-tag-table-marker)
|
|
2154 (make-local-variable 'Info-current-file-completions)
|
|
2155 (make-local-variable 'Info-current-annotation-completions)
|
|
2156 (make-local-variable 'Info-index-alternatives)
|
|
2157 (make-local-variable 'Info-history)
|
|
2158 (if t ;; XEmacs: remove v19 test
|
|
2159 (progn
|
|
2160 (or (and (fboundp 'find-face) (find-face 'info-node))
|
|
2161 (make-face 'info-node "used for node links in info"))
|
|
2162 (or (and (fboundp 'find-face) (find-face 'info-xref))
|
|
2163 (make-face 'info-xref "used for cross-references in info"))
|
|
2164 (or (face-differs-from-default-p 'info-node)
|
|
2165 (if (face-differs-from-default-p 'bold-italic)
|
|
2166 (copy-face 'bold-italic 'info-node)
|
|
2167 (copy-face 'bold 'info-node)))
|
|
2168 (or (face-differs-from-default-p 'info-xref)
|
|
2169 (copy-face 'bold 'info-xref))))
|
|
2170 (make-local-variable 'mouse-track-click-hook)
|
|
2171 (add-hook 'mouse-track-click-hook 'Info-maybe-follow-clicked-node)
|
|
2172 ;; #### The console-on-window-system-p check is to allow this to
|
|
2173 ;; work on tty's. The real problem here is that featurep really
|
|
2174 ;; needs to have some device/console domain knowledge added to it.
|
|
2175 (if (and (featurep 'toolbar)
|
|
2176 (console-on-window-system-p)
|
|
2177 (not Info-inhibit-toolbar))
|
|
2178 (set-specifier default-toolbar (cons (current-buffer) info::toolbar)))
|
|
2179 (if (featurep 'menubar)
|
|
2180 (progn
|
|
2181 ;; make a local copy of the menubar, so our modes don't
|
|
2182 ;; change the global menubar
|
|
2183 (set-buffer-menubar current-menubar)
|
|
2184 (add-submenu nil '("Info"
|
|
2185 :filter Info-menu-filter))))
|
|
2186 (run-hooks 'Info-mode-hook)
|
|
2187 (Info-set-mode-line))
|
|
2188
|
|
2189 (defvar Info-edit-map nil
|
|
2190 "Local keymap used within `e' command of Info.")
|
|
2191 (if Info-edit-map
|
|
2192 nil
|
|
2193 ;; XEmcas: remove FSF stuff
|
|
2194 (setq Info-edit-map (make-sparse-keymap))
|
|
2195 (set-keymap-name Info-edit-map 'Info-edit-map)
|
|
2196 (set-keymap-parents Info-edit-map (list text-mode-map))
|
|
2197 (define-key Info-edit-map "\C-c\C-c" 'Info-cease-edit))
|
|
2198
|
|
2199 ;; Info-edit mode is suitable only for specially formatted data.
|
|
2200 (put 'info-edit-mode 'mode-class 'special)
|
|
2201
|
|
2202 (defun Info-edit-mode ()
|
|
2203 "Major mode for editing the contents of an Info node.
|
|
2204 Like text mode with the addition of `Info-cease-edit'
|
|
2205 which returns to Info mode for browsing.
|
|
2206 \\{Info-edit-map}"
|
|
2207 )
|
|
2208
|
|
2209 (defun Info-edit ()
|
|
2210 "Edit the contents of this Info node.
|
|
2211 Allowed only if variable `Info-enable-edit' is non-nil."
|
|
2212 (interactive)
|
|
2213 (or Info-enable-edit
|
|
2214 (error "Editing info nodes is not enabled"))
|
|
2215 (use-local-map Info-edit-map)
|
|
2216 (setq major-mode 'Info-edit-mode)
|
|
2217 (setq mode-name "Info Edit")
|
|
2218 (kill-local-variable 'modeline-buffer-identification)
|
|
2219 (setq buffer-read-only nil)
|
|
2220 ;; Make mode line update.
|
|
2221 (set-buffer-modified-p (buffer-modified-p))
|
|
2222 (message (substitute-command-keys
|
|
2223 "Editing: Type \\[Info-cease-edit] to return to info")))
|
|
2224
|
|
2225 (defun Info-cease-edit ()
|
|
2226 "Finish editing Info node; switch back to Info proper."
|
|
2227 (interactive)
|
|
2228 ;; Do this first, so nothing has changed if user C-g's at query.
|
|
2229 (and (buffer-modified-p)
|
|
2230 (y-or-n-p "Save the file? ")
|
|
2231 (save-buffer))
|
|
2232 (use-local-map Info-mode-map)
|
|
2233 (setq major-mode 'Info-mode)
|
|
2234 (setq mode-name "Info")
|
|
2235 (Info-set-mode-line)
|
|
2236 (setq buffer-read-only t)
|
|
2237 ;; Make mode line update.
|
|
2238 (set-buffer-modified-p (buffer-modified-p))
|
|
2239 (and (marker-position Info-tag-table-marker)
|
|
2240 (buffer-modified-p)
|
|
2241 (message "Tags may have changed. Use Info-tagify if necessary")))
|
|
2242
|
|
2243 (defun Info-find-emacs-command-nodes (command)
|
|
2244 "Return a list of locations documenting COMMAND in the XEmacs Info manual.
|
|
2245 The locations are of the format used in Info-history, i.e.
|
|
2246 \(FILENAME NODENAME BUFFERPOS\)."
|
|
2247 (let ((where '())
|
|
2248 (cmd-desc (concat "^\\* " (regexp-quote (symbol-name command))
|
|
2249 ":\\s *\\(.*\\)\\.$")))
|
|
2250 (save-excursion
|
|
2251 (Info-find-node "XEmacs" "Command Index")
|
|
2252 ;; Take the index node off the Info history.
|
|
2253 (setq Info-history (cdr Info-history))
|
|
2254 (goto-char (point-max))
|
|
2255 (while (re-search-backward cmd-desc nil t)
|
|
2256 (setq where (cons (list Info-current-file
|
|
2257 (buffer-substring
|
|
2258 (match-beginning 1)
|
|
2259 (match-end 1))
|
|
2260 0)
|
|
2261 where)))
|
|
2262 where)))
|
|
2263
|
|
2264
|
|
2265 ;;; fontification and mousability for info
|
|
2266
|
|
2267 (defun Info-highlight-region (start end face)
|
|
2268 (let ((extent (make-extent start end)))
|
|
2269 (set-extent-face extent face)
|
|
2270 (set-extent-property extent 'info t)
|
|
2271 (set-extent-property extent 'highlight t)))
|
|
2272
|
|
2273 (defun Info-fontify-node ()
|
|
2274 (save-excursion
|
|
2275 (let (;(lucid (string-match "Lucid" emacs-version))
|
|
2276 (case-fold-search t)
|
|
2277 (xref-regexp (concat "\\*"
|
|
2278 (regexp-quote Info-footnote-tag)
|
|
2279 "[ \n\t]*\\([^:]*\\):")))
|
|
2280 ; (if lucid
|
|
2281 (map-extents (function (lambda (x y) (delete-extent x)))
|
|
2282 (current-buffer) (point-min) (point-max) nil)
|
|
2283 ; )
|
|
2284 (goto-char (point-min))
|
|
2285 (if (looking-at "^File: [^,: \t]+,?[ \t]+")
|
|
2286 (progn
|
|
2287 (goto-char (match-end 0))
|
|
2288 (while
|
|
2289 (looking-at "[ \t]*[^:, \t\n]+:[ \t]+\\([^:,\t\n]+\\),?")
|
|
2290 (goto-char (match-end 0))
|
|
2291 (Info-highlight-region (match-beginning 1) (match-end 1)
|
|
2292 'info-xref ;lucid
|
|
2293 ))))
|
|
2294 (goto-char (point-min))
|
|
2295 (while (re-search-forward xref-regexp nil t)
|
|
2296 (if (= (char-after (1- (match-beginning 0))) ?\") ; hack
|
|
2297 nil
|
|
2298 (Info-highlight-region (match-beginning 1) (match-end 1)
|
|
2299 'info-xref ;lucid
|
|
2300 )))
|
|
2301 (goto-char (point-min))
|
|
2302 (if (and (search-forward "\n* menu:" nil t)
|
|
2303 ;; principle of least astonishment, dude...
|
|
2304 ;; (Also, in xemacs this is fast even on indexes, and without it, nodes don't
|
|
2305 ;; highlight when you move over them.)
|
|
2306 ;; (not (string-match "\\<Index\\>" Info-current-node))
|
|
2307 ;; (< (- (point-max) (point)) 10000)
|
|
2308 )
|
|
2309 (while (re-search-forward "^\\* \\([^:\t\n]*\\):" nil t)
|
|
2310 (Info-highlight-region (match-beginning 1) (match-end 1)
|
|
2311 'info-node ;lucid
|
|
2312 )))
|
|
2313 (set-buffer-modified-p nil))))
|
|
2314
|
|
2315 (defun Info-construct-menu (&optional event)
|
|
2316 "Construct a menu of Info commands.
|
|
2317 Adds an entry for the node at EVENT, or under point if EVENT is omitted.
|
|
2318 Used to construct the menubar submenu and popup menu."
|
|
2319 (or event (setq event (point)))
|
|
2320 (let ((case-fold-search t)
|
|
2321 (xref-regexp (concat "\\*"
|
|
2322 (regexp-quote Info-footnote-tag)
|
|
2323 "[ \n\t]*\\([^:]*\\):"))
|
|
2324 up-p prev-p next-p menu
|
|
2325 i text xrefs subnodes in)
|
|
2326 (save-excursion
|
|
2327 (goto-char (point-min))
|
|
2328 (if (looking-at ".*\\bNext:") (setq next-p t))
|
|
2329 (if (looking-at ".*\\bPrev:") (setq prev-p t))
|
|
2330 (if (looking-at ".*Up:") (setq up-p t))
|
|
2331 (setq menu (nconc
|
|
2332 (if (setq in (Info-indicated-node event))
|
|
2333 (list (vector (car (cdr in)) in t)))
|
|
2334 (list
|
|
2335 ["Goto Info Top-level" Info-directory t]
|
|
2336 (vector "Next Node" 'Info-next next-p)
|
|
2337 (vector "Previous Node" 'Info-prev prev-p)
|
|
2338 (vector "Parent Node (Up)" 'Info-up up-p)
|
|
2339 ["Goto Node..." Info-goto-node t]
|
|
2340 ["Goto Last Visited Node" Info-last t])))
|
|
2341 (while (re-search-forward xref-regexp nil t)
|
|
2342 (setq text (buffer-substring (match-beginning 1) (match-end 1)))
|
|
2343 (while (setq i (string-match "[ \n\t]+" text i))
|
|
2344 (setq text (concat (substring text 0 i) " "
|
|
2345 (substring text (match-end 0))))
|
|
2346 (setq i (1+ i)))
|
|
2347 (setq xrefs (cons text xrefs)))
|
|
2348 (setq xrefs (nreverse xrefs))
|
|
2349 (if (> (length xrefs) 21) (setcdr (nthcdr 20 xrefs) '(more)))
|
|
2350 (goto-char (point-min))
|
|
2351 (if (search-forward "\n* menu:" nil t)
|
|
2352 (while (re-search-forward "^\\* \\([^:\t\n]*\\):" nil t)
|
|
2353 (setq text (buffer-substring (match-beginning 1) (match-end 1)))
|
|
2354 (setq subnodes (cons text subnodes))))
|
|
2355 (setq subnodes (nreverse subnodes))
|
|
2356 (if (> (length subnodes) 21) (setcdr (nthcdr 20 subnodes) '(more)))
|
|
2357 )
|
|
2358 (if xrefs
|
|
2359 (nconc menu (list "----" "Cross-References:" "----")
|
|
2360 (mapcar (function (lambda (xref)
|
|
2361 (if (eq xref 'more)
|
|
2362 "...more..."
|
|
2363 (vector xref
|
|
2364 (list 'Info-follow-reference xref)
|
|
2365 t))))
|
|
2366 xrefs)))
|
|
2367 (if subnodes
|
|
2368 (nconc menu (list "----" "Sub-Nodes:" "----")
|
|
2369 (mapcar (function (lambda (node)
|
|
2370 (if (eq node 'more)
|
|
2371 "...more..."
|
|
2372 (vector node (list 'Info-menu node)
|
|
2373 t))))
|
|
2374 subnodes)))
|
|
2375 menu))
|
|
2376
|
|
2377 (defun Info-menu-filter (menu)
|
|
2378 "This is the menu filter for the \"Info\" submenu."
|
|
2379 (Info-construct-menu))
|
|
2380
|
|
2381 (defun Info-select-node-menu (event)
|
|
2382 "Pops up a menu of applicable Info commands."
|
|
2383 (interactive "e")
|
|
2384 (select-window (event-window event))
|
|
2385 (let ((menu (Info-construct-menu event)))
|
|
2386 (setq menu (nconc (list "Info" ; title: not shown
|
|
2387 "Info Commands:" "----")
|
|
2388 menu))
|
|
2389 (let ((popup-menu-titles nil))
|
|
2390 (popup-menu menu))))
|
|
2391
|
|
2392 ;;; Info toolbar support
|
|
2393
|
|
2394 ;; exit icon taken from GNUS
|
|
2395 (defvar info::toolbar-exit-icon
|
|
2396 (if (featurep 'toolbar)
|
|
2397 (toolbar-make-button-list
|
|
2398 (expand-file-name (if (featurep 'xpm) "info-exit.xpm" "info-exit.xbm")
|
|
2399 toolbar-icon-directory)))
|
|
2400 "Exit Info icon")
|
|
2401
|
|
2402 (defvar info::toolbar-up-icon
|
|
2403 (if (featurep 'toolbar)
|
|
2404 (toolbar-make-button-list
|
|
2405 (expand-file-name (if (featurep 'xpm) "info-up.xpm" "info-up.xbm")
|
|
2406 toolbar-icon-directory)))
|
|
2407 "Up icon")
|
|
2408
|
|
2409 (defvar info::toolbar-next-icon
|
|
2410 (if (featurep 'toolbar)
|
|
2411 (toolbar-make-button-list
|
|
2412 (expand-file-name (if (featurep 'xpm) "info-next.xpm" "info-next.xbm")
|
|
2413 toolbar-icon-directory)))
|
|
2414 "Next icon")
|
|
2415
|
|
2416 (defvar info::toolbar-prev-icon
|
|
2417 (if (featurep 'toolbar)
|
|
2418 (toolbar-make-button-list
|
|
2419 (expand-file-name (if (featurep 'xpm) "info-prev.xpm" "info-prev.xbm")
|
|
2420 toolbar-icon-directory)))
|
|
2421 "Prev icon")
|
|
2422
|
|
2423 (defvar info::toolbar
|
|
2424 (if (featurep 'toolbar)
|
|
2425 ; disabled until we get the next/prev-win icons working again.
|
|
2426 ; (cons (first initial-toolbar-spec)
|
|
2427 ; (cons (second initial-toolbar-spec)
|
|
2428 '([info::toolbar-exit-icon
|
|
2429 Info-exit
|
|
2430 t
|
|
2431 "Exit info"]
|
|
2432 [info::toolbar-prev-icon
|
|
2433 Info-prev
|
|
2434 t
|
|
2435 "Prev entry in same section"]
|
|
2436 [info::toolbar-next-icon
|
|
2437 Info-next
|
|
2438 t
|
|
2439 "Next entry in same section"]
|
|
2440 [info::toolbar-up-icon
|
|
2441 Info-up
|
|
2442 t
|
|
2443 "Up entry to enclosing section"]
|
|
2444 )))
|
|
2445 ;))
|
|
2446
|
|
2447
|
|
2448 (provide 'info)
|
|
2449
|
|
2450 (run-hooks 'Info-load-hook)
|
|
2451
|
|
2452 ;;; info.el ends here
|