annotate src/help.cc @ 8863:34a821854961

pkg.m (generate_lookfor_cache): generate a DOC file for each directory
author Jason Riedy <jason@acm.org>
date Wed, 25 Feb 2009 00:41:40 -0500
parents 31f864877246
children eb63fbe60fab
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
1 /*
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
2
7017
a1dbe9d80eee [project @ 2007-10-12 21:27:11 by jwe]
jwe
parents: 7016
diff changeset
3 Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
a1dbe9d80eee [project @ 2007-10-12 21:27:11 by jwe]
jwe
parents: 7016
diff changeset
4 2002, 2003, 2004, 2005, 2006, 2007 John W. Eaton
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
5
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
6 This file is part of Octave.
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
7
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
8 Octave is free software; you can redistribute it and/or modify it
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
9 under the terms of the GNU General Public License as published by the
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 7001
diff changeset
10 Free Software Foundation; either version 3 of the License, or (at your
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 7001
diff changeset
11 option) any later version.
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
12
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
13 Octave is distributed in the hope that it will be useful, but WITHOUT
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
16 for more details.
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
17
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
18 You should have received a copy of the GNU General Public License
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 7001
diff changeset
19 along with Octave; see the file COPYING. If not, see
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 7001
diff changeset
20 <http://www.gnu.org/licenses/>.
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
21
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
22 */
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
23
240
a99f28f5e351 [project @ 1993-11-30 20:24:36 by jwe]
jwe
parents: 1
diff changeset
24 #ifdef HAVE_CONFIG_H
1192
b6360f2d4fa6 [project @ 1995-03-30 21:38:35 by jwe]
jwe
parents: 1155
diff changeset
25 #include <config.h>
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
26 #endif
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
27
1343
94bedeb289e5 [project @ 1995-09-04 00:29:21 by jwe]
jwe
parents: 1315
diff changeset
28 #include <cstdlib>
94bedeb289e5 [project @ 1995-09-04 00:29:21 by jwe]
jwe
parents: 1315
diff changeset
29 #include <cstring>
94bedeb289e5 [project @ 1995-09-04 00:29:21 by jwe]
jwe
parents: 1315
diff changeset
30
5769
2b9a5ce46678 [project @ 2006-04-18 15:57:06 by jwe]
jwe
parents: 5768
diff changeset
31 #include <algorithm>
3503
d14c483b3c12 [project @ 2000-02-01 04:06:07 by jwe]
jwe
parents: 3408
diff changeset
32 #include <iostream>
d14c483b3c12 [project @ 2000-02-01 04:06:07 by jwe]
jwe
parents: 3408
diff changeset
33 #include <fstream>
5765
7ba9ad1fec11 [project @ 2006-04-17 05:05:15 by jwe]
jwe
parents: 5738
diff changeset
34 #include <sstream>
1755
3a9462b655f1 [project @ 1996-01-22 04:47:22 by jwe]
jwe
parents: 1742
diff changeset
35 #include <string>
3a9462b655f1 [project @ 1996-01-22 04:47:22 by jwe]
jwe
parents: 1742
diff changeset
36
1350
5f63d83dd694 [project @ 1995-09-05 07:37:59 by jwe]
jwe
parents: 1343
diff changeset
37 #ifdef HAVE_UNISTD_H
2442
f667d7ec08b9 [project @ 1996-10-30 18:46:22 by jwe]
jwe
parents: 2371
diff changeset
38 #ifdef HAVE_SYS_TYPES_H
1295
34295bf6aac6 [project @ 1995-05-01 18:24:48 by jwe]
jwe
parents: 1288
diff changeset
39 #include <sys/types.h>
2442
f667d7ec08b9 [project @ 1996-10-30 18:46:22 by jwe]
jwe
parents: 2371
diff changeset
40 #endif
1295
34295bf6aac6 [project @ 1995-05-01 18:24:48 by jwe]
jwe
parents: 1288
diff changeset
41 #include <unistd.h>
34295bf6aac6 [project @ 1995-05-01 18:24:48 by jwe]
jwe
parents: 1288
diff changeset
42 #endif
1343
94bedeb289e5 [project @ 1995-09-04 00:29:21 by jwe]
jwe
parents: 1315
diff changeset
43
3295
35a6d027772c [project @ 1999-10-19 10:13:02 by jwe]
jwe
parents: 3259
diff changeset
44 #include "cmd-edit.h"
35a6d027772c [project @ 1999-10-19 10:13:02 by jwe]
jwe
parents: 3259
diff changeset
45 #include "file-ops.h"
6253
f1676652d808 [project @ 2007-01-24 20:43:36 by jwe]
jwe
parents: 6243
diff changeset
46 #include "file-stat.h"
2926
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2900
diff changeset
47 #include "oct-env.h"
1755
3a9462b655f1 [project @ 1996-01-22 04:47:22 by jwe]
jwe
parents: 1742
diff changeset
48 #include "str-vec.h"
3a9462b655f1 [project @ 1996-01-22 04:47:22 by jwe]
jwe
parents: 1742
diff changeset
49
2492
06595bc7f2d0 [project @ 1996-11-09 00:13:50 by jwe]
jwe
parents: 2470
diff changeset
50 #include <defaults.h>
1352
19c10b8657d5 [project @ 1995-09-05 08:11:57 by jwe]
jwe
parents: 1350
diff changeset
51 #include "defun.h"
19c10b8657d5 [project @ 1995-09-05 08:11:57 by jwe]
jwe
parents: 1350
diff changeset
52 #include "dirfns.h"
19c10b8657d5 [project @ 1995-09-05 08:11:57 by jwe]
jwe
parents: 1350
diff changeset
53 #include "error.h"
2202
31b62b7c5d2d [project @ 1996-05-15 06:07:11 by jwe]
jwe
parents: 2189
diff changeset
54 #include "gripes.h"
1352
19c10b8657d5 [project @ 1995-09-05 08:11:57 by jwe]
jwe
parents: 1350
diff changeset
55 #include "help.h"
2177
0bddc913621b [project @ 1996-05-13 16:36:11 by jwe]
jwe
parents: 2124
diff changeset
56 #include "input.h"
5832
5e41e06f6a78 [project @ 2006-05-26 21:41:32 by jwe]
jwe
parents: 5823
diff changeset
57 #include "load-path.h"
1755
3a9462b655f1 [project @ 1996-01-22 04:47:22 by jwe]
jwe
parents: 1742
diff changeset
58 #include "oct-obj.h"
2976
641689f67673 [project @ 1997-05-15 20:27:04 by jwe]
jwe
parents: 2962
diff changeset
59 #include "ov-usr-fcn.h"
1352
19c10b8657d5 [project @ 1995-09-05 08:11:57 by jwe]
jwe
parents: 1350
diff changeset
60 #include "pager.h"
3018
5708b8bb4f06 [project @ 1997-06-03 21:48:05 by jwe]
jwe
parents: 3016
diff changeset
61 #include "parse.h"
1466
2f85a175308f [project @ 1995-09-22 07:48:59 by jwe]
jwe
parents: 1443
diff changeset
62 #include "pathsearch.h"
3295
35a6d027772c [project @ 1999-10-19 10:13:02 by jwe]
jwe
parents: 3259
diff changeset
63 #include "procstream.h"
7336
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7272
diff changeset
64 #include "pt-pr-code.h"
529
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 389
diff changeset
65 #include "sighandlers.h"
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 389
diff changeset
66 #include "symtab.h"
2694
13f134a00f12 [project @ 1997-02-18 15:33:28 by jwe]
jwe
parents: 2692
diff changeset
67 #include "syswait.h"
1755
3a9462b655f1 [project @ 1996-01-22 04:47:22 by jwe]
jwe
parents: 1742
diff changeset
68 #include "toplev.h"
8672
2a49c32d4322 allow help to work with files containing only comments
John W. Eaton <jwe@octave.org>
parents: 8631
diff changeset
69 #include "unwind-prot.h"
242
742c4795aea9 [project @ 1993-11-30 21:26:43 by jwe]
jwe
parents: 240
diff changeset
70 #include "utils.h"
1352
19c10b8657d5 [project @ 1995-09-05 08:11:57 by jwe]
jwe
parents: 1350
diff changeset
71 #include "variables.h"
3301
02866242d3ae [project @ 1999-10-20 04:10:46 by jwe]
jwe
parents: 3296
diff changeset
72 #include "version.h"
5447
051ddd7a6681 [project @ 2005-09-14 05:18:23 by jwe]
jwe
parents: 5399
diff changeset
73 #include "quit.h"
529
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 389
diff changeset
74
8861
31f864877246 doc and lookfor fixes
John W. Eaton <jwe@octave.org>
parents: 8812
diff changeset
75 // Name of the doc cache file specified on the command line.
31f864877246 doc and lookfor fixes
John W. Eaton <jwe@octave.org>
parents: 8812
diff changeset
76 // (--doc-cache-file file)
31f864877246 doc and lookfor fixes
John W. Eaton <jwe@octave.org>
parents: 8812
diff changeset
77 std::string Vdoc_cache_file;
31f864877246 doc and lookfor fixes
John W. Eaton <jwe@octave.org>
parents: 8812
diff changeset
78
2202
31b62b7c5d2d [project @ 1996-05-15 06:07:11 by jwe]
jwe
parents: 2189
diff changeset
79 // Name of the info file specified on command line.
31b62b7c5d2d [project @ 1996-05-15 06:07:11 by jwe]
jwe
parents: 2189
diff changeset
80 // (--info-file file)
3523
b80bbb43a1a9 [project @ 2000-02-02 10:25:52 by jwe]
jwe
parents: 3503
diff changeset
81 std::string Vinfo_file;
2202
31b62b7c5d2d [project @ 1996-05-15 06:07:11 by jwe]
jwe
parents: 2189
diff changeset
82
31b62b7c5d2d [project @ 1996-05-15 06:07:11 by jwe]
jwe
parents: 2189
diff changeset
83 // Name of the info reader we'd like to use.
31b62b7c5d2d [project @ 1996-05-15 06:07:11 by jwe]
jwe
parents: 2189
diff changeset
84 // (--info-program program)
5794
1138ced03f14 [project @ 2006-05-08 20:23:04 by jwe]
jwe
parents: 5780
diff changeset
85 std::string Vinfo_program;
2202
31b62b7c5d2d [project @ 1996-05-15 06:07:11 by jwe]
jwe
parents: 2189
diff changeset
86
3686
9507d6de9bbd [project @ 2000-06-29 16:30:44 by jwe]
jwe
parents: 3584
diff changeset
87 // Name of the makeinfo program to run.
5794
1138ced03f14 [project @ 2006-05-08 20:23:04 by jwe]
jwe
parents: 5780
diff changeset
88 static std::string Vmakeinfo_program = "makeinfo";
3686
9507d6de9bbd [project @ 2000-06-29 16:30:44 by jwe]
jwe
parents: 3584
diff changeset
89
2189
d01936305d99 [project @ 1996-05-14 03:31:57 by jwe]
jwe
parents: 2177
diff changeset
90 // If TRUE, don't print additional help message in help and usage
d01936305d99 [project @ 1996-05-14 03:31:57 by jwe]
jwe
parents: 2177
diff changeset
91 // functions.
5794
1138ced03f14 [project @ 2006-05-08 20:23:04 by jwe]
jwe
parents: 5780
diff changeset
92 static bool Vsuppress_verbose_help_message = false;
2189
d01936305d99 [project @ 1996-05-14 03:31:57 by jwe]
jwe
parents: 2177
diff changeset
93
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
94 #include <map>
3016
f512c16826d1 [project @ 1997-06-03 03:16:13 by jwe]
jwe
parents: 3014
diff changeset
95
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
96 typedef std::map<std::string, std::string> map_type;
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
97 typedef map_type::value_type pair_type;
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
98 typedef map_type::const_iterator map_iter;
3016
f512c16826d1 [project @ 1997-06-03 03:16:13 by jwe]
jwe
parents: 3014
diff changeset
99
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
100 template<typename T, std::size_t z>
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
101 std::size_t
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
102 size (T const (&)[z])
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
103 {
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
104 return z;
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
105 }
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
106
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
107 // FIXME -- The descriptions could easily be in texinfo -- should they?
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
108 const static pair_type operators[] =
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
109 {
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
110 pair_type ("!",
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
111 "Logical not operator. See also `~'.\n"),
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
112
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
113 pair_type ("!=",
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
114 "Logical not equals operator. See also `~='.\n"),
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
115
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
116 pair_type ("\"",
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
117 "String delimiter.\n"),
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
118
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
119 pair_type ("#",
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
120 "Begin comment character. See also `%'."),
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
121
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
122 pair_type ("%",
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
123 "Begin comment charcter. See also `#'."),
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
124
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
125 pair_type ("&",
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
126 "Element by element logical and operator. See also `&&'."),
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
127
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
128 pair_type ("&&",
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
129 "Logical and operator (with short-circuit evaluation). See also `&'."),
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
130
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
131 pair_type ("'",
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
132 "Matrix transpose operator. For complex matrices, computes the\n\
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
133 complex conjugate (Hermitian) transpose. See also `.''\n\
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
134 \n\
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
135 The single quote character may also be used to delimit strings, but\n\
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
136 it is better to use the double quote character, since that is never\n\
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
137 ambiguous"),
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
138
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
139 pair_type ("(",
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
140 "Array index or function argument delimiter."),
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
141
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
142 pair_type (")",
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
143 "Array index or function argument delimiter."),
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
144
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
145 pair_type ("*",
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
146 "Multiplication operator. See also `.*'"),
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
147
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
148 pair_type ("**",
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
149 "Power operator. See also `^', `.**', and `.^'"),
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
150
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
151 pair_type ("+",
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
152 "Addition operator."),
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
153
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
154 pair_type ("++",
5339
4266ef7972b2 [project @ 2005-05-05 19:06:25 by jwe]
jwe
parents: 5307
diff changeset
155 "Increment operator. As in C, may be applied as a prefix or postfix\n\
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
156 operator."),
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
157
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
158 pair_type (",",
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
159 "Array index, function argument, or command separator."),
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
160
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
161 pair_type ("-",
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
162 "Subtraction or unary negation operator."),
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
163
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
164 pair_type ("--",
5339
4266ef7972b2 [project @ 2005-05-05 19:06:25 by jwe]
jwe
parents: 5307
diff changeset
165 "Decrement operator. As in C, may be applied as a prefix or postfix\n\
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
166 operator."),
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
167
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
168 pair_type (".'",
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
169 "Matrix transpose operator. For complex matrices, computes the\n\
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
170 transpose, *not* the complex conjugate transpose. See also `''."),
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
171
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
172 pair_type (".*",
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
173 "Element by element multiplication operator. See also `*'."),
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
174
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
175 pair_type (".**",
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
176 "Element by element power operator. See also `**', `^', and `.^'."),
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
177
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
178 pair_type ("./",
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
179 "Element by element division operator. See also `/' and `\\'."),
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
180
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
181 pair_type (".^",
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
182 "Element by element power operator. See also `**', `^', and `.^'."),
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
183
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
184 pair_type ("/",
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
185 "Right division. See also `\\' and `./'."),
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
186
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
187 pair_type (":",
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
188 "Select entire rows or columns of matrices."),
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
189
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
190 pair_type (";",
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
191 "Array row or command separator. See also `,'."),
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
192
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
193 pair_type ("<",
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
194 "Less than operator."),
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
195
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
196 pair_type ("<=",
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
197 "Less than or equals operator."),
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
198
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
199 pair_type ("=",
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
200 "Assignment operator."),
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
201
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
202 pair_type ("==",
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
203 "Equality test operator."),
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
204
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
205 pair_type (">",
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
206 "Greater than operator."),
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
207
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
208 pair_type (">=",
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
209 "Greater than or equals operator."),
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
210
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
211 pair_type ("[",
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
212 "Return list delimiter. See also `]'."),
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
213
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
214 pair_type ("\\",
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
215 "Left division operator. See also `/' and `./'."),
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
216
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
217 pair_type ("]",
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
218 "Return list delimiter. See also `['."),
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
219
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
220 pair_type ("^",
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
221 "Power operator. See also `**', `.^', and `.**.'"),
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
222
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
223 pair_type ("|",
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
224 "Element by element logical or operator. See also `||'."),
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
225
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
226 pair_type ("||",
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
227 "Logical or operator (with short-circuit evaluation). See also `|'."),
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
228
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
229 pair_type ("~",
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
230 "Logical not operator. See also `!' and `~'."),
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
231
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
232 pair_type ("~=",
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
233 "Logical not equals operator. See also `!='."),
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
234 };
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
235
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
236 const static pair_type keywords[] =
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
237 {
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
238 pair_type ("break",
5818
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
239 "-*- texinfo -*-\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
240 @deffn Keyword break\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
241 Exit the innermost enclosing do, while or for loop.\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
242 @seealso{do, while, for, continue}\n\
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
243 @end deffn"),
5040
b6ff3a0d3d17 [project @ 2004-09-27 13:50:01 by jwe]
jwe
parents: 4686
diff changeset
244
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
245 pair_type ("case",
5818
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
246 "-*- texinfo -*-\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
247 @deffn Keyword case @{@var{value}@}\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
248 A case statement in an switch. Octave cases are exclusive and do not\n\
5040
b6ff3a0d3d17 [project @ 2004-09-27 13:50:01 by jwe]
jwe
parents: 4686
diff changeset
249 fall-through as do C-language cases. A switch statement must have at least\n\
5818
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
250 one case. See @code{switch} for an example.\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
251 @seealso{switch}\n\
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
252 @end deffn"),
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
253
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
254 pair_type ("catch",
5818
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
255 "-*- texinfo -*-\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
256 @deffn Keyword catch\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
257 Begin the cleanup part of a try-catch block.\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
258 @seealso{try}\n\
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
259 @end deffn"),
1489
3e705c864019 [project @ 1995-09-28 05:38:26 by jwe]
jwe
parents: 1488
diff changeset
260
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
261 pair_type ("continue",
5818
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
262 "-*- texinfo -*-\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
263 @deffn Keyword continue\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
264 Jump to the end of the innermost enclosing do, while or for loop.\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
265 @seealso{do, while, for, break}\n\
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
266 @end deffn"),
5040
b6ff3a0d3d17 [project @ 2004-09-27 13:50:01 by jwe]
jwe
parents: 4686
diff changeset
267
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
268 pair_type ("do",
5818
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
269 "-*- texinfo -*-\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
270 @deffn Keyword do\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
271 Begin a do-until loop. This differs from a do-while loop in that the\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
272 body of the loop is executed at least once.\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
273 @seealso{while}\n\
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
274 @end deffn"),
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
275
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
276 pair_type ("else",
5818
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
277 "-*- texinfo -*-\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
278 @deffn Keyword else\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
279 Alternate action for an if block. See @code{if} for an example.\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
280 @seealso{if}\n\
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
281 @end deffn"),
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
282
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
283 pair_type ("elseif",
5818
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
284 "-*- texinfo -*-\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
285 @deffn Keyword elseif (@var{condition})\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
286 Alternate conditional test for an if block. See @code{if} for an example.\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
287 @seealso{if}\n\
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
288 @end deffn"),
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
289
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
290 pair_type ("end",
5818
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
291 "-*- texinfo -*-\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
292 @deffn Keyword end\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
293 Mark the end of any @code{for}, @code{if}, @code{do}, @code{while}, or @code{function} block.\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
294 @seealso{for, if, do, while, function}\n\
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
295 @end deffn"),
928
2f91e7098f8c [project @ 1994-11-15 21:53:40 by jwe]
jwe
parents: 867
diff changeset
296
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
297 pair_type ("end_try_catch",
5818
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
298 "-*- texinfo -*-\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
299 @deffn Keyword end_try_catch\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
300 Mark the end of an @code{try-catch} block.\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
301 @seealso{try, catch}\n\
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
302 @end deffn"),
1489
3e705c864019 [project @ 1995-09-28 05:38:26 by jwe]
jwe
parents: 1488
diff changeset
303
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
304 pair_type ("end_unwind_protect",
5818
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
305 "-*- texinfo -*-\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
306 @deffn Keyword end_unwind_protect\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
307 Mark the end of an unwind_protect block.\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
308 @seealso{unwind_protect}\n\
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
309 @end deffn"),
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
310
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
311 pair_type ("endfor",
5818
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
312 "-*- texinfo -*-\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
313 @deffn Keyword endfor\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
314 Mark the end of a for loop. See @code{for} for an example.\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
315 @seealso{for}\n\
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
316 @end deffn"),
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
317
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
318 pair_type ("endfunction",
5818
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
319 "-*- texinfo -*-\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
320 @deffn Keyword endfunction\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
321 Mark the end of a function.\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
322 @seealso{function}\n\
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
323 @end deffn"),
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
324
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
325 pair_type ("endif",
5818
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
326 "-*- texinfo -*-\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
327 @deffn Keyword endif\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
328 Mark the end of an if block. See @code{if} for an example.\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
329 @seealso{if}\n\
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
330 @end deffn"),
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
331
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
332 pair_type ("endswitch",
5818
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
333 "-*- texinfo -*-\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
334 @deffn Keyword endswitch\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
335 Mark the end of a switch block. See @code{switch} for an example.\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
336 @seealso{switch}\n\
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
337 @end deffn"),
5122
695509577dc6 [project @ 2005-01-26 22:15:11 by jwe]
jwe
parents: 5041
diff changeset
338
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
339 pair_type ("endwhile",
5818
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
340 "-*- texinfo -*-\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
341 @deffn Keyword endwhile\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
342 Mark the end of a while loop. See @code{while} for an example.\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
343 @seealso{do, while}\n\
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
344 @end deffn"),
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
345
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
346 pair_type ("for",
5818
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
347 "-*- texinfo -*-\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
348 @deffn Keyword for @var{i} = @var{range}\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
349 Begin a for loop.\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
350 @example\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
351 for i = 1:10\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
352 i\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
353 endfor\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
354 @end example\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
355 @seealso{do, while}\n\
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
356 @end deffn"),
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
357
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
358 pair_type ("function",
5818
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
359 "-*- texinfo -*-\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
360 @deffn Keyword function @var{outputs} = function (@var{input}, ...)\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
361 @deffnx Keyword function {} function (@var{input}, ...)\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
362 @deffnx Keyword function @var{outputs} = function\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
363 Begin a function body with @var{outputs} as results and @var{inputs} as\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
364 parameters.\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
365 @seealso{return}\n\
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
366 @end deffn"),
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
367
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
368 pair_type ("global",
5818
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
369 "-*- texinfo -*-\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
370 @deffn Keyword global\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
371 Declare variables to have global scope.\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
372 @example\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
373 global @var{x};\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
374 if isempty (@var{x})\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
375 x = 1;\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
376 endif\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
377 @end example\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
378 @seealso{persistent}\n\
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
379 @end deffn"),
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
380
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
381 pair_type ("if",
5393
c8783205a7c6 [project @ 2005-06-15 17:03:54 by jwe]
jwe
parents: 5339
diff changeset
382 "-*- texinfo -*-\n\
c8783205a7c6 [project @ 2005-06-15 17:03:54 by jwe]
jwe
parents: 5339
diff changeset
383 @deffn Keyword if (@var{cond}) @dots{} endif\n\
c8783205a7c6 [project @ 2005-06-15 17:03:54 by jwe]
jwe
parents: 5339
diff changeset
384 @deffnx Keyword if (@var{cond}) @dots{} else @dots{} endif\n\
c8783205a7c6 [project @ 2005-06-15 17:03:54 by jwe]
jwe
parents: 5339
diff changeset
385 @deffnx Keyword if (@var{cond}) @dots{} elseif (@var{cond}) @dots{} endif\n\
c8783205a7c6 [project @ 2005-06-15 17:03:54 by jwe]
jwe
parents: 5339
diff changeset
386 @deffnx Keyword if (@var{cond}) @dots{} elseif (@var{cond}) @dots{} else @dots{} endif\n\
c8783205a7c6 [project @ 2005-06-15 17:03:54 by jwe]
jwe
parents: 5339
diff changeset
387 Begin an if block.\n\
5818
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
388 @example\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
389 x = 1;\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
390 if (x == 1)\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
391 disp (\"one\");\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
392 elseif (x == 2)\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
393 disp (\"two\");\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
394 else\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
395 disp (\"not one or two\");\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
396 endif\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
397 @end example\n\
5646
2b20d1707f29 [project @ 2006-03-06 22:38:32 by jwe]
jwe
parents: 5644
diff changeset
398 @seealso{switch}\n\
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
399 @end deffn"),
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
400
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
401 pair_type ("otherwise",
5818
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
402 "-*- texinfo -*-\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
403 @deffn Keyword otherwise\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
404 The default statement in a switch block (similar to else in an if block).\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
405 @seealso{switch}\n\
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
406 @end deffn"),
5040
b6ff3a0d3d17 [project @ 2004-09-27 13:50:01 by jwe]
jwe
parents: 4686
diff changeset
407
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
408 pair_type ("persistent",
5818
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
409 "-*- texinfo -*-\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
410 @deffn Keyword persistent @var{var}\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
411 Declare variables as persistent. A variable that has been declared\n\
5623
691de3e3c2f8 [project @ 2006-02-15 18:32:32 by jwe]
jwe
parents: 5594
diff changeset
412 persistent within a function will retain its contents in memory between\n\
691de3e3c2f8 [project @ 2006-02-15 18:32:32 by jwe]
jwe
parents: 5594
diff changeset
413 subsequent calls to the same function. The difference between persistent\n\
5818
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
414 variables and global variables is that persistent variables are local in \n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
415 scope to a particular function and are not visible elsewhere.\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
416 @seealso{global}\n\
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
417 @end deffn"),
4686
c7ae43dfdea4 [project @ 2004-01-06 19:29:23 by jwe]
jwe
parents: 4469
diff changeset
418
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
419 pair_type ("replot",
5818
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
420 "-*- texinfo -*-\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
421 @deffn Keyword replot\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
422 Replot a graphic.\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
423 @seealso{plot}\n\
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
424 @end deffn"),
5040
b6ff3a0d3d17 [project @ 2004-09-27 13:50:01 by jwe]
jwe
parents: 4686
diff changeset
425
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
426 pair_type ("return",
5818
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
427 "-*- texinfo -*-\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
428 @deffn Keyword return\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
429 Return from a function.\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
430 @seealso{function}\n\
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
431 @end deffn"),
928
2f91e7098f8c [project @ 1994-11-15 21:53:40 by jwe]
jwe
parents: 867
diff changeset
432
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
433 pair_type ("static",
5818
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
434 "-*- texinfo -*-\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
435 @deffn Keyword static\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
436 This function has been deprecated in favor of persistent.\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
437 @seealso{persistent}\n\
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
438 @end deffn"),
5040
b6ff3a0d3d17 [project @ 2004-09-27 13:50:01 by jwe]
jwe
parents: 4686
diff changeset
439
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
440 pair_type ("switch",
5818
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
441 "-*- texinfo -*-\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
442 @deffn Keyword switch @var{statement}\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
443 Begin a switch block.\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
444 @example\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
445 yesno = \"yes\"\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
446 \n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
447 switch yesno\n\
5832
5e41e06f6a78 [project @ 2006-05-26 21:41:32 by jwe]
jwe
parents: 5823
diff changeset
448 case @{\"Yes\" \"yes\" \"YES\" \"y\" \"Y\"@}\n\
5818
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
449 value = 1;\n\
5832
5e41e06f6a78 [project @ 2006-05-26 21:41:32 by jwe]
jwe
parents: 5823
diff changeset
450 case @{\"No\" \"no\" \"NO\" \"n\" \"N\"@}\n\
5818
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
451 value = 0;\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
452 otherwise\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
453 error (\"invalid value\");\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
454 endswitch\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
455 @end example\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
456 @seealso{if, case, otherwise}\n\
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
457 @end deffn"),
5040
b6ff3a0d3d17 [project @ 2004-09-27 13:50:01 by jwe]
jwe
parents: 4686
diff changeset
458
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
459 pair_type ("try",
5818
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
460 "-*- texinfo -*-\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
461 @deffn Keyword try\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
462 Begin a try-catch block.\n\
6138
c5874b47d571 [project @ 2006-11-03 18:26:11 by jwe]
jwe
parents: 6099
diff changeset
463 \n\
c5874b47d571 [project @ 2006-11-03 18:26:11 by jwe]
jwe
parents: 6099
diff changeset
464 If an error occurs within a try block, then the catch code will be run and\n\
c5874b47d571 [project @ 2006-11-03 18:26:11 by jwe]
jwe
parents: 6099
diff changeset
465 execution will proceed after the catch block (though it is often\n\
c5874b47d571 [project @ 2006-11-03 18:26:11 by jwe]
jwe
parents: 6099
diff changeset
466 recommended to use the lasterr function to re-throw the error after cleanup\n\
c5874b47d571 [project @ 2006-11-03 18:26:11 by jwe]
jwe
parents: 6099
diff changeset
467 is completed).\n\
c5874b47d571 [project @ 2006-11-03 18:26:11 by jwe]
jwe
parents: 6099
diff changeset
468 @seealso{catch,unwind_protect}\n\
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
469 @end deffn"),
1489
3e705c864019 [project @ 1995-09-28 05:38:26 by jwe]
jwe
parents: 1488
diff changeset
470
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
471 pair_type ("until",
5818
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
472 "-*- texinfo -*-\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
473 @deffn Keyword until\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
474 End a do-until loop.\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
475 @seealso{do}\n\
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
476 @end deffn"),
5040
b6ff3a0d3d17 [project @ 2004-09-27 13:50:01 by jwe]
jwe
parents: 4686
diff changeset
477
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
478 pair_type ("unwind_protect",
5818
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
479 "-*- texinfo -*-\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
480 @deffn Keyword unwind_protect\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
481 Begin an unwind_protect block.\n\
6138
c5874b47d571 [project @ 2006-11-03 18:26:11 by jwe]
jwe
parents: 6099
diff changeset
482 \n\
c5874b47d571 [project @ 2006-11-03 18:26:11 by jwe]
jwe
parents: 6099
diff changeset
483 If an error occurs within the first part of an unwind_protect block\n\
c5874b47d571 [project @ 2006-11-03 18:26:11 by jwe]
jwe
parents: 6099
diff changeset
484 the commands within the unwind_protect_cleanup block are executed before\n\
c5874b47d571 [project @ 2006-11-03 18:26:11 by jwe]
jwe
parents: 6099
diff changeset
485 the error is thrown. If an error is not thrown, then the\n\
c5874b47d571 [project @ 2006-11-03 18:26:11 by jwe]
jwe
parents: 6099
diff changeset
486 unwind_protect_cleanup block is still executed (in other words, the\n\
c5874b47d571 [project @ 2006-11-03 18:26:11 by jwe]
jwe
parents: 6099
diff changeset
487 unwind_protect_cleanup will be run with or without an error in the\n\
c5874b47d571 [project @ 2006-11-03 18:26:11 by jwe]
jwe
parents: 6099
diff changeset
488 unwind_protect block).\n\
c5874b47d571 [project @ 2006-11-03 18:26:11 by jwe]
jwe
parents: 6099
diff changeset
489 @seealso{unwind_protect_cleanup,try}\n\
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
490 @end deffn"),
928
2f91e7098f8c [project @ 1994-11-15 21:53:40 by jwe]
jwe
parents: 867
diff changeset
491
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
492 pair_type ("unwind_protect_cleanup",
5818
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
493 "-*- texinfo -*-\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
494 @deffn Keyword unwind_protect_cleanup\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
495 Begin the cleanup section of an unwind_protect block.\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
496 @seealso{unwind_protect}\n\
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
497 @end deffn"),
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
498
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
499 pair_type ("varargin",
5818
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
500 "-*- texinfo -*-\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
501 @deffn Keyword varargin\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
502 Pass an arbitrary number of arguments into a function.\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
503 @seealso{varargout, nargin, nargout}\n\
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
504 @end deffn"),
5040
b6ff3a0d3d17 [project @ 2004-09-27 13:50:01 by jwe]
jwe
parents: 4686
diff changeset
505
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
506 pair_type ("varargout",
5818
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
507 "-*- texinfo -*-\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
508 @deffn Keyword varargout\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
509 Pass an arbitrary number of arguments out of a function.\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
510 @seealso{varargin, nargin, nargout}\n\
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
511 @end deffn"),
5040
b6ff3a0d3d17 [project @ 2004-09-27 13:50:01 by jwe]
jwe
parents: 4686
diff changeset
512
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
513 pair_type ("while",
5818
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
514 "-*- texinfo -*-\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
515 @deffn Keyword while\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
516 Begin a while loop.\n\
66a426e608cc [project @ 2006-05-17 16:45:41 by jwe]
jwe
parents: 5814
diff changeset
517 @seealso{do}\n\
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
518 @end deffn"),
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
519 };
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
520
581
bc813f5eb025 [project @ 1994-08-07 01:02:15 by jwe]
jwe
parents: 572
diff changeset
521 // Return a copy of the operator or keyword names.
3016
f512c16826d1 [project @ 1997-06-03 03:16:13 by jwe]
jwe
parents: 3014
diff changeset
522 static string_vector
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
523 names (const map_type& lst)
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
524 {
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
525 string_vector retval (lst.size ());
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
526 int j = 0;
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
527 for (map_iter iter = lst.begin (); iter != lst.end (); iter ++)
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
528 retval [j++] = iter->first;
1755
3a9462b655f1 [project @ 1996-01-22 04:47:22 by jwe]
jwe
parents: 1742
diff changeset
529 return retval;
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
530 }
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
531
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
532 const static map_type operators_map (operators, operators + size (operators));
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
533 const static map_type keywords_map (keywords, keywords + size (keywords));
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
534 const static string_vector keyword_names = names (keywords_map);
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
535
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
536 // FIXME -- It's not likely that this does the right thing now.
3016
f512c16826d1 [project @ 1997-06-03 03:16:13 by jwe]
jwe
parents: 3014
diff changeset
537
f512c16826d1 [project @ 1997-06-03 03:16:13 by jwe]
jwe
parents: 3014
diff changeset
538 string_vector
f512c16826d1 [project @ 1997-06-03 03:16:13 by jwe]
jwe
parents: 3014
diff changeset
539 make_name_list (void)
f512c16826d1 [project @ 1997-06-03 03:16:13 by jwe]
jwe
parents: 3014
diff changeset
540 {
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
541 const int key_len = keyword_names.length ();
3016
f512c16826d1 [project @ 1997-06-03 03:16:13 by jwe]
jwe
parents: 3014
diff changeset
542
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
543 const string_vector bif = symbol_table::built_in_function_names ();
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
544 const int bif_len = bif.length ();
4009
27e461aed956 [project @ 2002-07-31 09:33:03 by jwe]
jwe
parents: 3917
diff changeset
545
7752
40c428ea3408 initial implementation of dbup and dbdown
John W. Eaton <jwe@octave.org>
parents: 7438
diff changeset
546 // FIXME -- is this really necessary here?
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
547 const string_vector glb = symbol_table::global_variable_names ();
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
548 const int glb_len = glb.length ();
3016
f512c16826d1 [project @ 1997-06-03 03:16:13 by jwe]
jwe
parents: 3014
diff changeset
549
7752
40c428ea3408 initial implementation of dbup and dbdown
John W. Eaton <jwe@octave.org>
parents: 7438
diff changeset
550 // FIXME -- is this really necessary here?
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
551 const string_vector top = symbol_table::top_level_variable_names ();
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
552 const int top_len = top.length ();
3016
f512c16826d1 [project @ 1997-06-03 03:16:13 by jwe]
jwe
parents: 3014
diff changeset
553
3355
c4983fc7318f [project @ 1999-11-18 05:20:50 by jwe]
jwe
parents: 3333
diff changeset
554 string_vector lcl;
7336
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7272
diff changeset
555 if (! symbol_table::at_top_level ())
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7272
diff changeset
556 lcl = symbol_table::variable_names ();
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
557 const int lcl_len = lcl.length ();
3016
f512c16826d1 [project @ 1997-06-03 03:16:13 by jwe]
jwe
parents: 3014
diff changeset
558
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
559 const string_vector ffl = load_path::fcn_names ();
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
560 const int ffl_len = ffl.length ();
3016
f512c16826d1 [project @ 1997-06-03 03:16:13 by jwe]
jwe
parents: 3014
diff changeset
561
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
562 const string_vector afl = autoloaded_functions ();
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
563 const int afl_len = afl.length ();
5592
61d6cebd243b [project @ 2006-01-12 17:55:22 by dbateman]
dbateman
parents: 5576
diff changeset
564
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
565 const int total_len = key_len + bif_len + glb_len + top_len + lcl_len
7336
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7272
diff changeset
566 + ffl_len + afl_len;
3016
f512c16826d1 [project @ 1997-06-03 03:16:13 by jwe]
jwe
parents: 3014
diff changeset
567
f512c16826d1 [project @ 1997-06-03 03:16:13 by jwe]
jwe
parents: 3014
diff changeset
568 string_vector list (total_len);
f512c16826d1 [project @ 1997-06-03 03:16:13 by jwe]
jwe
parents: 3014
diff changeset
569
f512c16826d1 [project @ 1997-06-03 03:16:13 by jwe]
jwe
parents: 3014
diff changeset
570 // Put all the symbols in one big list.
f512c16826d1 [project @ 1997-06-03 03:16:13 by jwe]
jwe
parents: 3014
diff changeset
571
f512c16826d1 [project @ 1997-06-03 03:16:13 by jwe]
jwe
parents: 3014
diff changeset
572 int j = 0;
f512c16826d1 [project @ 1997-06-03 03:16:13 by jwe]
jwe
parents: 3014
diff changeset
573 int i = 0;
f512c16826d1 [project @ 1997-06-03 03:16:13 by jwe]
jwe
parents: 3014
diff changeset
574 for (i = 0; i < key_len; i++)
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
575 list[j++] = keyword_names[i];
3016
f512c16826d1 [project @ 1997-06-03 03:16:13 by jwe]
jwe
parents: 3014
diff changeset
576
7336
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7272
diff changeset
577 for (i = 0; i < bif_len; i++)
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7272
diff changeset
578 list[j++] = bif[i];
4009
27e461aed956 [project @ 2002-07-31 09:33:03 by jwe]
jwe
parents: 3917
diff changeset
579
3016
f512c16826d1 [project @ 1997-06-03 03:16:13 by jwe]
jwe
parents: 3014
diff changeset
580 for (i = 0; i < glb_len; i++)
f512c16826d1 [project @ 1997-06-03 03:16:13 by jwe]
jwe
parents: 3014
diff changeset
581 list[j++] = glb[i];
f512c16826d1 [project @ 1997-06-03 03:16:13 by jwe]
jwe
parents: 3014
diff changeset
582
f512c16826d1 [project @ 1997-06-03 03:16:13 by jwe]
jwe
parents: 3014
diff changeset
583 for (i = 0; i < top_len; i++)
f512c16826d1 [project @ 1997-06-03 03:16:13 by jwe]
jwe
parents: 3014
diff changeset
584 list[j++] = top[i];
f512c16826d1 [project @ 1997-06-03 03:16:13 by jwe]
jwe
parents: 3014
diff changeset
585
f512c16826d1 [project @ 1997-06-03 03:16:13 by jwe]
jwe
parents: 3014
diff changeset
586 for (i = 0; i < lcl_len; i++)
f512c16826d1 [project @ 1997-06-03 03:16:13 by jwe]
jwe
parents: 3014
diff changeset
587 list[j++] = lcl[i];
f512c16826d1 [project @ 1997-06-03 03:16:13 by jwe]
jwe
parents: 3014
diff changeset
588
f512c16826d1 [project @ 1997-06-03 03:16:13 by jwe]
jwe
parents: 3014
diff changeset
589 for (i = 0; i < ffl_len; i++)
f512c16826d1 [project @ 1997-06-03 03:16:13 by jwe]
jwe
parents: 3014
diff changeset
590 list[j++] = ffl[i];
f512c16826d1 [project @ 1997-06-03 03:16:13 by jwe]
jwe
parents: 3014
diff changeset
591
5592
61d6cebd243b [project @ 2006-01-12 17:55:22 by dbateman]
dbateman
parents: 5576
diff changeset
592 for (i = 0; i < afl_len; i++)
61d6cebd243b [project @ 2006-01-12 17:55:22 by dbateman]
dbateman
parents: 5576
diff changeset
593 list[j++] = afl[i];
61d6cebd243b [project @ 2006-01-12 17:55:22 by dbateman]
dbateman
parents: 5576
diff changeset
594
3016
f512c16826d1 [project @ 1997-06-03 03:16:13 by jwe]
jwe
parents: 3014
diff changeset
595 return list;
f512c16826d1 [project @ 1997-06-03 03:16:13 by jwe]
jwe
parents: 3014
diff changeset
596 }
f512c16826d1 [project @ 1997-06-03 03:16:13 by jwe]
jwe
parents: 3014
diff changeset
597
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
598 static bool
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
599 looks_like_html (const std::string& msg)
3014
38de16594cb4 [project @ 1997-06-02 20:28:09 by jwe]
jwe
parents: 3013
diff changeset
600 {
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
601 const size_t p1 = msg.find ('\n');
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
602 std::string t = msg.substr (0, p1);
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
603 const size_t p2 = t.find ("<html"); // FIXME: this comparison should be case-insensitive
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
604
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
605 return (p2 != std::string::npos);
2470
1e673f0648b5 [project @ 1996-11-05 21:46:06 by jwe]
jwe
parents: 2442
diff changeset
606 }
3014
38de16594cb4 [project @ 1997-06-02 20:28:09 by jwe]
jwe
parents: 3013
diff changeset
607
38de16594cb4 [project @ 1997-06-02 20:28:09 by jwe]
jwe
parents: 3013
diff changeset
608 static bool
3523
b80bbb43a1a9 [project @ 2000-02-02 10:25:52 by jwe]
jwe
parents: 3503
diff changeset
609 looks_like_texinfo (const std::string& msg, size_t& p1)
3295
35a6d027772c [project @ 1999-10-19 10:13:02 by jwe]
jwe
parents: 3259
diff changeset
610 {
35a6d027772c [project @ 1999-10-19 10:13:02 by jwe]
jwe
parents: 3259
diff changeset
611 p1 = msg.find ('\n');
35a6d027772c [project @ 1999-10-19 10:13:02 by jwe]
jwe
parents: 3259
diff changeset
612
3523
b80bbb43a1a9 [project @ 2000-02-02 10:25:52 by jwe]
jwe
parents: 3503
diff changeset
613 std::string t = msg.substr (0, p1);
3295
35a6d027772c [project @ 1999-10-19 10:13:02 by jwe]
jwe
parents: 3259
diff changeset
614
8021
85184151822e fix typo in NPOS change
John W. Eaton <jwe@octave.org>
parents: 8019
diff changeset
615 if (p1 == std::string::npos)
3295
35a6d027772c [project @ 1999-10-19 10:13:02 by jwe]
jwe
parents: 3259
diff changeset
616 p1 = 0;
35a6d027772c [project @ 1999-10-19 10:13:02 by jwe]
jwe
parents: 3259
diff changeset
617
35a6d027772c [project @ 1999-10-19 10:13:02 by jwe]
jwe
parents: 3259
diff changeset
618 size_t p2 = t.find ("-*- texinfo -*-");
35a6d027772c [project @ 1999-10-19 10:13:02 by jwe]
jwe
parents: 3259
diff changeset
619
8021
85184151822e fix typo in NPOS change
John W. Eaton <jwe@octave.org>
parents: 8019
diff changeset
620 return (p2 != std::string::npos);
3295
35a6d027772c [project @ 1999-10-19 10:13:02 by jwe]
jwe
parents: 3259
diff changeset
621 }
35a6d027772c [project @ 1999-10-19 10:13:02 by jwe]
jwe
parents: 3259
diff changeset
622
3355
c4983fc7318f [project @ 1999-11-18 05:20:50 by jwe]
jwe
parents: 3333
diff changeset
623 static bool
6243
7924a9086c08 [project @ 2007-01-17 21:47:50 by jwe]
jwe
parents: 6138
diff changeset
624 raw_help_from_symbol_table (const std::string& nm, std::string& h,
7924a9086c08 [project @ 2007-01-17 21:47:50 by jwe]
jwe
parents: 6138
diff changeset
625 std::string& w, bool& symbol_found)
3355
c4983fc7318f [project @ 1999-11-18 05:20:50 by jwe]
jwe
parents: 3333
diff changeset
626 {
c4983fc7318f [project @ 1999-11-18 05:20:50 by jwe]
jwe
parents: 3333
diff changeset
627 bool retval = false;
c4983fc7318f [project @ 1999-11-18 05:20:50 by jwe]
jwe
parents: 3333
diff changeset
628
7336
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7272
diff changeset
629 octave_value val = symbol_table::find_function (nm);
3355
c4983fc7318f [project @ 1999-11-18 05:20:50 by jwe]
jwe
parents: 3333
diff changeset
630
7336
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7272
diff changeset
631 if (val.is_defined ())
3355
c4983fc7318f [project @ 1999-11-18 05:20:50 by jwe]
jwe
parents: 3333
diff changeset
632 {
7336
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7272
diff changeset
633 octave_function *fcn = val.function_value ();
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7272
diff changeset
634
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7272
diff changeset
635 if (fcn)
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7272
diff changeset
636 {
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7272
diff changeset
637 symbol_found = true;
5399
db34dff19947 [project @ 2005-06-17 21:16:20 by jwe]
jwe
parents: 5393
diff changeset
638
7336
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7272
diff changeset
639 h = fcn->doc_string ();
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7272
diff changeset
640
8631
52956d669506 Display sensible error message when the help text of an undocumented function is requested
Soren Hauberg <hauberg@gmail.com>
parents: 8630
diff changeset
641 retval = true;
52956d669506 Display sensible error message when the help text of an undocumented function is requested
Soren Hauberg <hauberg@gmail.com>
parents: 8630
diff changeset
642
52956d669506 Display sensible error message when the help text of an undocumented function is requested
Soren Hauberg <hauberg@gmail.com>
parents: 8630
diff changeset
643 w = fcn->fcn_file_name ();
6243
7924a9086c08 [project @ 2007-01-17 21:47:50 by jwe]
jwe
parents: 6138
diff changeset
644
8631
52956d669506 Display sensible error message when the help text of an undocumented function is requested
Soren Hauberg <hauberg@gmail.com>
parents: 8630
diff changeset
645 if (w.empty ())
52956d669506 Display sensible error message when the help text of an undocumented function is requested
Soren Hauberg <hauberg@gmail.com>
parents: 8630
diff changeset
646 w = fcn->is_user_function ()
52956d669506 Display sensible error message when the help text of an undocumented function is requested
Soren Hauberg <hauberg@gmail.com>
parents: 8630
diff changeset
647 ? "command-line function" : "built-in function";
6243
7924a9086c08 [project @ 2007-01-17 21:47:50 by jwe]
jwe
parents: 6138
diff changeset
648 }
7924a9086c08 [project @ 2007-01-17 21:47:50 by jwe]
jwe
parents: 6138
diff changeset
649 }
3355
c4983fc7318f [project @ 1999-11-18 05:20:50 by jwe]
jwe
parents: 3333
diff changeset
650
6243
7924a9086c08 [project @ 2007-01-17 21:47:50 by jwe]
jwe
parents: 6138
diff changeset
651 return retval;
7924a9086c08 [project @ 2007-01-17 21:47:50 by jwe]
jwe
parents: 6138
diff changeset
652 }
7924a9086c08 [project @ 2007-01-17 21:47:50 by jwe]
jwe
parents: 6138
diff changeset
653
7924a9086c08 [project @ 2007-01-17 21:47:50 by jwe]
jwe
parents: 6138
diff changeset
654 static bool
7924a9086c08 [project @ 2007-01-17 21:47:50 by jwe]
jwe
parents: 6138
diff changeset
655 raw_help_from_file (const std::string& nm, std::string& h,
7924a9086c08 [project @ 2007-01-17 21:47:50 by jwe]
jwe
parents: 6138
diff changeset
656 std::string& file, bool& symbol_found)
7924a9086c08 [project @ 2007-01-17 21:47:50 by jwe]
jwe
parents: 6138
diff changeset
657 {
7924a9086c08 [project @ 2007-01-17 21:47:50 by jwe]
jwe
parents: 6138
diff changeset
658 bool retval = false;
7924a9086c08 [project @ 2007-01-17 21:47:50 by jwe]
jwe
parents: 6138
diff changeset
659
8672
2a49c32d4322 allow help to work with files containing only comments
John W. Eaton <jwe@octave.org>
parents: 8631
diff changeset
660 // FIXME -- this is a bit of a kluge...
2a49c32d4322 allow help to work with files containing only comments
John W. Eaton <jwe@octave.org>
parents: 8631
diff changeset
661 unwind_protect_bool (reading_script_file);
2a49c32d4322 allow help to work with files containing only comments
John W. Eaton <jwe@octave.org>
parents: 8631
diff changeset
662 reading_script_file = true;
2a49c32d4322 allow help to work with files containing only comments
John W. Eaton <jwe@octave.org>
parents: 8631
diff changeset
663
6243
7924a9086c08 [project @ 2007-01-17 21:47:50 by jwe]
jwe
parents: 6138
diff changeset
664 h = get_help_from_file (nm, symbol_found, file);
7924a9086c08 [project @ 2007-01-17 21:47:50 by jwe]
jwe
parents: 6138
diff changeset
665
8672
2a49c32d4322 allow help to work with files containing only comments
John W. Eaton <jwe@octave.org>
parents: 8631
diff changeset
666 unwind_protect::run ();
2a49c32d4322 allow help to work with files containing only comments
John W. Eaton <jwe@octave.org>
parents: 8631
diff changeset
667
6243
7924a9086c08 [project @ 2007-01-17 21:47:50 by jwe]
jwe
parents: 6138
diff changeset
668 if (h.length () > 0)
7924a9086c08 [project @ 2007-01-17 21:47:50 by jwe]
jwe
parents: 6138
diff changeset
669 retval = true;
7924a9086c08 [project @ 2007-01-17 21:47:50 by jwe]
jwe
parents: 6138
diff changeset
670
7924a9086c08 [project @ 2007-01-17 21:47:50 by jwe]
jwe
parents: 6138
diff changeset
671 return retval;
7924a9086c08 [project @ 2007-01-17 21:47:50 by jwe]
jwe
parents: 6138
diff changeset
672 }
7924a9086c08 [project @ 2007-01-17 21:47:50 by jwe]
jwe
parents: 6138
diff changeset
673
7924a9086c08 [project @ 2007-01-17 21:47:50 by jwe]
jwe
parents: 6138
diff changeset
674 static bool
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
675 raw_help_from_map (const std::string& nm, std::string& h,
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
676 const map_type& map, bool& symbol_found)
3355
c4983fc7318f [project @ 1999-11-18 05:20:50 by jwe]
jwe
parents: 3333
diff changeset
677 {
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
678 map_iter idx = map.find (nm);
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
679 symbol_found = (idx != map.end ());
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
680 h = (symbol_found) ? idx->second : "";
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
681 return symbol_found;
3355
c4983fc7318f [project @ 1999-11-18 05:20:50 by jwe]
jwe
parents: 3333
diff changeset
682 }
c4983fc7318f [project @ 1999-11-18 05:20:50 by jwe]
jwe
parents: 3333
diff changeset
683
6243
7924a9086c08 [project @ 2007-01-17 21:47:50 by jwe]
jwe
parents: 6138
diff changeset
684 std::string
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
685 raw_help (const std::string& nm, bool& symbol_found)
6243
7924a9086c08 [project @ 2007-01-17 21:47:50 by jwe]
jwe
parents: 6138
diff changeset
686 {
7924a9086c08 [project @ 2007-01-17 21:47:50 by jwe]
jwe
parents: 6138
diff changeset
687 std::string h;
7924a9086c08 [project @ 2007-01-17 21:47:50 by jwe]
jwe
parents: 6138
diff changeset
688 std::string w;
7924a9086c08 [project @ 2007-01-17 21:47:50 by jwe]
jwe
parents: 6138
diff changeset
689 std::string f;
7924a9086c08 [project @ 2007-01-17 21:47:50 by jwe]
jwe
parents: 6138
diff changeset
690
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
691 (raw_help_from_symbol_table (nm, h, w, symbol_found)
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
692 || raw_help_from_file (nm, h, f, symbol_found)
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
693 || raw_help_from_map (nm, h, operators_map, symbol_found)
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
694 || raw_help_from_map (nm, h, keywords_map, symbol_found));
6243
7924a9086c08 [project @ 2007-01-17 21:47:50 by jwe]
jwe
parents: 6138
diff changeset
695
7924a9086c08 [project @ 2007-01-17 21:47:50 by jwe]
jwe
parents: 6138
diff changeset
696 return h;
7924a9086c08 [project @ 2007-01-17 21:47:50 by jwe]
jwe
parents: 6138
diff changeset
697 }
7924a9086c08 [project @ 2007-01-17 21:47:50 by jwe]
jwe
parents: 6138
diff changeset
698
1140
26d986865487 [project @ 1995-02-26 03:23:43 by jwe]
jwe
parents: 1118
diff changeset
699 static void
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
700 do_get_help_text (const std::string name, std::string& text,
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
701 std::string& format)
1140
26d986865487 [project @ 1995-02-26 03:23:43 by jwe]
jwe
parents: 1118
diff changeset
702 {
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
703 bool symbol_found = false;
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
704 text = raw_help (name, symbol_found);
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
705
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
706 format = "Not found";
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
707 if (symbol_found)
1140
26d986865487 [project @ 1995-02-26 03:23:43 by jwe]
jwe
parents: 1118
diff changeset
708 {
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
709 size_t idx = -1;
8631
52956d669506 Display sensible error message when the help text of an undocumented function is requested
Soren Hauberg <hauberg@gmail.com>
parents: 8630
diff changeset
710 if (text.empty ())
52956d669506 Display sensible error message when the help text of an undocumented function is requested
Soren Hauberg <hauberg@gmail.com>
parents: 8630
diff changeset
711 {
52956d669506 Display sensible error message when the help text of an undocumented function is requested
Soren Hauberg <hauberg@gmail.com>
parents: 8630
diff changeset
712 format = "Not documented";
52956d669506 Display sensible error message when the help text of an undocumented function is requested
Soren Hauberg <hauberg@gmail.com>
parents: 8630
diff changeset
713 }
52956d669506 Display sensible error message when the help text of an undocumented function is requested
Soren Hauberg <hauberg@gmail.com>
parents: 8630
diff changeset
714 else if (looks_like_texinfo (text, idx))
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
715 {
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
716 format = "texinfo";
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
717 text.erase (0, idx);
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
718 }
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
719 else if (looks_like_html (text))
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
720 {
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
721 format = "html";
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
722 }
5399
db34dff19947 [project @ 2005-06-17 21:16:20 by jwe]
jwe
parents: 5393
diff changeset
723 else
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
724 {
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
725 format = "plain text";
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
726 }
1140
26d986865487 [project @ 1995-02-26 03:23:43 by jwe]
jwe
parents: 1118
diff changeset
727 }
26d986865487 [project @ 1995-02-26 03:23:43 by jwe]
jwe
parents: 1118
diff changeset
728 }
26d986865487 [project @ 1995-02-26 03:23:43 by jwe]
jwe
parents: 1118
diff changeset
729
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
730 DEFUN (get_help_text, args, , "-*- texinfo -*-\n\
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
731 @deftypefn {Loadable Function} {[@var{text}, @var{format}] =} get_help_text (@var{name})\n\
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
732 Returns the help text of a given function.\n\
3168
1c267910655d [project @ 1998-04-19 01:22:38 by jwe]
jwe
parents: 3164
diff changeset
733 \n\
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
734 This function returns the raw help text @var{text} and an indication of\n\
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
735 its format for the function @var{name}. The format indication @var{format}\n\
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
736 is a string that can be either @t{\"texinfo\"}, @t{\"html\"}, or\n\
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
737 @t{\"plain text\"}.\n\
3332
7c03933635c6 [project @ 1999-11-02 06:57:12 by jwe]
jwe
parents: 3330
diff changeset
738 \n\
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
739 To convert the help text to other formats, use the @code{makeinfo} function.\n\
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
740 \n\
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
741 @seealso{makeinfo}\n\
8812
7d48766c21a5 use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents: 8672
diff changeset
742 @end deftypefn")
529
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 389
diff changeset
743 {
2086
bfb775fb6fe8 [project @ 1996-04-25 05:55:19 by jwe]
jwe
parents: 1996
diff changeset
744 octave_value_list retval;
529
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 389
diff changeset
745
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
746 if (args.length () == 1)
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
747 {
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
748 const std::string name = args (0).string_value ();
1755
3a9462b655f1 [project @ 1996-01-22 04:47:22 by jwe]
jwe
parents: 1742
diff changeset
749
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
750 if (! error_state)
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
751 {
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
752 std::string text;
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
753 std::string format;
529
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 389
diff changeset
754
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
755 do_get_help_text (name, text, format);
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
756
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
757 retval(1) = format;
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
758 retval(0) = text;
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
759 }
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
760 else
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
761 error ("get_help_text: invalid input");
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
762 }
529
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 389
diff changeset
763 else
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
764 print_usage ();
529
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 389
diff changeset
765
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 389
diff changeset
766 return retval;
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 389
diff changeset
767 }
7ea224e713cd [project @ 1994-07-20 18:54:27 by jwe]
jwe
parents: 389
diff changeset
768
8812
7d48766c21a5 use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents: 8672
diff changeset
769 // Return a cell array of strings containing the names of all
7d48766c21a5 use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents: 8672
diff changeset
770 // operators.
7d48766c21a5 use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents: 8672
diff changeset
771
7d48766c21a5 use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents: 8672
diff changeset
772 DEFUN (__operators__, , ,
7d48766c21a5 use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents: 8672
diff changeset
773 "-*- texinfo -*-\n\
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
774 @deftypefn {Function File} __operators__ ()\n\
8812
7d48766c21a5 use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents: 8672
diff changeset
775 Undocumented internal function.\n\
7d48766c21a5 use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents: 8672
diff changeset
776 @end deftypefn")
3355
c4983fc7318f [project @ 1999-11-18 05:20:50 by jwe]
jwe
parents: 3333
diff changeset
777 {
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
778 return octave_value (Cell (names (operators_map)));
3355
c4983fc7318f [project @ 1999-11-18 05:20:50 by jwe]
jwe
parents: 3333
diff changeset
779 }
c4983fc7318f [project @ 1999-11-18 05:20:50 by jwe]
jwe
parents: 3333
diff changeset
780
8812
7d48766c21a5 use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents: 8672
diff changeset
781 // Return a cell array of strings containing the names of all
7d48766c21a5 use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents: 8672
diff changeset
782 // keywords.
7d48766c21a5 use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents: 8672
diff changeset
783
7d48766c21a5 use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents: 8672
diff changeset
784 DEFUN (__keywords__, , ,
7d48766c21a5 use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents: 8672
diff changeset
785 "-*- texinfo -*-\n\
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
786 @deftypefn {Function File} __keywords__ ()\n\
8812
7d48766c21a5 use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents: 8672
diff changeset
787 Undocumented internal function.\n\
7d48766c21a5 use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents: 8672
diff changeset
788 @end deftypefn")
581
bc813f5eb025 [project @ 1994-08-07 01:02:15 by jwe]
jwe
parents: 572
diff changeset
789 {
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
790 return octave_value (Cell (names (keywords_map)));
581
bc813f5eb025 [project @ 1994-08-07 01:02:15 by jwe]
jwe
parents: 572
diff changeset
791 }
bc813f5eb025 [project @ 1994-08-07 01:02:15 by jwe]
jwe
parents: 572
diff changeset
792
8812
7d48766c21a5 use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents: 8672
diff changeset
793 // Return a cell array of strings containing the names of all builtin
7d48766c21a5 use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents: 8672
diff changeset
794 // functions.
7d48766c21a5 use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents: 8672
diff changeset
795
7d48766c21a5 use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents: 8672
diff changeset
796 DEFUN (__builtins__, , ,
7d48766c21a5 use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents: 8672
diff changeset
797 "-*- texinfo -*-\n\
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
798 @deftypefn {Function File} __builtins__ ()\n\
8812
7d48766c21a5 use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents: 8672
diff changeset
799 Undocumented internal function.\n\
7d48766c21a5 use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents: 8672
diff changeset
800 @end deftypefn")
3355
c4983fc7318f [project @ 1999-11-18 05:20:50 by jwe]
jwe
parents: 3333
diff changeset
801 {
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
802 const string_vector bif = symbol_table::built_in_function_names ();
3355
c4983fc7318f [project @ 1999-11-18 05:20:50 by jwe]
jwe
parents: 3333
diff changeset
803
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
804 return octave_value (Cell (bif));
3355
c4983fc7318f [project @ 1999-11-18 05:20:50 by jwe]
jwe
parents: 3333
diff changeset
805 }
c4983fc7318f [project @ 1999-11-18 05:20:50 by jwe]
jwe
parents: 3333
diff changeset
806
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
807 static std::string
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
808 do_which (const std::string& name, std::string& type)
3355
c4983fc7318f [project @ 1999-11-18 05:20:50 by jwe]
jwe
parents: 3333
diff changeset
809 {
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
810 std::string file;
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
811
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
812 type = std::string ();
3355
c4983fc7318f [project @ 1999-11-18 05:20:50 by jwe]
jwe
parents: 3333
diff changeset
813
7336
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7272
diff changeset
814 octave_value val = symbol_table::find_function (name);
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7272
diff changeset
815
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7272
diff changeset
816 if (val.is_defined ())
3355
c4983fc7318f [project @ 1999-11-18 05:20:50 by jwe]
jwe
parents: 3333
diff changeset
817 {
7336
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7272
diff changeset
818 octave_function *fcn = val.function_value ();
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7272
diff changeset
819
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7272
diff changeset
820 if (fcn)
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7272
diff changeset
821 {
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
822 file = fcn->fcn_file_name ();
3355
c4983fc7318f [project @ 1999-11-18 05:20:50 by jwe]
jwe
parents: 3333
diff changeset
823
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
824 if (file.empty ())
7336
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7272
diff changeset
825 {
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7272
diff changeset
826 if (fcn->is_user_function ())
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
827 type = "command-line function";
7336
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7272
diff changeset
828 else
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
829 type = "built-in function";
7336
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7272
diff changeset
830 }
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7272
diff changeset
831 else
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
832 type = val.is_user_script ()
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
833 ? std::string ("script") : std::string ("function");
7336
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7272
diff changeset
834 }
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7272
diff changeset
835 }
8672
2a49c32d4322 allow help to work with files containing only comments
John W. Eaton <jwe@octave.org>
parents: 8631
diff changeset
836 else
2a49c32d4322 allow help to work with files containing only comments
John W. Eaton <jwe@octave.org>
parents: 8631
diff changeset
837 {
2a49c32d4322 allow help to work with files containing only comments
John W. Eaton <jwe@octave.org>
parents: 8631
diff changeset
838 // We might find a file that contains only a doc string.
2a49c32d4322 allow help to work with files containing only comments
John W. Eaton <jwe@octave.org>
parents: 8631
diff changeset
839
2a49c32d4322 allow help to work with files containing only comments
John W. Eaton <jwe@octave.org>
parents: 8631
diff changeset
840 file = load_path::find_fcn_file (name);
2a49c32d4322 allow help to work with files containing only comments
John W. Eaton <jwe@octave.org>
parents: 8631
diff changeset
841 }
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
842
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
843 return file;
3355
c4983fc7318f [project @ 1999-11-18 05:20:50 by jwe]
jwe
parents: 3333
diff changeset
844 }
c4983fc7318f [project @ 1999-11-18 05:20:50 by jwe]
jwe
parents: 3333
diff changeset
845
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
846 std::string
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
847 do_which (const std::string& name)
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
848 {
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
849 std::string retval;
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
850
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
851 std::string type;
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
852
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
853 retval = do_which (name, type);
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
854
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
855 return retval;
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
856 }
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
857
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
858 DEFUN (__which__, args, ,
3361
4f40efa995c1 [project @ 1999-11-19 21:19:37 by jwe]
jwe
parents: 3356
diff changeset
859 "-*- texinfo -*-\n\
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
860 @deftypefn {Built-in Function} {} __which__ (@var{name}, @dots{})\n\
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
861 Undocumented internal function.\n\
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
862 @end deftypefn")
581
bc813f5eb025 [project @ 1994-08-07 01:02:15 by jwe]
jwe
parents: 572
diff changeset
863 {
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
864 octave_value retval;
581
bc813f5eb025 [project @ 1994-08-07 01:02:15 by jwe]
jwe
parents: 572
diff changeset
865
1968
a2e206524aa0 [project @ 1996-02-17 02:54:24 by jwe]
jwe
parents: 1957
diff changeset
866 string_vector argv = args.make_argv ("which");
1755
3a9462b655f1 [project @ 1996-01-22 04:47:22 by jwe]
jwe
parents: 1742
diff changeset
867
3355
c4983fc7318f [project @ 1999-11-18 05:20:50 by jwe]
jwe
parents: 3333
diff changeset
868 if (! error_state)
c4983fc7318f [project @ 1999-11-18 05:20:50 by jwe]
jwe
parents: 3333
diff changeset
869 {
c4983fc7318f [project @ 1999-11-18 05:20:50 by jwe]
jwe
parents: 3333
diff changeset
870 int argc = argv.length ();
581
bc813f5eb025 [project @ 1994-08-07 01:02:15 by jwe]
jwe
parents: 572
diff changeset
871
3355
c4983fc7318f [project @ 1999-11-18 05:20:50 by jwe]
jwe
parents: 3333
diff changeset
872 if (argc > 1)
581
bc813f5eb025 [project @ 1994-08-07 01:02:15 by jwe]
jwe
parents: 572
diff changeset
873 {
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
874 Octave_map m (dim_vector (1, argc-1));
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
875
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
876 Cell names (1, argc-1);
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
877 Cell files (1, argc-1);
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
878 Cell types (1, argc-1);
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
879
3355
c4983fc7318f [project @ 1999-11-18 05:20:50 by jwe]
jwe
parents: 3333
diff changeset
880 for (int i = 1; i < argc; i++)
581
bc813f5eb025 [project @ 1994-08-07 01:02:15 by jwe]
jwe
parents: 572
diff changeset
881 {
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
882 std::string name = argv[i];
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
883
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
884 std::string type;
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
885
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
886 std::string file = do_which (name, type);
3141
292ff0bf484b [project @ 1998-02-03 08:11:07 by jwe]
jwe
parents: 3018
diff changeset
887
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
888 names(i-1) = name;
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
889 files(i-1) = file;
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
890 types(i-1) = type;
581
bc813f5eb025 [project @ 1994-08-07 01:02:15 by jwe]
jwe
parents: 572
diff changeset
891 }
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
892
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
893 m.assign ("name", names);
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
894 m.assign ("file", files);
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
895 m.assign ("type", types);
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
896
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
897 retval = m;
581
bc813f5eb025 [project @ 1994-08-07 01:02:15 by jwe]
jwe
parents: 572
diff changeset
898 }
3355
c4983fc7318f [project @ 1999-11-18 05:20:50 by jwe]
jwe
parents: 3333
diff changeset
899 else
5823
080c08b192d8 [project @ 2006-05-19 05:32:17 by jwe]
jwe
parents: 5818
diff changeset
900 print_usage ();
581
bc813f5eb025 [project @ 1994-08-07 01:02:15 by jwe]
jwe
parents: 572
diff changeset
901 }
bc813f5eb025 [project @ 1994-08-07 01:02:15 by jwe]
jwe
parents: 572
diff changeset
902
bc813f5eb025 [project @ 1994-08-07 01:02:15 by jwe]
jwe
parents: 572
diff changeset
903 return retval;
bc813f5eb025 [project @ 1994-08-07 01:02:15 by jwe]
jwe
parents: 572
diff changeset
904 }
bc813f5eb025 [project @ 1994-08-07 01:02:15 by jwe]
jwe
parents: 572
diff changeset
905
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
906 // FIXME -- Are we sure this function always does the right thing?
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
907 inline bool
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
908 file_is_in_dir (const std::string filename, const std::string dir)
5447
051ddd7a6681 [project @ 2005-09-14 05:18:23 by jwe]
jwe
parents: 5399
diff changeset
909 {
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
910 if (filename.find (dir) == 0)
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
911 {
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
912 const int dir_len = dir.size ();
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
913 const int filename_len = filename.size ();
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
914 const int max_allowed_seps = file_ops::is_dir_sep (dir [dir_len-1]) ? 0 : 1;
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
915
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
916 int num_seps = 0;
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
917 for (int i = dir_len; i < filename_len; i++)
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
918 if (file_ops::is_dir_sep (filename [i]))
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
919 num_seps ++;
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
920
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
921 return (num_seps <= max_allowed_seps);
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
922 }
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
923 else
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
924 return false;
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
925 }
5447
051ddd7a6681 [project @ 2005-09-14 05:18:23 by jwe]
jwe
parents: 5399
diff changeset
926
8812
7d48766c21a5 use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents: 8672
diff changeset
927 // Return a cell array of strings containing the names of all
7d48766c21a5 use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents: 8672
diff changeset
928 // functions available in DIRECTORY. If no directory is given, search
7d48766c21a5 use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents: 8672
diff changeset
929 // the current path.
7d48766c21a5 use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents: 8672
diff changeset
930
7d48766c21a5 use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents: 8672
diff changeset
931 DEFUN (__list_functions__, args, ,
7d48766c21a5 use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents: 8672
diff changeset
932 "-*- texinfo -*-\n\
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
933 @deftypefn {Function File} {@var{retval} =} __list_functions__ ()\n\
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
934 @deftypefnx{Function File} {@var{retval} =} __list_functions__ (@var{directory})\n\
8812
7d48766c21a5 use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents: 8672
diff changeset
935 Undocumented internal function.\n\
7d48766c21a5 use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents: 8672
diff changeset
936 @end deftypefn")
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
937 {
8863
34a821854961 pkg.m (generate_lookfor_cache): generate a DOC file for each directory
Jason Riedy <jason@acm.org>
parents: 8861
diff changeset
938 octave_value retval;
5447
051ddd7a6681 [project @ 2005-09-14 05:18:23 by jwe]
jwe
parents: 5399
diff changeset
939
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
940 // Get list of functions
8863
34a821854961 pkg.m (generate_lookfor_cache): generate a DOC file for each directory
Jason Riedy <jason@acm.org>
parents: 8861
diff changeset
941 string_vector ffl = load_path::fcn_names ();
34a821854961 pkg.m (generate_lookfor_cache): generate a DOC file for each directory
Jason Riedy <jason@acm.org>
parents: 8861
diff changeset
942 string_vector afl = autoloaded_functions ();
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
943
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
944 if (args.length () == 0)
8863
34a821854961 pkg.m (generate_lookfor_cache): generate a DOC file for each directory
Jason Riedy <jason@acm.org>
parents: 8861
diff changeset
945 retval = Cell (ffl.append (afl));
5447
051ddd7a6681 [project @ 2005-09-14 05:18:23 by jwe]
jwe
parents: 5399
diff changeset
946 else
051ddd7a6681 [project @ 2005-09-14 05:18:23 by jwe]
jwe
parents: 5399
diff changeset
947 {
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
948 std::string dir = args (0).string_value ();
8863
34a821854961 pkg.m (generate_lookfor_cache): generate a DOC file for each directory
Jason Riedy <jason@acm.org>
parents: 8861
diff changeset
949
34a821854961 pkg.m (generate_lookfor_cache): generate a DOC file for each directory
Jason Riedy <jason@acm.org>
parents: 8861
diff changeset
950 if (! error_state)
34a821854961 pkg.m (generate_lookfor_cache): generate a DOC file for each directory
Jason Riedy <jason@acm.org>
parents: 8861
diff changeset
951 {
34a821854961 pkg.m (generate_lookfor_cache): generate a DOC file for each directory
Jason Riedy <jason@acm.org>
parents: 8861
diff changeset
952 string_vector fl = load_path::files (dir);
34a821854961 pkg.m (generate_lookfor_cache): generate a DOC file for each directory
Jason Riedy <jason@acm.org>
parents: 8861
diff changeset
953
34a821854961 pkg.m (generate_lookfor_cache): generate a DOC file for each directory
Jason Riedy <jason@acm.org>
parents: 8861
diff changeset
954 if (! error_state)
34a821854961 pkg.m (generate_lookfor_cache): generate a DOC file for each directory
Jason Riedy <jason@acm.org>
parents: 8861
diff changeset
955 retval = Cell (fl);
34a821854961 pkg.m (generate_lookfor_cache): generate a DOC file for each directory
Jason Riedy <jason@acm.org>
parents: 8861
diff changeset
956 }
5447
051ddd7a6681 [project @ 2005-09-14 05:18:23 by jwe]
jwe
parents: 5399
diff changeset
957 else
8863
34a821854961 pkg.m (generate_lookfor_cache): generate a DOC file for each directory
Jason Riedy <jason@acm.org>
parents: 8861
diff changeset
958 error ("__list_functions__: input must be a string");
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents: 8503
diff changeset
959 }
5447
051ddd7a6681 [project @ 2005-09-14 05:18:23 by jwe]
jwe
parents: 5399
diff changeset
960
051ddd7a6681 [project @ 2005-09-14 05:18:23 by jwe]
jwe
parents: 5399
diff changeset
961 return retval;
051ddd7a6681 [project @ 2005-09-14 05:18:23 by jwe]
jwe
parents: 5399
diff changeset
962 }
051ddd7a6681 [project @ 2005-09-14 05:18:23 by jwe]
jwe
parents: 5399
diff changeset
963
8861
31f864877246 doc and lookfor fixes
John W. Eaton <jwe@octave.org>
parents: 8812
diff changeset
964 DEFUN (doc_cache_file, args, nargout,
31f864877246 doc and lookfor fixes
John W. Eaton <jwe@octave.org>
parents: 8812
diff changeset
965 "-*- texinfo -*-\n\
31f864877246 doc and lookfor fixes
John W. Eaton <jwe@octave.org>
parents: 8812
diff changeset
966 @deftypefn {Built-in Function} {@var{val} =} doc_cache_file ()\n\
31f864877246 doc and lookfor fixes
John W. Eaton <jwe@octave.org>
parents: 8812
diff changeset
967 @deftypefnx {Built-in Function} {@var{old_val} =} doc_cache_file (@var{new_val})\n\
31f864877246 doc and lookfor fixes
John W. Eaton <jwe@octave.org>
parents: 8812
diff changeset
968 Query or set the internal variable that specifies the name of the\n\
31f864877246 doc and lookfor fixes
John W. Eaton <jwe@octave.org>
parents: 8812
diff changeset
969 Octave DOC file. The default value is @code{\"@var{octetcdir}/DOC\"}.\n\
31f864877246 doc and lookfor fixes
John W. Eaton <jwe@octave.org>
parents: 8812
diff changeset
970 @seealso{info_program, doc, help, makeinfo_program}\n\
31f864877246 doc and lookfor fixes
John W. Eaton <jwe@octave.org>
parents: 8812
diff changeset
971 @end deftypefn")
31f864877246 doc and lookfor fixes
John W. Eaton <jwe@octave.org>
parents: 8812
diff changeset
972 {
31f864877246 doc and lookfor fixes
John W. Eaton <jwe@octave.org>
parents: 8812
diff changeset
973 return SET_NONEMPTY_INTERNAL_STRING_VARIABLE (doc_cache_file);
31f864877246 doc and lookfor fixes
John W. Eaton <jwe@octave.org>
parents: 8812
diff changeset
974 }
31f864877246 doc and lookfor fixes
John W. Eaton <jwe@octave.org>
parents: 8812
diff changeset
975
5794
1138ced03f14 [project @ 2006-05-08 20:23:04 by jwe]
jwe
parents: 5780
diff changeset
976 DEFUN (info_file, args, nargout,
1138ced03f14 [project @ 2006-05-08 20:23:04 by jwe]
jwe
parents: 5780
diff changeset
977 "-*- texinfo -*-\n\
1138ced03f14 [project @ 2006-05-08 20:23:04 by jwe]
jwe
parents: 5780
diff changeset
978 @deftypefn {Built-in Function} {@var{val} =} info_file ()\n\
1138ced03f14 [project @ 2006-05-08 20:23:04 by jwe]
jwe
parents: 5780
diff changeset
979 @deftypefnx {Built-in Function} {@var{old_val} =} info_file (@var{new_val})\n\
1138ced03f14 [project @ 2006-05-08 20:23:04 by jwe]
jwe
parents: 5780
diff changeset
980 Query or set the internal variable that specifies the name of the\n\
1138ced03f14 [project @ 2006-05-08 20:23:04 by jwe]
jwe
parents: 5780
diff changeset
981 Octave info file. The default value is\n\
1138ced03f14 [project @ 2006-05-08 20:23:04 by jwe]
jwe
parents: 5780
diff changeset
982 @code{\"@var{octave-home}/info/octave.info\"}, in\n\
1138ced03f14 [project @ 2006-05-08 20:23:04 by jwe]
jwe
parents: 5780
diff changeset
983 which @var{octave-home} is the directory where all of Octave is installed.\n\
1138ced03f14 [project @ 2006-05-08 20:23:04 by jwe]
jwe
parents: 5780
diff changeset
984 @seealso{info_program, doc, help, makeinfo_program}\n\
1138ced03f14 [project @ 2006-05-08 20:23:04 by jwe]
jwe
parents: 5780
diff changeset
985 @end deftypefn")
2202
31b62b7c5d2d [project @ 1996-05-15 06:07:11 by jwe]
jwe
parents: 2189
diff changeset
986 {
5794
1138ced03f14 [project @ 2006-05-08 20:23:04 by jwe]
jwe
parents: 5780
diff changeset
987 return SET_NONEMPTY_INTERNAL_STRING_VARIABLE (info_file);
2202
31b62b7c5d2d [project @ 1996-05-15 06:07:11 by jwe]
jwe
parents: 2189
diff changeset
988 }
31b62b7c5d2d [project @ 1996-05-15 06:07:11 by jwe]
jwe
parents: 2189
diff changeset
989
5794
1138ced03f14 [project @ 2006-05-08 20:23:04 by jwe]
jwe
parents: 5780
diff changeset
990 DEFUN (info_program, args, nargout,
1138ced03f14 [project @ 2006-05-08 20:23:04 by jwe]
jwe
parents: 5780
diff changeset
991 "-*- texinfo -*-\n\
1138ced03f14 [project @ 2006-05-08 20:23:04 by jwe]
jwe
parents: 5780
diff changeset
992 @deftypefn {Built-in Function} {@var{val} =} info_program ()\n\
1138ced03f14 [project @ 2006-05-08 20:23:04 by jwe]
jwe
parents: 5780
diff changeset
993 @deftypefnx {Built-in Function} {@var{old_val} =} info_program (@var{new_val})\n\
1138ced03f14 [project @ 2006-05-08 20:23:04 by jwe]
jwe
parents: 5780
diff changeset
994 Query or set the internal variable that specifies the name of the\n\
7096
81bed50b9feb [project @ 2007-11-02 16:13:43 by jwe]
jwe
parents: 7082
diff changeset
995 info program to run. The default value is\n\
3686
9507d6de9bbd [project @ 2000-06-29 16:30:44 by jwe]
jwe
parents: 3584
diff changeset
996 @code{\"@var{octave-home}/libexec/octave/@var{version}/exec/@var{arch}/info\"}\n\
9507d6de9bbd [project @ 2000-06-29 16:30:44 by jwe]
jwe
parents: 3584
diff changeset
997 in which @var{octave-home} is the directory where all of Octave is\n\
9507d6de9bbd [project @ 2000-06-29 16:30:44 by jwe]
jwe
parents: 3584
diff changeset
998 installed, @var{version} is the Octave version number, and @var{arch}\n\
9507d6de9bbd [project @ 2000-06-29 16:30:44 by jwe]
jwe
parents: 3584
diff changeset
999 is the system type (for example, @code{i686-pc-linux-gnu}). The\n\
9507d6de9bbd [project @ 2000-06-29 16:30:44 by jwe]
jwe
parents: 3584
diff changeset
1000 default initial value may be overridden by the environment variable\n\
9507d6de9bbd [project @ 2000-06-29 16:30:44 by jwe]
jwe
parents: 3584
diff changeset
1001 @code{OCTAVE_INFO_PROGRAM}, or the command line argument\n\
5794
1138ced03f14 [project @ 2006-05-08 20:23:04 by jwe]
jwe
parents: 5780
diff changeset
1002 @code{--info-program NAME}.\n\
1138ced03f14 [project @ 2006-05-08 20:23:04 by jwe]
jwe
parents: 5780
diff changeset
1003 @seealso{info_file, doc, help, makeinfo_program}\n\
1138ced03f14 [project @ 2006-05-08 20:23:04 by jwe]
jwe
parents: 5780
diff changeset
1004 @end deftypefn")
1138ced03f14 [project @ 2006-05-08 20:23:04 by jwe]
jwe
parents: 5780
diff changeset
1005 {
1138ced03f14 [project @ 2006-05-08 20:23:04 by jwe]
jwe
parents: 5780
diff changeset
1006 return SET_NONEMPTY_INTERNAL_STRING_VARIABLE (info_program);
1138ced03f14 [project @ 2006-05-08 20:23:04 by jwe]
jwe
parents: 5780
diff changeset
1007 }
3686
9507d6de9bbd [project @ 2000-06-29 16:30:44 by jwe]
jwe
parents: 3584
diff changeset
1008
5794
1138ced03f14 [project @ 2006-05-08 20:23:04 by jwe]
jwe
parents: 5780
diff changeset
1009 DEFUN (makeinfo_program, args, nargout,
1138ced03f14 [project @ 2006-05-08 20:23:04 by jwe]
jwe
parents: 5780
diff changeset
1010 "-*- texinfo -*-\n\
1138ced03f14 [project @ 2006-05-08 20:23:04 by jwe]
jwe
parents: 5780
diff changeset
1011 @deftypefn {Built-in Function} {@var{val} =} makeinfo_program ()\n\
1138ced03f14 [project @ 2006-05-08 20:23:04 by jwe]
jwe
parents: 5780
diff changeset
1012 @deftypefnx {Built-in Function} {@var{old_val} =} makeinfo_program (@var{new_val})\n\
1138ced03f14 [project @ 2006-05-08 20:23:04 by jwe]
jwe
parents: 5780
diff changeset
1013 Query or set the internal variable that specifies the name of the\n\
1138ced03f14 [project @ 2006-05-08 20:23:04 by jwe]
jwe
parents: 5780
diff changeset
1014 makeinfo program that Octave runs to format help text containing\n\
1138ced03f14 [project @ 2006-05-08 20:23:04 by jwe]
jwe
parents: 5780
diff changeset
1015 Texinfo markup commands. The default initial value is @code{\"makeinfo\"}.\n\
1138ced03f14 [project @ 2006-05-08 20:23:04 by jwe]
jwe
parents: 5780
diff changeset
1016 @seealso{info_file, info_program, doc, help}\n\
1138ced03f14 [project @ 2006-05-08 20:23:04 by jwe]
jwe
parents: 5780
diff changeset
1017 @end deftypefn")
1138ced03f14 [project @ 2006-05-08 20:23:04 by jwe]
jwe
parents: 5780
diff changeset
1018 {
1138ced03f14 [project @ 2006-05-08 20:23:04 by jwe]
jwe
parents: 5780
diff changeset
1019 return SET_NONEMPTY_INTERNAL_STRING_VARIABLE (makeinfo_program);
1138ced03f14 [project @ 2006-05-08 20:23:04 by jwe]
jwe
parents: 5780
diff changeset
1020 }
2202
31b62b7c5d2d [project @ 1996-05-15 06:07:11 by jwe]
jwe
parents: 2189
diff changeset
1021
5794
1138ced03f14 [project @ 2006-05-08 20:23:04 by jwe]
jwe
parents: 5780
diff changeset
1022 DEFUN (suppress_verbose_help_message, args, nargout,
1138ced03f14 [project @ 2006-05-08 20:23:04 by jwe]
jwe
parents: 5780
diff changeset
1023 "-*- texinfo -*-\n\
1138ced03f14 [project @ 2006-05-08 20:23:04 by jwe]
jwe
parents: 5780
diff changeset
1024 @deftypefn {Built-in Function} {@var{val} =} suppress_verbose_help_message ()\n\
1138ced03f14 [project @ 2006-05-08 20:23:04 by jwe]
jwe
parents: 5780
diff changeset
1025 @deftypefnx {Built-in Function} {@var{old_val} =} suppress_verbose_help_message (@var{new_val})\n\
7001
8b0cfeb06365 [project @ 2007-10-10 18:02:59 by jwe]
jwe
parents: 6620
diff changeset
1026 Query or set the internal variable that controls whether Octave\n\
5794
1138ced03f14 [project @ 2006-05-08 20:23:04 by jwe]
jwe
parents: 5780
diff changeset
1027 will add additional help information to the end of the output from\n\
3332
7c03933635c6 [project @ 1999-11-02 06:57:12 by jwe]
jwe
parents: 3330
diff changeset
1028 the @code{help} command and usage messages for built-in commands.\n\
5794
1138ced03f14 [project @ 2006-05-08 20:23:04 by jwe]
jwe
parents: 5780
diff changeset
1029 @end deftypefn")
1138ced03f14 [project @ 2006-05-08 20:23:04 by jwe]
jwe
parents: 5780
diff changeset
1030 {
1138ced03f14 [project @ 2006-05-08 20:23:04 by jwe]
jwe
parents: 5780
diff changeset
1031 return SET_INTERNAL_VARIABLE (suppress_verbose_help_message);
2189
d01936305d99 [project @ 1996-05-14 03:31:57 by jwe]
jwe
parents: 2177
diff changeset
1032 }
d01936305d99 [project @ 1996-05-14 03:31:57 by jwe]
jwe
parents: 2177
diff changeset
1033
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
1034 /*
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
1035 ;;; Local Variables: ***
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
1036 ;;; mode: C++ ***
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
1037 ;;; End: ***
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
1038 */