annotate lisp/progmodes/octave-hlp.el @ 20892:18f3cb26243f before-miles-orphaned-changes gcc-2_8_1-980401 gcc-2_8_1-980407 gcc-2_8_1-980412 gcc-2_8_1-980413 gcc-2_8_1-RELEASE gcc_2_8_1-980315 libc-980214 libc-980215 libc-980216 libc-980217 libc-980218 libc-980219 libc-980220 libc-980221 libc-980222 libc-980223 libc-980224 libc-980225 libc-980226 libc-980227 libc-980228 libc-980301 libc-980302 libc-980303 libc-980304 libc-980306 libc-980307 libc-980308 libc-980309 libc-980310 libc-980311 libc-980312 libc-980313 libc-980314 libc-980315 libc-980316 libc-980317 libc-980318 libc-980319 libc-980320 libc-980321 libc-980322 libc-980323 libc-980324 libc-980325 libc-980326 libc-980327 libc-980328 libc-980329 libc-980330 libc-980331 libc-980401 libc-980402 libc-980403 libc-980404 libc-980405 libc-980406 libc-980407 libc-980408 libc-980409 libc-980410 libc-980411 libc-980412 libc-980413 libc-980414 libc-980428 libc-980429 libc-980430 libc-980501 libc-980502 libc-980503 libc-980504 libc-980505 libc-980506 libc-980507 libc-980508 libc-980509 libc-980510 libc-980512 libc-980513 libc-980514 libc-980515 libc-980516 libc-980517 libc-980518 libc-980519 libc-980520 libc-980521 libc-980522 libc-980523 libc-980524 libc-980525 libc-980526 libc-980527 libc-980528 libc-980529 libc-980530 libc-980531 libc-980601 libc-980602 libc-980603 libc-980604 libc-980605 libc-980606 libc-980607 libc-980608 libc-980609 libc-980610 libc-980611 libc-980612 libc-980613

Add PentiumII (i786). Add '7' to all i[3456] entries. Add AMD and Cyrix names for P5 and P6.
author Richard Kenner <kenner@gnu.org>
date Fri, 13 Feb 1998 12:16:46 +0000
parents 8f952e921136
children 0d8b17d428b5
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
17517
8f952e921136 Comment change.
Richard M. Stallman <rms@gnu.org>
parents: 17149
diff changeset
1 ;;; octave-hlp.el --- getting help on Octave symbols using info
16903
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2
17517
8f952e921136 Comment change.
Richard M. Stallman <rms@gnu.org>
parents: 17149
diff changeset
3 ;; Copyright (C) 1997 Free Software Foundation, Inc.
16903
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5 ;; Author: Kurt Hornik <Kurt.Hornik@ci.tuwien.ac.at>
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
6 ;; Author: John Eaton <jwe@bevo.che.wisc.edu>
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
7 ;; Maintainer: Kurt Hornik <Kurt.Hornik@ci.tuwien.ac.at>
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
8 ;; Keywords: languages
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
9
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
10 ;; This file is part of GNU Emacs.
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
11
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
12 ;; GNU Emacs is free software; you can redistribute it and/or modify
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
13 ;; it under the terms of the GNU General Public License as published by
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
14 ;; the Free Software Foundation; either version 2, or (at your option)
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
15 ;; any later version.
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
16
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
17 ;; GNU Emacs is distributed in the hope that it will be useful,
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
18 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
20 ;; GNU General Public License for more details.
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
21
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
22 ;; You should have received a copy of the GNU General Public License
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
23 ;; along with GNU Emacs; see the file COPYING. If not, write to the
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
24 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
25 ;; Boston, MA 02111-1307, USA.
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
26
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
27 ;;; Commentary:
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
28
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
29 ;; Provides the command `octave-help' which allows index lookup of a
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
30 ;; symbol in the Octave-related info files, as specified by the list
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
31 ;; `octave-help-files'.
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
32
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
33 ;; Other features may be added in future versions.
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
34
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
35 ;;; Code:
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
36
16904
2bc5f76917e0 Require octave-mod, not octave.
Richard M. Stallman <rms@gnu.org>
parents: 16903
diff changeset
37 (require 'octave-mod)
16903
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
38 (require 'info)
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
39
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
40 (defvar octave-help-files '("octave")
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
41 "List of info files with documentation for Octave.
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
42 Default is (\"octave\").")
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
43
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
44 (defvar octave-help-lookup-alist nil
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
45 "Alist of Octave index entries for lookup.")
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
46
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
47 (defvar octave-help-completion-alist nil
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
48 "Alist of Octave index entries for completion.
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
49 The entries are of the form (VAR . VAR), where VAR runs through all
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
50 different keys in `octave-help-lookup-alist'.")
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
51
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
52 ;;;###autoload
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
53 (defun octave-help (key)
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
54 "Get help on Octave symbols from the Octave info files.
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
55 Look up KEY in the function, operator and variable indices of the files
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
56 specified by `octave-help-files'.
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
57 If KEY is not a string, prompt for it with completion."
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
58 (interactive
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
59 (list
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
60 (completing-read (format "Describe Octave symbol: ")
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
61 (octave-help-get-completion-alist)
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
62 nil t)))
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
63 (if (get-buffer "*info*")
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
64 (set-buffer "*info*"))
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
65 (if (zerop (length key))
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
66 (Info-find-node (car octave-help-files) "Top")
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
67 (let ((alist (copy-alist (octave-help-get-lookup-alist)))
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
68 entry matches)
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
69 (while (setq entry (car alist))
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
70 (if (string-match key (car entry))
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
71 (add-to-list 'matches entry))
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
72 (setq alist (cdr alist)))
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
73 (if matches
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
74 (progn
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
75 (setq Info-index-alternatives matches)
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
76 (Info-index-next 0))))))
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
77
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
78 (defun octave-help-get-lookup-alist ()
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
79 "Build the index lookup alist from all Octave info files.
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
80 The files specified by `octave-help-files' are searched."
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
81 (if octave-help-lookup-alist
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
82 ()
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
83 (message "Building help lookup alist...")
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
84 (let ((files octave-help-files) file key node)
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
85 (save-window-excursion
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
86 (while files
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
87 (setq file (car files))
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
88 (Info-goto-node (concat "(" file ")"))
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
89 (condition-case nil
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
90 (progn
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
91 (Info-index "")
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
92 (while
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
93 (progn
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
94 (while (re-search-forward
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
95 "^\\* \\([^(:]+\\)[^:]*: *\\(.+\\)\\.$"
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
96 nil t)
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
97 (setq key (match-string 1)
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
98 node (concat "(" file ")" (match-string 2)))
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
99 (and (string-match "\\(.*\\>\\) *$" key)
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
100 (setq key (replace-match "\\1" t nil key)))
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
101 (add-to-list 'octave-help-lookup-alist
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
102 (list key
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
103 node
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
104 (concat (concat "(" file ")")
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
105 Info-current-node)
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
106 0)))
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
107 (and (setq node (Info-extract-pointer "next" t))
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
108 (string-match
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
109 (concat "\\(Function\\|Operator\\|Variable\\) "
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
110 "\\<Index\\>")
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
111 node)))
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
112 (Info-goto-node node)))
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
113 (error nil))
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
114 (setq files (cdr files)))))
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
115 (message "Building help lookup alist...done"))
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
116 octave-help-lookup-alist)
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
117
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
118 (defun octave-help-get-completion-alist ()
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
119 "Build the index completion alist from all Octave info files.
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
120 The files specified by `octave-help-files' are searched."
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
121 (if octave-help-completion-alist
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
122 ()
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
123 (message "Building help completion alist...")
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
124 (let ((alist (octave-help-get-lookup-alist)) entry)
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
125 (while alist
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
126 (setq entry (car alist))
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
127 (add-to-list 'octave-help-completion-alist
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
128 (cons (car entry) (car entry)))
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
129 (setq alist (cdr alist))))
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
130 (message "Building help completion alist...done"))
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
131 octave-help-completion-alist)
b1239a1ef6f2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
132
17149
b6b657de23f3 Provide octave-hlp.
Karl Heuer <kwzh@gnu.org>
parents: 16904
diff changeset
133 ;;; provide ourself
b6b657de23f3 Provide octave-hlp.
Karl Heuer <kwzh@gnu.org>
parents: 16904
diff changeset
134
b6b657de23f3 Provide octave-hlp.
Karl Heuer <kwzh@gnu.org>
parents: 16904
diff changeset
135 (provide 'octave-hlp)
b6b657de23f3 Provide octave-hlp.
Karl Heuer <kwzh@gnu.org>
parents: 16904
diff changeset
136
16904
2bc5f76917e0 Require octave-mod, not octave.
Richard M. Stallman <rms@gnu.org>
parents: 16903
diff changeset
137 ;;; octave-hlp.el ends here