Mercurial > octave-nkf
annotate src/help.cc @ 13741:b0e70a71647b stable release-3-4-3
Version 3.4.3 released.
* configure.ac (AC_INIT): Version number is now 3.4.3.
(OCTAVE_RELEASE_DATE): Update to 2011-10-10.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Mon, 10 Oct 2011 10:23:45 -0400 |
parents | f83ec5ab90ad |
children | d6151d774283 |
rev | line source |
---|---|
1 | 1 /* |
2 | |
11523 | 3 Copyright (C) 1993-2011 John W. Eaton |
1 | 4 |
5 This file is part of Octave. | |
6 | |
7 Octave is free software; you can redistribute it and/or modify it | |
8 under the terms of the GNU General Public License as published by the | |
7016 | 9 Free Software Foundation; either version 3 of the License, or (at your |
10 option) any later version. | |
1 | 11 |
12 Octave is distributed in the hope that it will be useful, but WITHOUT | |
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
15 for more details. | |
16 | |
17 You should have received a copy of the GNU General Public License | |
7016 | 18 along with Octave; see the file COPYING. If not, see |
19 <http://www.gnu.org/licenses/>. | |
1 | 20 |
21 */ | |
22 | |
240 | 23 #ifdef HAVE_CONFIG_H |
1192 | 24 #include <config.h> |
1 | 25 #endif |
26 | |
1343 | 27 #include <cstdlib> |
28 #include <cstring> | |
29 | |
5769 | 30 #include <algorithm> |
3503 | 31 #include <iostream> |
32 #include <fstream> | |
5765 | 33 #include <sstream> |
1755 | 34 #include <string> |
35 | |
1295 | 36 #include <sys/types.h> |
37 #include <unistd.h> | |
1343 | 38 |
3295 | 39 #include "cmd-edit.h" |
40 #include "file-ops.h" | |
6253 | 41 #include "file-stat.h" |
2926 | 42 #include "oct-env.h" |
1755 | 43 #include "str-vec.h" |
44 | |
2492 | 45 #include <defaults.h> |
1352 | 46 #include "defun.h" |
47 #include "dirfns.h" | |
48 #include "error.h" | |
2202 | 49 #include "gripes.h" |
1352 | 50 #include "help.h" |
2177 | 51 #include "input.h" |
5832 | 52 #include "load-path.h" |
1755 | 53 #include "oct-obj.h" |
2976 | 54 #include "ov-usr-fcn.h" |
1352 | 55 #include "pager.h" |
3018 | 56 #include "parse.h" |
1466 | 57 #include "pathsearch.h" |
3295 | 58 #include "procstream.h" |
7336 | 59 #include "pt-pr-code.h" |
529 | 60 #include "sighandlers.h" |
61 #include "symtab.h" | |
2694 | 62 #include "syswait.h" |
1755 | 63 #include "toplev.h" |
8672
2a49c32d4322
allow help to work with files containing only comments
John W. Eaton <jwe@octave.org>
parents:
8631
diff
changeset
|
64 #include "unwind-prot.h" |
242 | 65 #include "utils.h" |
1352 | 66 #include "variables.h" |
3301 | 67 #include "version.h" |
5447 | 68 #include "quit.h" |
529 | 69 |
8861 | 70 // Name of the doc cache file specified on the command line. |
71 // (--doc-cache-file file) | |
72 std::string Vdoc_cache_file; | |
73 | |
2202 | 74 // Name of the info file specified on command line. |
75 // (--info-file file) | |
3523 | 76 std::string Vinfo_file; |
2202 | 77 |
78 // Name of the info reader we'd like to use. | |
79 // (--info-program program) | |
5794 | 80 std::string Vinfo_program; |
2202 | 81 |
3686 | 82 // Name of the makeinfo program to run. |
5794 | 83 static std::string Vmakeinfo_program = "makeinfo"; |
3686 | 84 |
2189 | 85 // If TRUE, don't print additional help message in help and usage |
86 // functions. | |
5794 | 87 static bool Vsuppress_verbose_help_message = false; |
2189 | 88 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
89 #include <map> |
3016 | 90 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
91 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
|
92 typedef map_type::value_type pair_type; |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
93 typedef map_type::const_iterator map_iter; |
3016 | 94 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
95 template<typename T, std::size_t z> |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
96 std::size_t |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
97 size (T const (&)[z]) |
1 | 98 { |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
99 return z; |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
100 } |
1 | 101 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
102 const static pair_type operators[] = |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
103 { |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
104 pair_type ("!", |
12670
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
105 "-*- texinfo -*-\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
106 @deftypefn {Operator} {} !\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
107 Logical 'not' operator.\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
108 @seealso{~, not}\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
109 @end deftypefn"), |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
110 |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
111 pair_type ("~", |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
112 "-*- texinfo -*-\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
113 @deftypefn {Operator} {} ~\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
114 Logical 'not' operator.\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
115 @seealso{!, not}\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
116 @end deftypefn"), |
1 | 117 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
118 pair_type ("!=", |
12670
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
119 "-*- texinfo -*-\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
120 @deftypefn {Operator} {} !=\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
121 Logical 'not equals' operator.\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
122 @seealso{~=, ne}\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
123 @end deftypefn"), |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
124 |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
125 pair_type ("~=", |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
126 "-*- texinfo -*-\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
127 @deftypefn {Operator} {} ~=\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
128 Logical 'not equals' operator.\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
129 @seealso{!=, ne}\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
130 @end deftypefn"), |
1 | 131 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
132 pair_type ("\"", |
12670
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
133 "-*- texinfo -*-\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
134 @deftypefn {Operator} {} \"\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
135 String delimiter.\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
136 @end deftypefn"), |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
137 |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
138 pair_type ("#", |
12670
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
139 "-*- texinfo -*-\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
140 @deftypefn {Operator} {} #\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
141 Begin comment character.\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
142 @seealso{%, #@{}\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
143 @end deftypefn"), |
1 | 144 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
145 pair_type ("%", |
12670
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
146 "-*- texinfo -*-\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
147 @deftypefn {Operator} {} %\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
148 Begin comment character.\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
149 @seealso{#, %@{}\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
150 @end deftypefn"), |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
151 |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
152 pair_type ("#{", |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
153 "-*- texinfo -*-\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
154 @deftypefn {Operator} {} #@{\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
155 Begin block comment. There must be nothing else other than\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
156 whitespace in the line, both before and after @code{#@{}. Also,\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
157 it is possible to nest block comments.\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
158 @seealso{#, #@}, %@{}\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
159 @end deftypefn"), |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
160 |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
161 pair_type ("%{", |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
162 "-*- texinfo -*-\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
163 @deftypefn {Operator} {} %@{\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
164 Begin block comment. There must be nothing else other than\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
165 whitespace in the line, both before and after @code{%@{}. Also,\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
166 it is possible to nest block comments.\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
167 @seealso{%, %@}, #@{}\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
168 @end deftypefn"), |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
169 |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
170 pair_type ("#}", |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
171 "-*- texinfo -*-\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
172 @deftypefn {Operator} {} #@}\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
173 Close block comment. There must be nothing else other than\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
174 whitespace in the line, both before and after @code{#@}}. Also,\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
175 it is possible to nest block comments.\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
176 @seealso{#, #@{, %@}}\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
177 @end deftypefn"), |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
178 |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
179 pair_type ("%}", |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
180 "-*- texinfo -*-\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
181 @deftypefn {Operator} {} %@}\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
182 Close block comment. There must be nothing else other than\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
183 whitespace in the line, both before and after @code{%@}}. Also,\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
184 it is possible to nest block comments.\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
185 @seealso{%, %@{, #@}}\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
186 @end deftypefn"), |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
187 |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
188 pair_type ("...", |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
189 "-*- texinfo -*-\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
190 @deftypefn {Operator} {} ...\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
191 Continuation marker. Joins current line with following line.\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
192 @end deftypefn"), |
1 | 193 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
194 pair_type ("&", |
12670
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
195 "-*- texinfo -*-\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
196 @deftypefn {Operator} {} &\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
197 Element by element logical 'and' operator.\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
198 @seealso{&&, and}\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
199 @end deftypefn"), |
1 | 200 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
201 pair_type ("&&", |
12670
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
202 "-*- texinfo -*-\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
203 @deftypefn {Operator} {} &&\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
204 Logical 'and' operator (with short-circuit evaluation).\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
205 @seealso{&, and}\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
206 @end deftypefn"), |
1 | 207 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
208 pair_type ("'", |
12670
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
209 "-*- texinfo -*-\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
210 @deftypefn {Operator} {} '\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
211 Matrix transpose operator. For complex matrices, computes the\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
212 complex conjugate (Hermitian) transpose.\n\ |
1 | 213 \n\ |
214 The single quote character may also be used to delimit strings, but\n\ | |
215 it is better to use the double quote character, since that is never\n\ | |
12670
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
216 ambiguous\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
217 @seealso{.', transpose}\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
218 @end deftypefn"), |
1 | 219 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
220 pair_type ("(", |
12670
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
221 "-*- texinfo -*-\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
222 @deftypefn {Operator} {} (\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
223 Array index or function argument delimiter.\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
224 @end deftypefn"), |
1 | 225 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
226 pair_type (")", |
12670
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
227 "-*- texinfo -*-\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
228 @deftypefn {Operator} {} )\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
229 Array index or function argument delimiter.\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
230 @end deftypefn"), |
1 | 231 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
232 pair_type ("*", |
12670
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
233 "-*- texinfo -*-\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
234 @deftypefn {Operator} {} *\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
235 Multiplication operator.\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
236 @seealso{.*, times}\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
237 @end deftypefn"), |
1 | 238 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
239 pair_type ("**", |
12670
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
240 "-*- texinfo -*-\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
241 @deftypefn {Operator} {} **\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
242 Power operator.\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
243 @seealso{power, ^, .**, .^}\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
244 @end deftypefn"), |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
245 |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
246 pair_type ("^", |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
247 "-*- texinfo -*-\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
248 @deftypefn {Operator} {} ^\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
249 Power operator.\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
250 @seealso{power, **, .^, .**}\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
251 @end deftypefn"), |
1 | 252 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
253 pair_type ("+", |
12670
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
254 "-*- texinfo -*-\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
255 @deftypefn {Operator} {} +\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
256 Addition operator.\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
257 @seealso{plus}\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
258 @end deftypefn"), |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
259 |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
260 pair_type ("++", |
12670
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
261 "-*- texinfo -*-\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
262 @deftypefn {Operator} {} ++\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
263 Increment operator. As in C, may be applied as a prefix or postfix\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
264 operator.\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
265 @seealso{--}\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
266 @end deftypefn"), |
1 | 267 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
268 pair_type (",", |
12670
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
269 "-*- texinfo -*-\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
270 @deftypefn {Operator} {} ,\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
271 Array index, function argument, or command separator.\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
272 @end deftypefn"), |
1 | 273 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
274 pair_type ("-", |
12670
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
275 "-*- texinfo -*-\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
276 @deftypefn {Operator} {} -\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
277 Subtraction or unary negation operator.\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
278 @seealso{minus}\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
279 @end deftypefn"), |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
280 |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
281 pair_type ("--", |
12670
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
282 "-*- texinfo -*-\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
283 @deftypefn {Operator} {} --\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
284 Decrement operator. As in C, may be applied as a prefix or postfix\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
285 operator.\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
286 @seealso{++}\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
287 @end deftypefn"), |
1 | 288 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
289 pair_type (".'", |
12670
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
290 "-*- texinfo -*-\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
291 @deftypefn {Operator} {} .'\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
292 Matrix transpose operator. For complex matrices, computes the\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
293 transpose, @emph{not} the complex conjugate transpose.\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
294 @seealso{', transpose}\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
295 @end deftypefn"), |
1 | 296 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
297 pair_type (".*", |
12670
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
298 "-*- texinfo -*-\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
299 @deftypefn {Operator} {} .*\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
300 Element by element multiplication operator.\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
301 @seealso{*, times}\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
302 @end deftypefn"), |
1 | 303 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
304 pair_type (".**", |
12670
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
305 "-*- texinfo -*-\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
306 @deftypefn {Operator} {} .*\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
307 Element by element power operator.\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
308 @seealso{**, ^, .^, power}\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
309 @end deftypefn"), |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
310 |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
311 pair_type (".^", |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
312 "-*- texinfo -*-\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
313 @deftypefn {Operator} {} .^\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
314 Element by element power operator.\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
315 @seealso{.**, ^, **, power}\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
316 @end deftypefn"), |
1 | 317 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
318 pair_type ("./", |
12670
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
319 "-*- texinfo -*-\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
320 @deftypefn {Operator} {} ./\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
321 Element by element right division operator.\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
322 @seealso{/, .\\, rdivide, mrdivide}\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
323 @end deftypefn"), |
1 | 324 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
325 pair_type ("/", |
12670
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
326 "-*- texinfo -*-\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
327 @deftypefn {Operator} {} /\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
328 Right division operator.\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
329 @seealso{./, \\, rdivide, mrdivide}\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
330 @end deftypefn"), |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
331 |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
332 pair_type (".\\", |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
333 "-*- texinfo -*-\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
334 @deftypefn {Operator} {} .\\\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
335 Element by element left division operator.\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
336 @seealso{\\, ./, rdivide, mrdivide}\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
337 @end deftypefn"), |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
338 |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
339 pair_type ("\\", |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
340 "-*- texinfo -*-\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
341 @deftypefn {Operator} {} \\\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
342 Left division operator.\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
343 @seealso{.\\, /, ldivide, mldivide}\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
344 @end deftypefn"), |
1 | 345 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
346 pair_type (":", |
12670
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
347 "-*- texinfo -*-\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
348 @deftypefn {Operator} {} :\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
349 Select entire rows or columns of matrices.\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
350 @end deftypefn"), |
1 | 351 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
352 pair_type (";", |
12670
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
353 "-*- texinfo -*-\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
354 @deftypefn {Operator} {} ;\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
355 Array row or command separator.\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
356 @seealso{,}\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
357 @end deftypefn"), |
1 | 358 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
359 pair_type ("<", |
12670
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
360 "-*- texinfo -*-\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
361 @deftypefn {Operator} {} <\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
362 'Less than' operator.\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
363 @seealso{lt}\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
364 @end deftypefn"), |
1 | 365 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
366 pair_type ("<=", |
12670
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
367 "-*- texinfo -*-\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
368 @deftypefn {Operator} {} <=\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
369 'Less than' or 'equals' operator.\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
370 @seealso{le}\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
371 @end deftypefn"), |
1 | 372 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
373 pair_type ("=", |
12670
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
374 "-*- texinfo -*-\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
375 @deftypefn {Operator} {} =\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
376 Assignment operator.\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
377 @end deftypefn"), |
1 | 378 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
379 pair_type ("==", |
12670
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
380 "-*- texinfo -*-\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
381 @deftypefn {Operator} {} ==\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
382 Equality test operator.\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
383 @seealso{eq}\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
384 @end deftypefn"), |
1 | 385 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
386 pair_type (">", |
12670
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
387 "-*- texinfo -*-\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
388 @deftypefn {Operator} {} >\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
389 'Greater than' operator.\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
390 @seealso{gt}\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
391 @end deftypefn"), |
1 | 392 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
393 pair_type (">=", |
12670
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
394 "-*- texinfo -*-\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
395 @deftypefn {Operator} {} >=\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
396 'Greater than' or 'equals' operator.\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
397 @seealso{ge}\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
398 @end deftypefn"), |
1 | 399 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
400 pair_type ("[", |
12670
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
401 "-*- texinfo -*-\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
402 @deftypefn {Operator} {} [\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
403 Return list delimiter.\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
404 @seealso{]}\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
405 @end deftypefn"), |
1 | 406 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
407 pair_type ("]", |
12670
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
408 "-*- texinfo -*-\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
409 @deftypefn {Operator} {} ]\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
410 Return list delimiter.\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
411 @seealso{[}\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
412 @end deftypefn"), |
1 | 413 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
414 pair_type ("|", |
12670
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
415 "-*- texinfo -*-\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
416 @deftypefn {Operator} {} |\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
417 Element by element logical 'or' operator.\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
418 @seealso{||, or}\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
419 @end deftypefn"), |
1 | 420 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
421 pair_type ("||", |
12670
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
422 "-*- texinfo -*-\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
423 @deftypefn {Operator} {} ||\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
424 Logical 'or' (with short-circuit evaluation) operator.\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
425 @seealso{|, or}\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
426 @end deftypefn"), |
1 | 427 }; |
428 | |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
429 const static pair_type keywords[] = |
1 | 430 { |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
431 pair_type ("break", |
5818 | 432 "-*- texinfo -*-\n\ |
11547 | 433 @deftypefn {Keyword} {} break\n\ |
5818 | 434 Exit the innermost enclosing do, while or for loop.\n\ |
435 @seealso{do, while, for, continue}\n\ | |
11547 | 436 @end deftypefn"), |
5040 | 437 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
438 pair_type ("case", |
5818 | 439 "-*- texinfo -*-\n\ |
11547 | 440 @deftypefn {Keyword} {} case @{@var{value}@}\n\ |
9064
7c02ec148a3c
Check grammar on all .cc files
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
441 A case statement in an switch. Octave cases are exclusive and do not\n\ |
7c02ec148a3c
Check grammar on all .cc files
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
442 fall-through as do C-language cases. A switch statement must have at least\n\ |
5818 | 443 one case. See @code{switch} for an example.\n\ |
444 @seealso{switch}\n\ | |
11547 | 445 @end deftypefn"), |
1 | 446 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
447 pair_type ("catch", |
5818 | 448 "-*- texinfo -*-\n\ |
11547 | 449 @deftypefn {Keyword} {} catch\n\ |
5818 | 450 Begin the cleanup part of a try-catch block.\n\ |
451 @seealso{try}\n\ | |
11547 | 452 @end deftypefn"), |
1489 | 453 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
454 pair_type ("continue", |
5818 | 455 "-*- texinfo -*-\n\ |
11547 | 456 @deftypefn {Keyword} {} continue\n\ |
5818 | 457 Jump to the end of the innermost enclosing do, while or for loop.\n\ |
458 @seealso{do, while, for, break}\n\ | |
11547 | 459 @end deftypefn"), |
5040 | 460 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
461 pair_type ("do", |
5818 | 462 "-*- texinfo -*-\n\ |
11547 | 463 @deftypefn {Keyword} {} do\n\ |
9064
7c02ec148a3c
Check grammar on all .cc files
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
464 Begin a do-until loop. This differs from a do-while loop in that the\n\ |
5818 | 465 body of the loop is executed at least once.\n\ |
466 @seealso{while}\n\ | |
11547 | 467 @end deftypefn"), |
1 | 468 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
469 pair_type ("else", |
5818 | 470 "-*- texinfo -*-\n\ |
11547 | 471 @deftypefn {Keyword} {} else\n\ |
5818 | 472 Alternate action for an if block. See @code{if} for an example.\n\ |
473 @seealso{if}\n\ | |
11547 | 474 @end deftypefn"), |
1 | 475 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
476 pair_type ("elseif", |
5818 | 477 "-*- texinfo -*-\n\ |
11547 | 478 @deftypefn {Keyword} {} elseif (@var{condition})\n\ |
5818 | 479 Alternate conditional test for an if block. See @code{if} for an example.\n\ |
480 @seealso{if}\n\ | |
11547 | 481 @end deftypefn"), |
1 | 482 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
483 pair_type ("end", |
5818 | 484 "-*- texinfo -*-\n\ |
11547 | 485 @deftypefn {Keyword} {} end\n\ |
10840 | 486 Mark the end of any @code{for}, @code{if}, @code{do}, @code{while}, or\n\ |
487 @code{function} block.\n\ | |
5818 | 488 @seealso{for, if, do, while, function}\n\ |
11547 | 489 @end deftypefn"), |
928 | 490 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
491 pair_type ("end_try_catch", |
5818 | 492 "-*- texinfo -*-\n\ |
11547 | 493 @deftypefn {Keyword} {} end_try_catch\n\ |
5818 | 494 Mark the end of an @code{try-catch} block.\n\ |
495 @seealso{try, catch}\n\ | |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11572
diff
changeset
|
496 @end deftypefn"), |
1489 | 497 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
498 pair_type ("end_unwind_protect", |
5818 | 499 "-*- texinfo -*-\n\ |
11547 | 500 @deftypefn {Keyword} {} end_unwind_protect\n\ |
5818 | 501 Mark the end of an unwind_protect block.\n\ |
502 @seealso{unwind_protect}\n\ | |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11572
diff
changeset
|
503 @end deftypefn"), |
1 | 504 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
505 pair_type ("endfor", |
5818 | 506 "-*- texinfo -*-\n\ |
11547 | 507 @deftypefn {Keyword} {} endfor\n\ |
5818 | 508 Mark the end of a for loop. See @code{for} for an example.\n\ |
509 @seealso{for}\n\ | |
11547 | 510 @end deftypefn"), |
1 | 511 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
512 pair_type ("endfunction", |
5818 | 513 "-*- texinfo -*-\n\ |
11547 | 514 @deftypefn {Keyword} {} endfunction\n\ |
5818 | 515 Mark the end of a function.\n\ |
516 @seealso{function}\n\ | |
11547 | 517 @end deftypefn"), |
1 | 518 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
519 pair_type ("endif", |
5818 | 520 "-*- texinfo -*-\n\ |
11547 | 521 @deftypefn {Keyword} {} endif\n\ |
5818 | 522 Mark the end of an if block. See @code{if} for an example.\n\ |
523 @seealso{if}\n\ | |
11547 | 524 @end deftypefn"), |
1 | 525 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
526 pair_type ("endswitch", |
5818 | 527 "-*- texinfo -*-\n\ |
11547 | 528 @deftypefn {Keyword} {} endswitch\n\ |
5818 | 529 Mark the end of a switch block. See @code{switch} for an example.\n\ |
530 @seealso{switch}\n\ | |
11547 | 531 @end deftypefn"), |
5122 | 532 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
533 pair_type ("endwhile", |
5818 | 534 "-*- texinfo -*-\n\ |
11547 | 535 @deftypefn {Keyword} {} endwhile\n\ |
5818 | 536 Mark the end of a while loop. See @code{while} for an example.\n\ |
537 @seealso{do, while}\n\ | |
11547 | 538 @end deftypefn"), |
1 | 539 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
540 pair_type ("for", |
5818 | 541 "-*- texinfo -*-\n\ |
11547 | 542 @deftypefn {Keyword} {} for @var{i} = @var{range}\n\ |
5818 | 543 Begin a for loop.\n\ |
10840 | 544 \n\ |
5818 | 545 @example\n\ |
9064
7c02ec148a3c
Check grammar on all .cc files
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
546 @group\n\ |
5818 | 547 for i = 1:10\n\ |
548 i\n\ | |
549 endfor\n\ | |
9064
7c02ec148a3c
Check grammar on all .cc files
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
550 @end group\n\ |
5818 | 551 @end example\n\ |
552 @seealso{do, while}\n\ | |
11547 | 553 @end deftypefn"), |
1 | 554 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
555 pair_type ("function", |
5818 | 556 "-*- texinfo -*-\n\ |
12605
307e177dbaa8
doc: Add spaces after commas in @seealso blocks.
Rik <octave@nomad.inbox5.com>
parents:
12519
diff
changeset
|
557 @deftypefn {Keyword} {} function @var{outputs} = function (@var{input}, @dots{})\n\ |
11547 | 558 @deftypefnx {Keyword} {} function {} function (@var{input}, @dots{})\n\ |
559 @deftypefnx {Keyword} {} function @var{outputs} = function\n\ | |
5818 | 560 Begin a function body with @var{outputs} as results and @var{inputs} as\n\ |
561 parameters.\n\ | |
562 @seealso{return}\n\ | |
11547 | 563 @end deftypefn"), |
1 | 564 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
565 pair_type ("global", |
5818 | 566 "-*- texinfo -*-\n\ |
11547 | 567 @deftypefn {Keyword} {} global\n\ |
5818 | 568 Declare variables to have global scope.\n\ |
10840 | 569 \n\ |
5818 | 570 @example\n\ |
9064
7c02ec148a3c
Check grammar on all .cc files
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
571 @group\n\ |
5818 | 572 global @var{x};\n\ |
573 if isempty (@var{x})\n\ | |
574 x = 1;\n\ | |
575 endif\n\ | |
9064
7c02ec148a3c
Check grammar on all .cc files
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
576 @end group\n\ |
5818 | 577 @end example\n\ |
578 @seealso{persistent}\n\ | |
11547 | 579 @end deftypefn"), |
1 | 580 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
581 pair_type ("if", |
5393 | 582 "-*- texinfo -*-\n\ |
12605
307e177dbaa8
doc: Add spaces after commas in @seealso blocks.
Rik <octave@nomad.inbox5.com>
parents:
12519
diff
changeset
|
583 @deftypefn {Keyword} {} if (@var{cond}) @dots{} endif\n\ |
11547 | 584 @deftypefnx {Keyword} {} if (@var{cond}) @dots{} else @dots{} endif\n\ |
585 @deftypefnx {Keyword} {} if (@var{cond}) @dots{} elseif (@var{cond}) @dots{} endif\n\ | |
586 @deftypefnx {Keyword} {} if (@var{cond}) @dots{} elseif (@var{cond}) @dots{} else @dots{} endif\n\ | |
5393 | 587 Begin an if block.\n\ |
10840 | 588 \n\ |
5818 | 589 @example\n\ |
9064
7c02ec148a3c
Check grammar on all .cc files
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
590 @group\n\ |
5818 | 591 x = 1;\n\ |
592 if (x == 1)\n\ | |
593 disp (\"one\");\n\ | |
594 elseif (x == 2)\n\ | |
595 disp (\"two\");\n\ | |
596 else\n\ | |
597 disp (\"not one or two\");\n\ | |
598 endif\n\ | |
9064
7c02ec148a3c
Check grammar on all .cc files
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
599 @end group\n\ |
5818 | 600 @end example\n\ |
5646 | 601 @seealso{switch}\n\ |
11547 | 602 @end deftypefn"), |
1 | 603 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
604 pair_type ("otherwise", |
5818 | 605 "-*- texinfo -*-\n\ |
11547 | 606 @deftypefn {Keyword} {} otherwise\n\ |
5818 | 607 The default statement in a switch block (similar to else in an if block).\n\ |
608 @seealso{switch}\n\ | |
11547 | 609 @end deftypefn"), |
5040 | 610 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
611 pair_type ("persistent", |
5818 | 612 "-*- texinfo -*-\n\ |
11547 | 613 @deftypefn {Keyword} {} persistent @var{var}\n\ |
5818 | 614 Declare variables as persistent. A variable that has been declared\n\ |
5623 | 615 persistent within a function will retain its contents in memory between\n\ |
616 subsequent calls to the same function. The difference between persistent\n\ | |
5818 | 617 variables and global variables is that persistent variables are local in \n\ |
618 scope to a particular function and are not visible elsewhere.\n\ | |
619 @seealso{global}\n\ | |
11547 | 620 @end deftypefn"), |
4686 | 621 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
622 pair_type ("replot", |
5818 | 623 "-*- texinfo -*-\n\ |
11547 | 624 @deftypefn {Keyword} {} replot\n\ |
5818 | 625 Replot a graphic.\n\ |
626 @seealso{plot}\n\ | |
11547 | 627 @end deftypefn"), |
5040 | 628 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
629 pair_type ("return", |
5818 | 630 "-*- texinfo -*-\n\ |
11547 | 631 @deftypefn {Keyword} {} return\n\ |
5818 | 632 Return from a function.\n\ |
633 @seealso{function}\n\ | |
11547 | 634 @end deftypefn"), |
928 | 635 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
636 pair_type ("static", |
5818 | 637 "-*- texinfo -*-\n\ |
11547 | 638 @deftypefn {Keyword} {} static\n\ |
5818 | 639 This function has been deprecated in favor of persistent.\n\ |
640 @seealso{persistent}\n\ | |
11547 | 641 @end deftypefn"), |
5040 | 642 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
643 pair_type ("switch", |
5818 | 644 "-*- texinfo -*-\n\ |
11547 | 645 @deftypefn {Keyword} {} switch @var{statement}\n\ |
5818 | 646 Begin a switch block.\n\ |
10840 | 647 \n\ |
5818 | 648 @example\n\ |
9064
7c02ec148a3c
Check grammar on all .cc files
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
649 @group\n\ |
5818 | 650 yesno = \"yes\"\n\ |
651 \n\ | |
652 switch yesno\n\ | |
5832 | 653 case @{\"Yes\" \"yes\" \"YES\" \"y\" \"Y\"@}\n\ |
5818 | 654 value = 1;\n\ |
5832 | 655 case @{\"No\" \"no\" \"NO\" \"n\" \"N\"@}\n\ |
5818 | 656 value = 0;\n\ |
657 otherwise\n\ | |
658 error (\"invalid value\");\n\ | |
659 endswitch\n\ | |
9064
7c02ec148a3c
Check grammar on all .cc files
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
660 @end group\n\ |
5818 | 661 @end example\n\ |
662 @seealso{if, case, otherwise}\n\ | |
11547 | 663 @end deftypefn"), |
5040 | 664 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
665 pair_type ("try", |
5818 | 666 "-*- texinfo -*-\n\ |
11547 | 667 @deftypefn {Keyword} {} try\n\ |
5818 | 668 Begin a try-catch block.\n\ |
6138 | 669 \n\ |
670 If an error occurs within a try block, then the catch code will be run and\n\ | |
671 execution will proceed after the catch block (though it is often\n\ | |
672 recommended to use the lasterr function to re-throw the error after cleanup\n\ | |
673 is completed).\n\ | |
12605
307e177dbaa8
doc: Add spaces after commas in @seealso blocks.
Rik <octave@nomad.inbox5.com>
parents:
12519
diff
changeset
|
674 @seealso{catch, unwind_protect}\n\ |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11572
diff
changeset
|
675 @end deftypefn"), |
1489 | 676 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
677 pair_type ("until", |
5818 | 678 "-*- texinfo -*-\n\ |
11547 | 679 @deftypefn {Keyword} {} until\n\ |
5818 | 680 End a do-until loop.\n\ |
681 @seealso{do}\n\ | |
11547 | 682 @end deftypefn"), |
5040 | 683 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
684 pair_type ("unwind_protect", |
5818 | 685 "-*- texinfo -*-\n\ |
11547 | 686 @deftypefn {Keyword} {} unwind_protect\n\ |
5818 | 687 Begin an unwind_protect block.\n\ |
6138 | 688 \n\ |
689 If an error occurs within the first part of an unwind_protect block\n\ | |
690 the commands within the unwind_protect_cleanup block are executed before\n\ | |
691 the error is thrown. If an error is not thrown, then the\n\ | |
692 unwind_protect_cleanup block is still executed (in other words, the\n\ | |
693 unwind_protect_cleanup will be run with or without an error in the\n\ | |
694 unwind_protect block).\n\ | |
12605
307e177dbaa8
doc: Add spaces after commas in @seealso blocks.
Rik <octave@nomad.inbox5.com>
parents:
12519
diff
changeset
|
695 @seealso{unwind_protect_cleanup, try}\n\ |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11572
diff
changeset
|
696 @end deftypefn"), |
928 | 697 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
698 pair_type ("unwind_protect_cleanup", |
5818 | 699 "-*- texinfo -*-\n\ |
11547 | 700 @deftypefn {Keyword} {} unwind_protect_cleanup\n\ |
5818 | 701 Begin the cleanup section of an unwind_protect block.\n\ |
702 @seealso{unwind_protect}\n\ | |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11572
diff
changeset
|
703 @end deftypefn"), |
1 | 704 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
705 pair_type ("varargin", |
5818 | 706 "-*- texinfo -*-\n\ |
11547 | 707 @deftypefn {Keyword} {} varargin\n\ |
5818 | 708 Pass an arbitrary number of arguments into a function.\n\ |
709 @seealso{varargout, nargin, nargout}\n\ | |
11547 | 710 @end deftypefn"), |
5040 | 711 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
712 pair_type ("varargout", |
5818 | 713 "-*- texinfo -*-\n\ |
11547 | 714 @deftypefn {Keyword} {} varargout\n\ |
5818 | 715 Pass an arbitrary number of arguments out of a function.\n\ |
716 @seealso{varargin, nargin, nargout}\n\ | |
11547 | 717 @end deftypefn"), |
5040 | 718 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
719 pair_type ("while", |
5818 | 720 "-*- texinfo -*-\n\ |
11547 | 721 @deftypefn {Keyword} {} while\n\ |
5818 | 722 Begin a while loop.\n\ |
723 @seealso{do}\n\ | |
11547 | 724 @end deftypefn"), |
1 | 725 }; |
726 | |
581 | 727 // Return a copy of the operator or keyword names. |
3016 | 728 static string_vector |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
729 names (const map_type& lst) |
1 | 730 { |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
731 string_vector retval (lst.size ()); |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
732 int j = 0; |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
733 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
|
734 retval [j++] = iter->first; |
1755 | 735 return retval; |
1 | 736 } |
737 | |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
738 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
|
739 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
|
740 const static string_vector keyword_names = names (keywords_map); |
1 | 741 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
742 // FIXME -- It's not likely that this does the right thing now. |
3016 | 743 |
744 string_vector | |
745 make_name_list (void) | |
746 { | |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
747 const int key_len = keyword_names.length (); |
3016 | 748 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
749 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
|
750 const int bif_len = bif.length (); |
4009 | 751 |
10500
8f27f368aba2
fix generating names for TAB completion
Jaroslav Hajek <highegg@gmail.com>
parents:
10315
diff
changeset
|
752 const string_vector lcl = symbol_table::variable_names (); |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
753 const int lcl_len = lcl.length (); |
3016 | 754 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
755 const string_vector ffl = load_path::fcn_names (); |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
756 const int ffl_len = ffl.length (); |
3016 | 757 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
758 const string_vector afl = autoloaded_functions (); |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
759 const int afl_len = afl.length (); |
5592 | 760 |
10500
8f27f368aba2
fix generating names for TAB completion
Jaroslav Hajek <highegg@gmail.com>
parents:
10315
diff
changeset
|
761 const int total_len = key_len + bif_len + lcl_len + ffl_len + afl_len; |
3016 | 762 |
763 string_vector list (total_len); | |
764 | |
765 // Put all the symbols in one big list. | |
766 | |
767 int j = 0; | |
768 int i = 0; | |
769 for (i = 0; i < key_len; i++) | |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
770 list[j++] = keyword_names[i]; |
3016 | 771 |
7336 | 772 for (i = 0; i < bif_len; i++) |
773 list[j++] = bif[i]; | |
4009 | 774 |
3016 | 775 for (i = 0; i < lcl_len; i++) |
776 list[j++] = lcl[i]; | |
777 | |
778 for (i = 0; i < ffl_len; i++) | |
779 list[j++] = ffl[i]; | |
780 | |
5592 | 781 for (i = 0; i < afl_len; i++) |
782 list[j++] = afl[i]; | |
783 | |
3016 | 784 return list; |
785 } | |
786 | |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
787 static bool |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
788 looks_like_html (const std::string& msg) |
3014 | 789 { |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
790 const size_t p1 = msg.find ('\n'); |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
791 std::string t = msg.substr (0, p1); |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
792 const size_t p2 = t.find ("<html"); // FIXME: this comparison should be case-insensitive |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11572
diff
changeset
|
793 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
794 return (p2 != std::string::npos); |
2470 | 795 } |
3014 | 796 |
797 static bool | |
3523 | 798 looks_like_texinfo (const std::string& msg, size_t& p1) |
3295 | 799 { |
800 p1 = msg.find ('\n'); | |
801 | |
3523 | 802 std::string t = msg.substr (0, p1); |
3295 | 803 |
8021 | 804 if (p1 == std::string::npos) |
3295 | 805 p1 = 0; |
806 | |
807 size_t p2 = t.find ("-*- texinfo -*-"); | |
808 | |
8021 | 809 return (p2 != std::string::npos); |
3295 | 810 } |
811 | |
3355 | 812 static bool |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11572
diff
changeset
|
813 raw_help_from_symbol_table (const std::string& nm, std::string& h, |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
814 std::string& w, bool& symbol_found) |
3355 | 815 { |
816 bool retval = false; | |
817 | |
7336 | 818 octave_value val = symbol_table::find_function (nm); |
3355 | 819 |
7336 | 820 if (val.is_defined ()) |
3355 | 821 { |
7336 | 822 octave_function *fcn = val.function_value (); |
823 | |
824 if (fcn) | |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
825 { |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
826 symbol_found = true; |
5399 | 827 |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
828 h = fcn->doc_string (); |
7336 | 829 |
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
|
830 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
|
831 |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
832 w = fcn->fcn_file_name (); |
6243 | 833 |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
834 if (w.empty ()) |
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
|
835 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
|
836 ? "command-line function" : "built-in function"; |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
837 } |
6243 | 838 } |
3355 | 839 |
6243 | 840 return retval; |
841 } | |
842 | |
843 static bool | |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11572
diff
changeset
|
844 raw_help_from_file (const std::string& nm, std::string& h, |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
845 std::string& file, bool& symbol_found) |
6243 | 846 { |
847 bool retval = false; | |
848 | |
8672
2a49c32d4322
allow help to work with files containing only comments
John W. Eaton <jwe@octave.org>
parents:
8631
diff
changeset
|
849 // FIXME -- this is a bit of a kluge... |
10066
2cd940306a06
make unwind_protect frames local
Jaroslav Hajek <highegg@gmail.com>
parents:
9806
diff
changeset
|
850 unwind_protect frame; |
2cd940306a06
make unwind_protect frames local
Jaroslav Hajek <highegg@gmail.com>
parents:
9806
diff
changeset
|
851 frame.protect_var (reading_script_file); |
8672
2a49c32d4322
allow help to work with files containing only comments
John W. Eaton <jwe@octave.org>
parents:
8631
diff
changeset
|
852 reading_script_file = true; |
2a49c32d4322
allow help to work with files containing only comments
John W. Eaton <jwe@octave.org>
parents:
8631
diff
changeset
|
853 |
6243 | 854 h = get_help_from_file (nm, symbol_found, file); |
855 | |
856 if (h.length () > 0) | |
857 retval = true; | |
858 | |
859 return retval; | |
860 } | |
861 | |
862 static bool | |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11572
diff
changeset
|
863 raw_help_from_map (const std::string& nm, std::string& h, |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
864 const map_type& map, bool& symbol_found) |
3355 | 865 { |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
866 map_iter idx = map.find (nm); |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
867 symbol_found = (idx != map.end ()); |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
868 h = (symbol_found) ? idx->second : ""; |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
869 return symbol_found; |
3355 | 870 } |
871 | |
6243 | 872 std::string |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
873 raw_help (const std::string& nm, bool& symbol_found) |
6243 | 874 { |
875 std::string h; | |
876 std::string w; | |
877 std::string f; | |
878 | |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
879 (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
|
880 || 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
|
881 || 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
|
882 || raw_help_from_map (nm, h, keywords_map, symbol_found)); |
6243 | 883 |
884 return h; | |
885 } | |
886 | |
1140 | 887 static void |
9806
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
888 do_get_help_text (const std::string& name, std::string& text, |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
889 std::string& format) |
1140 | 890 { |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
891 bool symbol_found = false; |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
892 text = raw_help (name, symbol_found); |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11572
diff
changeset
|
893 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
894 format = "Not found"; |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
895 if (symbol_found) |
1140 | 896 { |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
897 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
|
898 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
|
899 { |
52956d669506
Display sensible error message when the help text of an undocumented function is requested
Soren Hauberg <hauberg@gmail.com>
parents:
8630
diff
changeset
|
900 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
|
901 } |
52956d669506
Display sensible error message when the help text of an undocumented function is requested
Soren Hauberg <hauberg@gmail.com>
parents:
8630
diff
changeset
|
902 else if (looks_like_texinfo (text, idx)) |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
903 { |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
904 format = "texinfo"; |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
905 text.erase (0, idx); |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
906 } |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
907 else if (looks_like_html (text)) |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
908 { |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
909 format = "html"; |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
910 } |
5399 | 911 else |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
912 { |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
913 format = "plain text"; |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
914 } |
1140 | 915 } |
916 } | |
917 | |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
918 DEFUN (get_help_text, args, , "-*- texinfo -*-\n\ |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
919 @deftypefn {Loadable Function} {[@var{text}, @var{format}] =} get_help_text (@var{name})\n\ |
12519
91ccd08fe80c
Add gen_doc_cache, get_help_text, get_help_text_from_file, get_first_help_sentence to documentation.
Rik <octave@nomad.inbox5.com>
parents:
12483
diff
changeset
|
920 Return the raw help text of function @var{name}.\n\ |
3168 | 921 \n\ |
12519
91ccd08fe80c
Add gen_doc_cache, get_help_text, get_help_text_from_file, get_first_help_sentence to documentation.
Rik <octave@nomad.inbox5.com>
parents:
12483
diff
changeset
|
922 The raw help text is returned in @var{text} and the format in @var{format}\n\ |
91ccd08fe80c
Add gen_doc_cache, get_help_text, get_help_text_from_file, get_first_help_sentence to documentation.
Rik <octave@nomad.inbox5.com>
parents:
12483
diff
changeset
|
923 The format is a string which is one of @t{\"texinfo\"}, @t{\"html\"}, or\n\ |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
924 @t{\"plain text\"}.\n\ |
8812
7d48766c21a5
use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents:
8672
diff
changeset
|
925 @end deftypefn") |
529 | 926 { |
2086 | 927 octave_value_list retval; |
529 | 928 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
929 if (args.length () == 1) |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
930 { |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
931 const std::string name = args (0).string_value (); |
1755 | 932 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
933 if (! error_state) |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
934 { |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
935 std::string text; |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
936 std::string format; |
529 | 937 |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
938 do_get_help_text (name, text, format); |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11572
diff
changeset
|
939 |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
940 retval(1) = format; |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
941 retval(0) = text; |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
942 } |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
943 else |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
944 error ("get_help_text: invalid input"); |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
945 } |
529 | 946 else |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
947 print_usage (); |
529 | 948 |
949 return retval; | |
950 } | |
951 | |
9806
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
952 static void |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
953 do_get_help_text_from_file (const std::string& fname, std::string& text, |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
954 std::string& format) |
9806
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
955 { |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
956 bool symbol_found = false; |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
957 |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
958 std::string f; |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
959 |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
960 raw_help_from_file (fname, text, f, symbol_found); |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
961 |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
962 format = "Not found"; |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
963 if (symbol_found) |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
964 { |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
965 size_t idx = -1; |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
966 if (text.empty ()) |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
967 { |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
968 format = "Not documented"; |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
969 } |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
970 else if (looks_like_texinfo (text, idx)) |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
971 { |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
972 format = "texinfo"; |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
973 text.erase (0, idx); |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
974 } |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
975 else if (looks_like_html (text)) |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
976 { |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
977 format = "html"; |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
978 } |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
979 else |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
980 { |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
981 format = "plain text"; |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
982 } |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
983 } |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
984 } |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
985 |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
986 DEFUN (get_help_text_from_file, args, , |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
987 "-*- texinfo -*-\n\ |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
988 @deftypefn {Loadable Function} {[@var{text}, @var{format}] =} get_help_text_from_file (@var{fname})\n\ |
12519
91ccd08fe80c
Add gen_doc_cache, get_help_text, get_help_text_from_file, get_first_help_sentence to documentation.
Rik <octave@nomad.inbox5.com>
parents:
12483
diff
changeset
|
989 Return the raw help text from the file @var{fname}.\n\ |
9806
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
990 \n\ |
12519
91ccd08fe80c
Add gen_doc_cache, get_help_text, get_help_text_from_file, get_first_help_sentence to documentation.
Rik <octave@nomad.inbox5.com>
parents:
12483
diff
changeset
|
991 The raw help text is returned in @var{text} and the format in @var{format}\n\ |
91ccd08fe80c
Add gen_doc_cache, get_help_text, get_help_text_from_file, get_first_help_sentence to documentation.
Rik <octave@nomad.inbox5.com>
parents:
12483
diff
changeset
|
992 The format is a string which is one of @t{\"texinfo\"}, @t{\"html\"}, or\n\ |
9806
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
993 @t{\"plain text\"}.\n\ |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
994 @end deftypefn") |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
995 { |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
996 octave_value_list retval; |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
997 |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
998 if (args.length () == 1) |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
999 { |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
1000 const std::string fname = args(0).string_value (); |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
1001 |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
1002 if (! error_state) |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
1003 { |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
1004 std::string text; |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
1005 std::string format; |
9806
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
1006 |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
1007 do_get_help_text_from_file (fname, text, format); |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11572
diff
changeset
|
1008 |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
1009 retval(1) = format; |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
1010 retval(0) = text; |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
1011 } |
9806
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
1012 else |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
1013 error ("get_help_text_from_file: invalid input"); |
9806
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
1014 } |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
1015 else |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
1016 print_usage (); |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
1017 |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
1018 return retval; |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
1019 } |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
1020 |
8812
7d48766c21a5
use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents:
8672
diff
changeset
|
1021 // 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
|
1022 // operators. |
7d48766c21a5
use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents:
8672
diff
changeset
|
1023 |
7d48766c21a5
use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents:
8672
diff
changeset
|
1024 DEFUN (__operators__, , , |
7d48766c21a5
use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents:
8672
diff
changeset
|
1025 "-*- texinfo -*-\n\ |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1026 @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
|
1027 Undocumented internal function.\n\ |
7d48766c21a5
use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents:
8672
diff
changeset
|
1028 @end deftypefn") |
3355 | 1029 { |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1030 return octave_value (Cell (names (operators_map))); |
3355 | 1031 } |
1032 | |
8812
7d48766c21a5
use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents:
8672
diff
changeset
|
1033 // 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
|
1034 // keywords. |
7d48766c21a5
use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents:
8672
diff
changeset
|
1035 |
7d48766c21a5
use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents:
8672
diff
changeset
|
1036 DEFUN (__keywords__, , , |
7d48766c21a5
use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents:
8672
diff
changeset
|
1037 "-*- texinfo -*-\n\ |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1038 @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
|
1039 Undocumented internal function.\n\ |
7d48766c21a5
use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents:
8672
diff
changeset
|
1040 @end deftypefn") |
581 | 1041 { |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1042 return octave_value (Cell (names (keywords_map))); |
581 | 1043 } |
1044 | |
8812
7d48766c21a5
use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents:
8672
diff
changeset
|
1045 // 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
|
1046 // functions. |
7d48766c21a5
use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents:
8672
diff
changeset
|
1047 |
7d48766c21a5
use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents:
8672
diff
changeset
|
1048 DEFUN (__builtins__, , , |
7d48766c21a5
use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents:
8672
diff
changeset
|
1049 "-*- texinfo -*-\n\ |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1050 @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
|
1051 Undocumented internal function.\n\ |
7d48766c21a5
use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents:
8672
diff
changeset
|
1052 @end deftypefn") |
3355 | 1053 { |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1054 const string_vector bif = symbol_table::built_in_function_names (); |
3355 | 1055 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1056 return octave_value (Cell (bif)); |
3355 | 1057 } |
1058 | |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1059 static std::string |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1060 do_which (const std::string& name, std::string& type) |
3355 | 1061 { |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1062 std::string file; |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1063 |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1064 type = std::string (); |
3355 | 1065 |
7336 | 1066 octave_value val = symbol_table::find_function (name); |
1067 | |
9416
2cc47338e427
allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents:
9377
diff
changeset
|
1068 if (name.find_first_of ('.') == std::string::npos) |
3355 | 1069 { |
9416
2cc47338e427
allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents:
9377
diff
changeset
|
1070 if (val.is_defined ()) |
2cc47338e427
allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents:
9377
diff
changeset
|
1071 { |
2cc47338e427
allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents:
9377
diff
changeset
|
1072 octave_function *fcn = val.function_value (); |
7336 | 1073 |
9416
2cc47338e427
allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents:
9377
diff
changeset
|
1074 if (fcn) |
2cc47338e427
allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents:
9377
diff
changeset
|
1075 { |
2cc47338e427
allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents:
9377
diff
changeset
|
1076 file = fcn->fcn_file_name (); |
3355 | 1077 |
9416
2cc47338e427
allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents:
9377
diff
changeset
|
1078 if (file.empty ()) |
2cc47338e427
allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents:
9377
diff
changeset
|
1079 { |
2cc47338e427
allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents:
9377
diff
changeset
|
1080 if (fcn->is_user_function ()) |
2cc47338e427
allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents:
9377
diff
changeset
|
1081 type = "command-line function"; |
2cc47338e427
allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents:
9377
diff
changeset
|
1082 else |
2cc47338e427
allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents:
9377
diff
changeset
|
1083 type = "built-in function"; |
2cc47338e427
allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents:
9377
diff
changeset
|
1084 } |
2cc47338e427
allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents:
9377
diff
changeset
|
1085 else |
2cc47338e427
allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents:
9377
diff
changeset
|
1086 type = val.is_user_script () |
2cc47338e427
allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents:
9377
diff
changeset
|
1087 ? std::string ("script") : std::string ("function"); |
2cc47338e427
allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents:
9377
diff
changeset
|
1088 } |
2cc47338e427
allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents:
9377
diff
changeset
|
1089 } |
2cc47338e427
allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents:
9377
diff
changeset
|
1090 else |
2cc47338e427
allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents:
9377
diff
changeset
|
1091 { |
2cc47338e427
allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents:
9377
diff
changeset
|
1092 // We might find a file that contains only a doc string. |
2cc47338e427
allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents:
9377
diff
changeset
|
1093 |
2cc47338e427
allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents:
9377
diff
changeset
|
1094 file = load_path::find_fcn_file (name); |
2cc47338e427
allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents:
9377
diff
changeset
|
1095 } |
7336 | 1096 } |
8672
2a49c32d4322
allow help to work with files containing only comments
John W. Eaton <jwe@octave.org>
parents:
8631
diff
changeset
|
1097 else |
2a49c32d4322
allow help to work with files containing only comments
John W. Eaton <jwe@octave.org>
parents:
8631
diff
changeset
|
1098 { |
9416
2cc47338e427
allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents:
9377
diff
changeset
|
1099 // File query. |
8672
2a49c32d4322
allow help to work with files containing only comments
John W. Eaton <jwe@octave.org>
parents:
8631
diff
changeset
|
1100 |
9416
2cc47338e427
allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents:
9377
diff
changeset
|
1101 // For compatibility: "file." queries "file". |
2cc47338e427
allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents:
9377
diff
changeset
|
1102 if (name.size () > 1 && name[name.size () - 1] == '.') |
2cc47338e427
allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents:
9377
diff
changeset
|
1103 file = load_path::find_file (name.substr (0, name.size () - 1)); |
2cc47338e427
allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents:
9377
diff
changeset
|
1104 else |
2cc47338e427
allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents:
9377
diff
changeset
|
1105 file = load_path::find_file (name); |
8672
2a49c32d4322
allow help to work with files containing only comments
John W. Eaton <jwe@octave.org>
parents:
8631
diff
changeset
|
1106 } |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1107 |
9416
2cc47338e427
allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents:
9377
diff
changeset
|
1108 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1109 return file; |
3355 | 1110 } |
1111 | |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1112 std::string |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1113 do_which (const std::string& name) |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1114 { |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1115 std::string retval; |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1116 |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1117 std::string type; |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1118 |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1119 retval = do_which (name, type); |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1120 |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1121 return retval; |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1122 } |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1123 |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1124 DEFUN (__which__, args, , |
3361 | 1125 "-*- texinfo -*-\n\ |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1126 @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
|
1127 Undocumented internal function.\n\ |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1128 @end deftypefn") |
581 | 1129 { |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1130 octave_value retval; |
581 | 1131 |
1968 | 1132 string_vector argv = args.make_argv ("which"); |
1755 | 1133 |
3355 | 1134 if (! error_state) |
1135 { | |
1136 int argc = argv.length (); | |
581 | 1137 |
3355 | 1138 if (argc > 1) |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
1139 { |
11059
4ffa19147604
replace Octave_map->octave_scalar_map in help.cc and load-save.cc
Jaroslav Hajek <highegg@gmail.com>
parents:
10840
diff
changeset
|
1140 octave_map m (dim_vector (1, argc-1)); |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1141 |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
1142 Cell names (1, argc-1); |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
1143 Cell files (1, argc-1); |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
1144 Cell types (1, argc-1); |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1145 |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
1146 for (int i = 1; i < argc; i++) |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
1147 { |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
1148 std::string name = argv[i]; |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1149 |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
1150 std::string type; |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1151 |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
1152 std::string file = do_which (name, type); |
3141 | 1153 |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
1154 names(i-1) = name; |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
1155 files(i-1) = file; |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
1156 types(i-1) = type; |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
1157 } |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1158 |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
1159 m.assign ("name", names); |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
1160 m.assign ("file", files); |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
1161 m.assign ("type", types); |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1162 |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
1163 retval = m; |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
1164 } |
3355 | 1165 else |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
1166 print_usage (); |
581 | 1167 } |
1168 | |
1169 return retval; | |
1170 } | |
1171 | |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1172 // 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
|
1173 inline bool |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1174 file_is_in_dir (const std::string filename, const std::string dir) |
5447 | 1175 { |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1176 if (filename.find (dir) == 0) |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1177 { |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1178 const int dir_len = dir.size (); |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1179 const int filename_len = filename.size (); |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1180 const int max_allowed_seps = file_ops::is_dir_sep (dir [dir_len-1]) ? 0 : 1; |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11572
diff
changeset
|
1181 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1182 int num_seps = 0; |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1183 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
|
1184 if (file_ops::is_dir_sep (filename [i])) |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1185 num_seps ++; |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11572
diff
changeset
|
1186 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1187 return (num_seps <= max_allowed_seps); |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1188 } |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1189 else |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1190 return false; |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1191 } |
5447 | 1192 |
8812
7d48766c21a5
use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents:
8672
diff
changeset
|
1193 // 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
|
1194 // 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
|
1195 // the current path. |
7d48766c21a5
use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents:
8672
diff
changeset
|
1196 |
7d48766c21a5
use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents:
8672
diff
changeset
|
1197 DEFUN (__list_functions__, args, , |
7d48766c21a5
use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents:
8672
diff
changeset
|
1198 "-*- texinfo -*-\n\ |
10840 | 1199 @deftypefn {Function File} {@var{retval} =} __list_functions__ ()\n\ |
1200 @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
|
1201 Undocumented internal function.\n\ |
7d48766c21a5
use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents:
8672
diff
changeset
|
1202 @end deftypefn") |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1203 { |
8863
34a821854961
pkg.m (generate_lookfor_cache): generate a DOC file for each directory
Jason Riedy <jason@acm.org>
parents:
8861
diff
changeset
|
1204 octave_value retval; |
5447 | 1205 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1206 // 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
|
1207 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
|
1208 string_vector afl = autoloaded_functions (); |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11572
diff
changeset
|
1209 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1210 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
|
1211 retval = Cell (ffl.append (afl)); |
5447 | 1212 else |
1213 { | |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1214 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
|
1215 |
34a821854961
pkg.m (generate_lookfor_cache): generate a DOC file for each directory
Jason Riedy <jason@acm.org>
parents:
8861
diff
changeset
|
1216 if (! error_state) |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
1217 { |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
1218 string_vector fl = load_path::files (dir, true); |
8863
34a821854961
pkg.m (generate_lookfor_cache): generate a DOC file for each directory
Jason Riedy <jason@acm.org>
parents:
8861
diff
changeset
|
1219 |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
1220 if (! error_state) |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
1221 { |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
1222 // Return a sorted list with unique entries (in case of |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
1223 // .m and .oct versions of the same function in a given |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
1224 // directory, for example). |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
1225 fl.sort (true); |
9261
95445f9f5976
omit file extensions from __list_functions__ output
John W. Eaton <jwe@octave.org>
parents:
9133
diff
changeset
|
1226 |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
1227 retval = Cell (fl); |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
1228 } |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
1229 } |
5447 | 1230 else |
12483
7a5aacf65f81
Rewrite error strings in src/ to use variables named in documentation.
Rik <octave@nomad.inbox5.com>
parents:
11586
diff
changeset
|
1231 error ("__list_functions__: DIRECTORY argument must be a string"); |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11572
diff
changeset
|
1232 } |
5447 | 1233 |
1234 return retval; | |
1235 } | |
1236 | |
8861 | 1237 DEFUN (doc_cache_file, args, nargout, |
1238 "-*- texinfo -*-\n\ | |
10840 | 1239 @deftypefn {Built-in Function} {@var{val} =} doc_cache_file ()\n\ |
8861 | 1240 @deftypefnx {Built-in Function} {@var{old_val} =} doc_cache_file (@var{new_val})\n\ |
1241 Query or set the internal variable that specifies the name of the\n\ | |
9133
c0cef1436788
Update help text for sections 2.2 and 2.3 of basics.txi
Rik <rdrider0-list@yahoo.com>
parents:
9064
diff
changeset
|
1242 Octave documentation cache file. A cache file significantly improves\n\ |
c0cef1436788
Update help text for sections 2.2 and 2.3 of basics.txi
Rik <rdrider0-list@yahoo.com>
parents:
9064
diff
changeset
|
1243 the performance of the @code{lookfor} command. The default value is \n\ |
c0cef1436788
Update help text for sections 2.2 and 2.3 of basics.txi
Rik <rdrider0-list@yahoo.com>
parents:
9064
diff
changeset
|
1244 @file{@var{octave-home}/share/octave/@var{version}/etc/doc-cache},\n\ |
c0cef1436788
Update help text for sections 2.2 and 2.3 of basics.txi
Rik <rdrider0-list@yahoo.com>
parents:
9064
diff
changeset
|
1245 in which @var{octave-home} is the root directory of the Octave installation,\n\ |
c0cef1436788
Update help text for sections 2.2 and 2.3 of basics.txi
Rik <rdrider0-list@yahoo.com>
parents:
9064
diff
changeset
|
1246 and @var{version} is the Octave version number.\n\ |
c0cef1436788
Update help text for sections 2.2 and 2.3 of basics.txi
Rik <rdrider0-list@yahoo.com>
parents:
9064
diff
changeset
|
1247 The default value may be overridden by the environment variable\n\ |
10840 | 1248 @w{@env{OCTAVE_DOC_CACHE_FILE}}, or the command line argument\n\ |
9133
c0cef1436788
Update help text for sections 2.2 and 2.3 of basics.txi
Rik <rdrider0-list@yahoo.com>
parents:
9064
diff
changeset
|
1249 @samp{--doc-cache-file NAME}.\n\ |
c0cef1436788
Update help text for sections 2.2 and 2.3 of basics.txi
Rik <rdrider0-list@yahoo.com>
parents:
9064
diff
changeset
|
1250 @seealso{lookfor, info_program, doc, help, makeinfo_program}\n\ |
8861 | 1251 @end deftypefn") |
1252 { | |
1253 return SET_NONEMPTY_INTERNAL_STRING_VARIABLE (doc_cache_file); | |
1254 } | |
1255 | |
5794 | 1256 DEFUN (info_file, args, nargout, |
1257 "-*- texinfo -*-\n\ | |
10840 | 1258 @deftypefn {Built-in Function} {@var{val} =} info_file ()\n\ |
5794 | 1259 @deftypefnx {Built-in Function} {@var{old_val} =} info_file (@var{new_val})\n\ |
1260 Query or set the internal variable that specifies the name of the\n\ | |
1261 Octave info file. The default value is\n\ | |
9133
c0cef1436788
Update help text for sections 2.2 and 2.3 of basics.txi
Rik <rdrider0-list@yahoo.com>
parents:
9064
diff
changeset
|
1262 @file{@var{octave-home}/info/octave.info}, in\n\ |
c0cef1436788
Update help text for sections 2.2 and 2.3 of basics.txi
Rik <rdrider0-list@yahoo.com>
parents:
9064
diff
changeset
|
1263 which @var{octave-home} is the root directory of the Octave installation.\n\ |
c0cef1436788
Update help text for sections 2.2 and 2.3 of basics.txi
Rik <rdrider0-list@yahoo.com>
parents:
9064
diff
changeset
|
1264 The default value may be overridden by the environment variable\n\ |
10840 | 1265 @w{@env{OCTAVE_INFO_FILE}}, or the command line argument\n\ |
9133
c0cef1436788
Update help text for sections 2.2 and 2.3 of basics.txi
Rik <rdrider0-list@yahoo.com>
parents:
9064
diff
changeset
|
1266 @samp{--info-file NAME}.\n\ |
5794 | 1267 @seealso{info_program, doc, help, makeinfo_program}\n\ |
1268 @end deftypefn") | |
2202 | 1269 { |
5794 | 1270 return SET_NONEMPTY_INTERNAL_STRING_VARIABLE (info_file); |
2202 | 1271 } |
1272 | |
5794 | 1273 DEFUN (info_program, args, nargout, |
1274 "-*- texinfo -*-\n\ | |
10840 | 1275 @deftypefn {Built-in Function} {@var{val} =} info_program ()\n\ |
5794 | 1276 @deftypefnx {Built-in Function} {@var{old_val} =} info_program (@var{new_val})\n\ |
1277 Query or set the internal variable that specifies the name of the\n\ | |
7096 | 1278 info program to run. The default value is\n\ |
9133
c0cef1436788
Update help text for sections 2.2 and 2.3 of basics.txi
Rik <rdrider0-list@yahoo.com>
parents:
9064
diff
changeset
|
1279 @file{@var{octave-home}/libexec/octave/@var{version}/exec/@var{arch}/info}\n\ |
c0cef1436788
Update help text for sections 2.2 and 2.3 of basics.txi
Rik <rdrider0-list@yahoo.com>
parents:
9064
diff
changeset
|
1280 in which @var{octave-home} is the root directory of the Octave installation,\n\ |
c0cef1436788
Update help text for sections 2.2 and 2.3 of basics.txi
Rik <rdrider0-list@yahoo.com>
parents:
9064
diff
changeset
|
1281 @var{version} is the Octave version number, and @var{arch}\n\ |
3686 | 1282 is the system type (for example, @code{i686-pc-linux-gnu}). The\n\ |
9133
c0cef1436788
Update help text for sections 2.2 and 2.3 of basics.txi
Rik <rdrider0-list@yahoo.com>
parents:
9064
diff
changeset
|
1283 default value may be overridden by the environment variable\n\ |
10840 | 1284 @w{@env{OCTAVE_INFO_PROGRAM}}, or the command line argument\n\ |
9133
c0cef1436788
Update help text for sections 2.2 and 2.3 of basics.txi
Rik <rdrider0-list@yahoo.com>
parents:
9064
diff
changeset
|
1285 @samp{--info-program NAME}.\n\ |
5794 | 1286 @seealso{info_file, doc, help, makeinfo_program}\n\ |
1287 @end deftypefn") | |
1288 { | |
1289 return SET_NONEMPTY_INTERNAL_STRING_VARIABLE (info_program); | |
1290 } | |
3686 | 1291 |
5794 | 1292 DEFUN (makeinfo_program, args, nargout, |
1293 "-*- texinfo -*-\n\ | |
10840 | 1294 @deftypefn {Built-in Function} {@var{val} =} makeinfo_program ()\n\ |
5794 | 1295 @deftypefnx {Built-in Function} {@var{old_val} =} makeinfo_program (@var{new_val})\n\ |
1296 Query or set the internal variable that specifies the name of the\n\ | |
9133
c0cef1436788
Update help text for sections 2.2 and 2.3 of basics.txi
Rik <rdrider0-list@yahoo.com>
parents:
9064
diff
changeset
|
1297 program that Octave runs to format help text containing\n\ |
c0cef1436788
Update help text for sections 2.2 and 2.3 of basics.txi
Rik <rdrider0-list@yahoo.com>
parents:
9064
diff
changeset
|
1298 Texinfo markup commands. The default value is @code{makeinfo}.\n\ |
5794 | 1299 @seealso{info_file, info_program, doc, help}\n\ |
1300 @end deftypefn") | |
1301 { | |
1302 return SET_NONEMPTY_INTERNAL_STRING_VARIABLE (makeinfo_program); | |
1303 } | |
2202 | 1304 |
5794 | 1305 DEFUN (suppress_verbose_help_message, args, nargout, |
1306 "-*- texinfo -*-\n\ | |
10840 | 1307 @deftypefn {Built-in Function} {@var{val} =} suppress_verbose_help_message ()\n\ |
5794 | 1308 @deftypefnx {Built-in Function} {@var{old_val} =} suppress_verbose_help_message (@var{new_val})\n\ |
7001 | 1309 Query or set the internal variable that controls whether Octave\n\ |
5794 | 1310 will add additional help information to the end of the output from\n\ |
3332 | 1311 the @code{help} command and usage messages for built-in commands.\n\ |
5794 | 1312 @end deftypefn") |
1313 { | |
1314 return SET_INTERNAL_VARIABLE (suppress_verbose_help_message); | |
2189 | 1315 } |