Mercurial > hg > octave-nkf
annotate src/help.cc @ 15283:a95432e7309c stable release-3-6-3
Version 3.6.3 released.
* configure.ac (AC_INIT): Version is now 3.6.3.
(OCTAVE_RELEASE_DATE): Now 2012-09-04.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Tue, 04 Sep 2012 13:17:13 -0400 |
parents | 2ced2f59f523 |
children | 97883071e8e4 |
rev | line source |
---|---|
1 | 1 /* |
2 | |
14138
72c96de7a403
maint: update copyright notices for 2012
John W. Eaton <jwe@octave.org>
parents:
14119
diff
changeset
|
3 Copyright (C) 1993-2012 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\ |
13773
59e5f8e1d516
Fix block comment Texinfo not appearing in documentation
Rik <octave@nomad.inbox5.com>
parents:
13749
diff
changeset
|
155 Begin block comment. There must be nothing else, other than\n\ |
59e5f8e1d516
Fix block comment Texinfo not appearing in documentation
Rik <octave@nomad.inbox5.com>
parents:
13749
diff
changeset
|
156 whitespace, in the line both before and after @code{#@{}.\n\ |
59e5f8e1d516
Fix block comment Texinfo not appearing in documentation
Rik <octave@nomad.inbox5.com>
parents:
13749
diff
changeset
|
157 It is possible to nest block comments.\n\ |
59e5f8e1d516
Fix block comment Texinfo not appearing in documentation
Rik <octave@nomad.inbox5.com>
parents:
13749
diff
changeset
|
158 @seealso{%@{, #@}, #}\n\ |
12670
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\ |
13773
59e5f8e1d516
Fix block comment Texinfo not appearing in documentation
Rik <octave@nomad.inbox5.com>
parents:
13749
diff
changeset
|
164 Begin block comment. There must be nothing else, other than\n\ |
59e5f8e1d516
Fix block comment Texinfo not appearing in documentation
Rik <octave@nomad.inbox5.com>
parents:
13749
diff
changeset
|
165 whitespace, in the line both before and after @code{%@{}.\n\ |
59e5f8e1d516
Fix block comment Texinfo not appearing in documentation
Rik <octave@nomad.inbox5.com>
parents:
13749
diff
changeset
|
166 It is possible to nest block comments.\n\ |
59e5f8e1d516
Fix block comment Texinfo not appearing in documentation
Rik <octave@nomad.inbox5.com>
parents:
13749
diff
changeset
|
167 @seealso{#@{, %@}, %}\n\ |
12670
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\ |
13773
59e5f8e1d516
Fix block comment Texinfo not appearing in documentation
Rik <octave@nomad.inbox5.com>
parents:
13749
diff
changeset
|
173 Close block comment. There must be nothing else, other than\n\ |
59e5f8e1d516
Fix block comment Texinfo not appearing in documentation
Rik <octave@nomad.inbox5.com>
parents:
13749
diff
changeset
|
174 whitespace, in the line both before and after @code{#@}}.\n\ |
59e5f8e1d516
Fix block comment Texinfo not appearing in documentation
Rik <octave@nomad.inbox5.com>
parents:
13749
diff
changeset
|
175 It is possible to nest block comments.\n\ |
59e5f8e1d516
Fix block comment Texinfo not appearing in documentation
Rik <octave@nomad.inbox5.com>
parents:
13749
diff
changeset
|
176 @seealso{%@}, #@{, #}\n\ |
12670
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\ |
13773
59e5f8e1d516
Fix block comment Texinfo not appearing in documentation
Rik <octave@nomad.inbox5.com>
parents:
13749
diff
changeset
|
182 Close block comment. There must be nothing else, other than\n\ |
59e5f8e1d516
Fix block comment Texinfo not appearing in documentation
Rik <octave@nomad.inbox5.com>
parents:
13749
diff
changeset
|
183 whitespace, in the line both before and after @code{%@}}.\n\ |
59e5f8e1d516
Fix block comment Texinfo not appearing in documentation
Rik <octave@nomad.inbox5.com>
parents:
13749
diff
changeset
|
184 It is possible to nest block comments.\n\ |
59e5f8e1d516
Fix block comment Texinfo not appearing in documentation
Rik <octave@nomad.inbox5.com>
parents:
13749
diff
changeset
|
185 @seealso{#@}, %@{, %}\n\ |
12670
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\ |
13773
59e5f8e1d516
Fix block comment Texinfo not appearing in documentation
Rik <octave@nomad.inbox5.com>
parents:
13749
diff
changeset
|
191 Continuation marker. Joins current line with following line.\n\ |
12670
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\ |
13773
59e5f8e1d516
Fix block comment Texinfo not appearing in documentation
Rik <octave@nomad.inbox5.com>
parents:
13749
diff
changeset
|
211 Matrix transpose operator. For complex matrices, computes the\n\ |
12670
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\ | |
13773
59e5f8e1d516
Fix block comment Texinfo not appearing in documentation
Rik <octave@nomad.inbox5.com>
parents:
13749
diff
changeset
|
216 ambiguous.\n\ |
12670
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\ |
14171
2ced2f59f523
doc: miscellaneous documentation improvements
Rik <octave@nomad.inbox5.com>
parents:
14169
diff
changeset
|
242 Power operator. This may return complex results for real inputs. Use\n\ |
14169
c0ca47ab7641
doc: Better explain which complex result is chosen by .^
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
14138
diff
changeset
|
243 @code{realsqrt}, @code{cbrt}, @code{nthroot}, or @code{realroot} to obtain\n\ |
c0ca47ab7641
doc: Better explain which complex result is chosen by .^
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
14138
diff
changeset
|
244 real results when possible.\n\ |
c0ca47ab7641
doc: Better explain which complex result is chosen by .^
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
14138
diff
changeset
|
245 @seealso{power, ^, .**, .^, realpow, realsqrt, cbrt, nthroot}\n\ |
12670
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
246 @end deftypefn"), |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
247 |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
248 pair_type ("^", |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
249 "-*- texinfo -*-\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
250 @deftypefn {Operator} {} ^\n\ |
14171
2ced2f59f523
doc: miscellaneous documentation improvements
Rik <octave@nomad.inbox5.com>
parents:
14169
diff
changeset
|
251 Power operator. This may return complex results for real inputs. Use\n\ |
14169
c0ca47ab7641
doc: Better explain which complex result is chosen by .^
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
14138
diff
changeset
|
252 @code{realsqrt}, @code{cbrt}, @code{nthroot}, or @code{realroot} to obtain\n\ |
c0ca47ab7641
doc: Better explain which complex result is chosen by .^
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
14138
diff
changeset
|
253 real results when possible.\n\ |
c0ca47ab7641
doc: Better explain which complex result is chosen by .^
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
14138
diff
changeset
|
254 @seealso{power, **, .^, .**, realpow, realsqrt, cbrt, nthroot}\n\ |
12670
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
255 @end deftypefn"), |
1 | 256 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
257 pair_type ("+", |
12670
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
258 "-*- texinfo -*-\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
259 @deftypefn {Operator} {} +\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
260 Addition operator.\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
261 @seealso{plus}\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
262 @end deftypefn"), |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
263 |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
264 pair_type ("++", |
12670
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
265 "-*- texinfo -*-\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
266 @deftypefn {Operator} {} ++\n\ |
13773
59e5f8e1d516
Fix block comment Texinfo not appearing in documentation
Rik <octave@nomad.inbox5.com>
parents:
13749
diff
changeset
|
267 Increment operator. As in C, may be applied as a prefix or postfix\n\ |
12670
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
268 operator.\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
269 @seealso{--}\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
270 @end deftypefn"), |
1 | 271 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
272 pair_type (",", |
12670
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
273 "-*- texinfo -*-\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
274 @deftypefn {Operator} {} ,\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
275 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
|
276 @end deftypefn"), |
1 | 277 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
278 pair_type ("-", |
12670
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
279 "-*- texinfo -*-\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
280 @deftypefn {Operator} {} -\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
281 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
|
282 @seealso{minus}\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
283 @end deftypefn"), |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
284 |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
285 pair_type ("--", |
12670
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
286 "-*- texinfo -*-\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
287 @deftypefn {Operator} {} --\n\ |
13773
59e5f8e1d516
Fix block comment Texinfo not appearing in documentation
Rik <octave@nomad.inbox5.com>
parents:
13749
diff
changeset
|
288 Decrement operator. As in C, may be applied as a prefix or postfix\n\ |
12670
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
289 operator.\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
290 @seealso{++}\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
291 @end deftypefn"), |
1 | 292 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
293 pair_type (".'", |
12670
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
294 "-*- texinfo -*-\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
295 @deftypefn {Operator} {} .'\n\ |
13773
59e5f8e1d516
Fix block comment Texinfo not appearing in documentation
Rik <octave@nomad.inbox5.com>
parents:
13749
diff
changeset
|
296 Matrix transpose operator. For complex matrices, computes the\n\ |
12670
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
297 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
|
298 @seealso{', transpose}\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
299 @end deftypefn"), |
1 | 300 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
301 pair_type (".*", |
12670
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
302 "-*- texinfo -*-\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
303 @deftypefn {Operator} {} .*\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
304 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
|
305 @seealso{*, times}\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
306 @end deftypefn"), |
1 | 307 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
308 pair_type (".**", |
12670
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
309 "-*- texinfo -*-\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
310 @deftypefn {Operator} {} .*\n\ |
14171
2ced2f59f523
doc: miscellaneous documentation improvements
Rik <octave@nomad.inbox5.com>
parents:
14169
diff
changeset
|
311 Element by element power operator. If several complex results are possible,\n\ |
2ced2f59f523
doc: miscellaneous documentation improvements
Rik <octave@nomad.inbox5.com>
parents:
14169
diff
changeset
|
312 returns the one with smallest non-negative argument (angle). Use\n\ |
14169
c0ca47ab7641
doc: Better explain which complex result is chosen by .^
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
14138
diff
changeset
|
313 @code{realpow}, @code{realsqrt}, @code{cbrt}, or @code{nthroot} if a\n\ |
c0ca47ab7641
doc: Better explain which complex result is chosen by .^
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
14138
diff
changeset
|
314 real result is preferred.\n\ |
c0ca47ab7641
doc: Better explain which complex result is chosen by .^
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
14138
diff
changeset
|
315 @seealso{**, ^, .^, power, realpow, realsqrt, cbrt, nthroot}\n\ |
12670
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
316 @end deftypefn"), |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
317 |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
318 pair_type (".^", |
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\ |
14171
2ced2f59f523
doc: miscellaneous documentation improvements
Rik <octave@nomad.inbox5.com>
parents:
14169
diff
changeset
|
321 Element by element power operator. If several complex results are possible,\n\ |
2ced2f59f523
doc: miscellaneous documentation improvements
Rik <octave@nomad.inbox5.com>
parents:
14169
diff
changeset
|
322 returns the one with smallest non-negative argument (angle). Use\n\ |
14169
c0ca47ab7641
doc: Better explain which complex result is chosen by .^
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
14138
diff
changeset
|
323 @code{realpow}, @code{realsqrt}, @code{cbrt}, or @code{nthroot} if a\n\ |
c0ca47ab7641
doc: Better explain which complex result is chosen by .^
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
14138
diff
changeset
|
324 real result is preferred.\n\ |
c0ca47ab7641
doc: Better explain which complex result is chosen by .^
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
14138
diff
changeset
|
325 @seealso{.**, ^, **, power, realpow, realsqrt, cbrt, nthroot}\n\ |
12670
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
326 @end deftypefn"), |
1 | 327 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
328 pair_type ("./", |
12670
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
329 "-*- texinfo -*-\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
330 @deftypefn {Operator} {} ./\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
331 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
|
332 @seealso{/, .\\, rdivide, mrdivide}\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
333 @end deftypefn"), |
1 | 334 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
335 pair_type ("/", |
12670
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
336 "-*- texinfo -*-\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
337 @deftypefn {Operator} {} /\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
338 Right division operator.\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
339 @seealso{./, \\, rdivide, mrdivide}\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
340 @end deftypefn"), |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
341 |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
342 pair_type (".\\", |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
343 "-*- texinfo -*-\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
344 @deftypefn {Operator} {} .\\\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
345 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
|
346 @seealso{\\, ./, rdivide, mrdivide}\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
347 @end deftypefn"), |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
348 |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
349 pair_type ("\\", |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
350 "-*- texinfo -*-\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
351 @deftypefn {Operator} {} \\\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
352 Left division operator.\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
353 @seealso{.\\, /, ldivide, mldivide}\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
354 @end deftypefn"), |
1 | 355 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
356 pair_type (":", |
12670
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
357 "-*- texinfo -*-\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
358 @deftypefn {Operator} {} :\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
359 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
|
360 @end deftypefn"), |
1 | 361 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
362 pair_type (";", |
12670
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
363 "-*- texinfo -*-\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
364 @deftypefn {Operator} {} ;\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
365 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
|
366 @seealso{,}\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
367 @end deftypefn"), |
1 | 368 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
369 pair_type ("<", |
12670
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
370 "-*- texinfo -*-\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
371 @deftypefn {Operator} {} <\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
372 'Less than' operator.\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
373 @seealso{lt}\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
374 @end deftypefn"), |
1 | 375 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
376 pair_type ("<=", |
12670
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
377 "-*- texinfo -*-\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
378 @deftypefn {Operator} {} <=\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
379 '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
|
380 @seealso{le}\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
381 @end deftypefn"), |
1 | 382 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
383 pair_type ("=", |
12670
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
384 "-*- texinfo -*-\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
385 @deftypefn {Operator} {} =\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
386 Assignment operator.\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
387 @end deftypefn"), |
1 | 388 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
389 pair_type ("==", |
12670
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
390 "-*- texinfo -*-\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
391 @deftypefn {Operator} {} ==\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
392 Equality test operator.\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
393 @seealso{eq}\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
394 @end deftypefn"), |
1 | 395 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
396 pair_type (">", |
12670
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
397 "-*- texinfo -*-\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
398 @deftypefn {Operator} {} >\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
399 'Greater than' operator.\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
400 @seealso{gt}\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
401 @end deftypefn"), |
1 | 402 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
403 pair_type (">=", |
12670
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
404 "-*- texinfo -*-\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
405 @deftypefn {Operator} {} >=\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
406 '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
|
407 @seealso{ge}\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
408 @end deftypefn"), |
1 | 409 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
410 pair_type ("[", |
12670
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
411 "-*- texinfo -*-\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
412 @deftypefn {Operator} {} [\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
413 Return list delimiter.\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
414 @seealso{]}\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
415 @end deftypefn"), |
1 | 416 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
417 pair_type ("]", |
12670
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
418 "-*- texinfo -*-\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
419 @deftypefn {Operator} {} ]\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
420 Return list delimiter.\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
421 @seealso{[}\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
422 @end deftypefn"), |
1 | 423 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
424 pair_type ("|", |
12670
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
425 "-*- texinfo -*-\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
426 @deftypefn {Operator} {} |\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
427 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
|
428 @seealso{||, or}\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
429 @end deftypefn"), |
1 | 430 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
431 pair_type ("||", |
12670
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
432 "-*- texinfo -*-\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
433 @deftypefn {Operator} {} ||\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
434 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
|
435 @seealso{|, or}\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
436 @end deftypefn"), |
1 | 437 }; |
438 | |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
439 const static pair_type keywords[] = |
1 | 440 { |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
441 pair_type ("break", |
5818 | 442 "-*- texinfo -*-\n\ |
11547 | 443 @deftypefn {Keyword} {} break\n\ |
5818 | 444 Exit the innermost enclosing do, while or for loop.\n\ |
13246 | 445 @seealso{do, while, for, parfor, continue}\n\ |
11547 | 446 @end deftypefn"), |
5040 | 447 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
448 pair_type ("case", |
5818 | 449 "-*- texinfo -*-\n\ |
11547 | 450 @deftypefn {Keyword} {} case @{@var{value}@}\n\ |
9064
7c02ec148a3c
Check grammar on all .cc files
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
451 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
|
452 fall-through as do C-language cases. A switch statement must have at least\n\ |
5818 | 453 one case. See @code{switch} for an example.\n\ |
454 @seealso{switch}\n\ | |
11547 | 455 @end deftypefn"), |
1 | 456 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
457 pair_type ("catch", |
5818 | 458 "-*- texinfo -*-\n\ |
11547 | 459 @deftypefn {Keyword} {} catch\n\ |
5818 | 460 Begin the cleanup part of a try-catch block.\n\ |
461 @seealso{try}\n\ | |
11547 | 462 @end deftypefn"), |
1489 | 463 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
464 pair_type ("continue", |
5818 | 465 "-*- texinfo -*-\n\ |
11547 | 466 @deftypefn {Keyword} {} continue\n\ |
5818 | 467 Jump to the end of the innermost enclosing do, while or for loop.\n\ |
13246 | 468 @seealso{do, while, for, parfor, break}\n\ |
11547 | 469 @end deftypefn"), |
5040 | 470 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
471 pair_type ("do", |
5818 | 472 "-*- texinfo -*-\n\ |
11547 | 473 @deftypefn {Keyword} {} do\n\ |
9064
7c02ec148a3c
Check grammar on all .cc files
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
474 Begin a do-until loop. This differs from a do-while loop in that the\n\ |
5818 | 475 body of the loop is executed at least once.\n\ |
476 @seealso{while}\n\ | |
11547 | 477 @end deftypefn"), |
1 | 478 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
479 pair_type ("else", |
5818 | 480 "-*- texinfo -*-\n\ |
11547 | 481 @deftypefn {Keyword} {} else\n\ |
5818 | 482 Alternate action for an if block. See @code{if} for an example.\n\ |
483 @seealso{if}\n\ | |
11547 | 484 @end deftypefn"), |
1 | 485 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
486 pair_type ("elseif", |
5818 | 487 "-*- texinfo -*-\n\ |
11547 | 488 @deftypefn {Keyword} {} elseif (@var{condition})\n\ |
5818 | 489 Alternate conditional test for an if block. See @code{if} for an example.\n\ |
490 @seealso{if}\n\ | |
11547 | 491 @end deftypefn"), |
1 | 492 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
493 pair_type ("end", |
5818 | 494 "-*- texinfo -*-\n\ |
11547 | 495 @deftypefn {Keyword} {} end\n\ |
10840 | 496 Mark the end of any @code{for}, @code{if}, @code{do}, @code{while}, or\n\ |
497 @code{function} block.\n\ | |
13246 | 498 @seealso{for, parfor, if, do, while, function}\n\ |
11547 | 499 @end deftypefn"), |
928 | 500 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
501 pair_type ("end_try_catch", |
5818 | 502 "-*- texinfo -*-\n\ |
11547 | 503 @deftypefn {Keyword} {} end_try_catch\n\ |
5818 | 504 Mark the end of an @code{try-catch} block.\n\ |
505 @seealso{try, catch}\n\ | |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11572
diff
changeset
|
506 @end deftypefn"), |
1489 | 507 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
508 pair_type ("end_unwind_protect", |
5818 | 509 "-*- texinfo -*-\n\ |
11547 | 510 @deftypefn {Keyword} {} end_unwind_protect\n\ |
5818 | 511 Mark the end of an unwind_protect block.\n\ |
512 @seealso{unwind_protect}\n\ | |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11572
diff
changeset
|
513 @end deftypefn"), |
1 | 514 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
515 pair_type ("endfor", |
5818 | 516 "-*- texinfo -*-\n\ |
11547 | 517 @deftypefn {Keyword} {} endfor\n\ |
5818 | 518 Mark the end of a for loop. See @code{for} for an example.\n\ |
519 @seealso{for}\n\ | |
11547 | 520 @end deftypefn"), |
1 | 521 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
522 pair_type ("endfunction", |
5818 | 523 "-*- texinfo -*-\n\ |
11547 | 524 @deftypefn {Keyword} {} endfunction\n\ |
5818 | 525 Mark the end of a function.\n\ |
526 @seealso{function}\n\ | |
11547 | 527 @end deftypefn"), |
1 | 528 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
529 pair_type ("endif", |
5818 | 530 "-*- texinfo -*-\n\ |
11547 | 531 @deftypefn {Keyword} {} endif\n\ |
5818 | 532 Mark the end of an if block. See @code{if} for an example.\n\ |
533 @seealso{if}\n\ | |
11547 | 534 @end deftypefn"), |
1 | 535 |
13246 | 536 pair_type ("endparfor", |
537 "-*- texinfo -*-\n\ | |
538 @deftypefn {Keyword} {} endparfor\n\ | |
539 Mark the end of a parfor loop. See @code{parfor} for an example.\n\ | |
540 @seealso{parfor}\n\ | |
541 @end deftypefn"), | |
542 | |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
543 pair_type ("endswitch", |
5818 | 544 "-*- texinfo -*-\n\ |
11547 | 545 @deftypefn {Keyword} {} endswitch\n\ |
5818 | 546 Mark the end of a switch block. See @code{switch} for an example.\n\ |
547 @seealso{switch}\n\ | |
11547 | 548 @end deftypefn"), |
5122 | 549 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
550 pair_type ("endwhile", |
5818 | 551 "-*- texinfo -*-\n\ |
11547 | 552 @deftypefn {Keyword} {} endwhile\n\ |
5818 | 553 Mark the end of a while loop. See @code{while} for an example.\n\ |
554 @seealso{do, while}\n\ | |
11547 | 555 @end deftypefn"), |
1 | 556 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
557 pair_type ("for", |
5818 | 558 "-*- texinfo -*-\n\ |
11547 | 559 @deftypefn {Keyword} {} for @var{i} = @var{range}\n\ |
5818 | 560 Begin a for loop.\n\ |
10840 | 561 \n\ |
5818 | 562 @example\n\ |
9064
7c02ec148a3c
Check grammar on all .cc files
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
563 @group\n\ |
5818 | 564 for i = 1:10\n\ |
565 i\n\ | |
566 endfor\n\ | |
9064
7c02ec148a3c
Check grammar on all .cc files
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
567 @end group\n\ |
5818 | 568 @end example\n\ |
13246 | 569 @seealso{do, parfor, while}\n\ |
11547 | 570 @end deftypefn"), |
1 | 571 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
572 pair_type ("function", |
5818 | 573 "-*- texinfo -*-\n\ |
12605
307e177dbaa8
doc: Add spaces after commas in @seealso blocks.
Rik <octave@nomad.inbox5.com>
parents:
12519
diff
changeset
|
574 @deftypefn {Keyword} {} function @var{outputs} = function (@var{input}, @dots{})\n\ |
11547 | 575 @deftypefnx {Keyword} {} function {} function (@var{input}, @dots{})\n\ |
576 @deftypefnx {Keyword} {} function @var{outputs} = function\n\ | |
5818 | 577 Begin a function body with @var{outputs} as results and @var{inputs} as\n\ |
578 parameters.\n\ | |
579 @seealso{return}\n\ | |
11547 | 580 @end deftypefn"), |
1 | 581 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
582 pair_type ("global", |
5818 | 583 "-*- texinfo -*-\n\ |
11547 | 584 @deftypefn {Keyword} {} global\n\ |
5818 | 585 Declare variables to have global scope.\n\ |
10840 | 586 \n\ |
5818 | 587 @example\n\ |
9064
7c02ec148a3c
Check grammar on all .cc files
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
588 @group\n\ |
5818 | 589 global @var{x};\n\ |
590 if isempty (@var{x})\n\ | |
591 x = 1;\n\ | |
592 endif\n\ | |
9064
7c02ec148a3c
Check grammar on all .cc files
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
593 @end group\n\ |
5818 | 594 @end example\n\ |
595 @seealso{persistent}\n\ | |
11547 | 596 @end deftypefn"), |
1 | 597 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
598 pair_type ("if", |
5393 | 599 "-*- texinfo -*-\n\ |
12605
307e177dbaa8
doc: Add spaces after commas in @seealso blocks.
Rik <octave@nomad.inbox5.com>
parents:
12519
diff
changeset
|
600 @deftypefn {Keyword} {} if (@var{cond}) @dots{} endif\n\ |
11547 | 601 @deftypefnx {Keyword} {} if (@var{cond}) @dots{} else @dots{} endif\n\ |
602 @deftypefnx {Keyword} {} if (@var{cond}) @dots{} elseif (@var{cond}) @dots{} endif\n\ | |
603 @deftypefnx {Keyword} {} if (@var{cond}) @dots{} elseif (@var{cond}) @dots{} else @dots{} endif\n\ | |
5393 | 604 Begin an if block.\n\ |
10840 | 605 \n\ |
5818 | 606 @example\n\ |
9064
7c02ec148a3c
Check grammar on all .cc files
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
607 @group\n\ |
5818 | 608 x = 1;\n\ |
609 if (x == 1)\n\ | |
610 disp (\"one\");\n\ | |
611 elseif (x == 2)\n\ | |
612 disp (\"two\");\n\ | |
613 else\n\ | |
614 disp (\"not one or two\");\n\ | |
615 endif\n\ | |
9064
7c02ec148a3c
Check grammar on all .cc files
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
616 @end group\n\ |
5818 | 617 @end example\n\ |
5646 | 618 @seealso{switch}\n\ |
11547 | 619 @end deftypefn"), |
1 | 620 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
621 pair_type ("otherwise", |
5818 | 622 "-*- texinfo -*-\n\ |
11547 | 623 @deftypefn {Keyword} {} otherwise\n\ |
5818 | 624 The default statement in a switch block (similar to else in an if block).\n\ |
625 @seealso{switch}\n\ | |
11547 | 626 @end deftypefn"), |
5040 | 627 |
13246 | 628 pair_type ("parfor", |
629 "-*- texinfo -*-\n\ | |
14119
94e2a76f1e5a
doc: Final grammarcheck and spellcheck before 3.6.0 release.
Rik <octave@nomad.inbox5.com>
parents:
13965
diff
changeset
|
630 @deftypefn {Keyword} {} for @var{i} = @var{range}\n\ |
13246 | 631 @deftypefnx {Keyword} {} for (@var{i} = @var{range}, @var{maxproc})\n\ |
632 Begin a for loop that may execute in parallel.\n\ | |
633 \n\ | |
634 @example\n\ | |
635 @group\n\ | |
636 parfor i = 1:10\n\ | |
637 i\n\ | |
638 endparfor\n\ | |
639 @end group\n\ | |
640 @end example\n\ | |
13773
59e5f8e1d516
Fix block comment Texinfo not appearing in documentation
Rik <octave@nomad.inbox5.com>
parents:
13749
diff
changeset
|
641 @seealso{for, do, while}\n\ |
13246 | 642 @end deftypefn"), |
643 | |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
644 pair_type ("persistent", |
5818 | 645 "-*- texinfo -*-\n\ |
11547 | 646 @deftypefn {Keyword} {} persistent @var{var}\n\ |
5818 | 647 Declare variables as persistent. A variable that has been declared\n\ |
5623 | 648 persistent within a function will retain its contents in memory between\n\ |
649 subsequent calls to the same function. The difference between persistent\n\ | |
5818 | 650 variables and global variables is that persistent variables are local in \n\ |
651 scope to a particular function and are not visible elsewhere.\n\ | |
652 @seealso{global}\n\ | |
11547 | 653 @end deftypefn"), |
4686 | 654 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
655 pair_type ("return", |
5818 | 656 "-*- texinfo -*-\n\ |
11547 | 657 @deftypefn {Keyword} {} return\n\ |
5818 | 658 Return from a function.\n\ |
659 @seealso{function}\n\ | |
11547 | 660 @end deftypefn"), |
928 | 661 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
662 pair_type ("static", |
5818 | 663 "-*- texinfo -*-\n\ |
11547 | 664 @deftypefn {Keyword} {} static\n\ |
5818 | 665 This function has been deprecated in favor of persistent.\n\ |
666 @seealso{persistent}\n\ | |
11547 | 667 @end deftypefn"), |
5040 | 668 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
669 pair_type ("switch", |
5818 | 670 "-*- texinfo -*-\n\ |
11547 | 671 @deftypefn {Keyword} {} switch @var{statement}\n\ |
5818 | 672 Begin a switch block.\n\ |
10840 | 673 \n\ |
5818 | 674 @example\n\ |
9064
7c02ec148a3c
Check grammar on all .cc files
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
675 @group\n\ |
5818 | 676 yesno = \"yes\"\n\ |
677 \n\ | |
678 switch yesno\n\ | |
5832 | 679 case @{\"Yes\" \"yes\" \"YES\" \"y\" \"Y\"@}\n\ |
5818 | 680 value = 1;\n\ |
5832 | 681 case @{\"No\" \"no\" \"NO\" \"n\" \"N\"@}\n\ |
5818 | 682 value = 0;\n\ |
683 otherwise\n\ | |
684 error (\"invalid value\");\n\ | |
685 endswitch\n\ | |
9064
7c02ec148a3c
Check grammar on all .cc files
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
686 @end group\n\ |
5818 | 687 @end example\n\ |
688 @seealso{if, case, otherwise}\n\ | |
11547 | 689 @end deftypefn"), |
5040 | 690 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
691 pair_type ("try", |
5818 | 692 "-*- texinfo -*-\n\ |
11547 | 693 @deftypefn {Keyword} {} try\n\ |
5818 | 694 Begin a try-catch block.\n\ |
6138 | 695 \n\ |
696 If an error occurs within a try block, then the catch code will be run and\n\ | |
697 execution will proceed after the catch block (though it is often\n\ | |
698 recommended to use the lasterr function to re-throw the error after cleanup\n\ | |
699 is completed).\n\ | |
12605
307e177dbaa8
doc: Add spaces after commas in @seealso blocks.
Rik <octave@nomad.inbox5.com>
parents:
12519
diff
changeset
|
700 @seealso{catch, unwind_protect}\n\ |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11572
diff
changeset
|
701 @end deftypefn"), |
1489 | 702 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
703 pair_type ("until", |
5818 | 704 "-*- texinfo -*-\n\ |
11547 | 705 @deftypefn {Keyword} {} until\n\ |
5818 | 706 End a do-until loop.\n\ |
707 @seealso{do}\n\ | |
11547 | 708 @end deftypefn"), |
5040 | 709 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
710 pair_type ("unwind_protect", |
5818 | 711 "-*- texinfo -*-\n\ |
11547 | 712 @deftypefn {Keyword} {} unwind_protect\n\ |
5818 | 713 Begin an unwind_protect block.\n\ |
6138 | 714 \n\ |
715 If an error occurs within the first part of an unwind_protect block\n\ | |
716 the commands within the unwind_protect_cleanup block are executed before\n\ | |
717 the error is thrown. If an error is not thrown, then the\n\ | |
718 unwind_protect_cleanup block is still executed (in other words, the\n\ | |
719 unwind_protect_cleanup will be run with or without an error in the\n\ | |
720 unwind_protect block).\n\ | |
12605
307e177dbaa8
doc: Add spaces after commas in @seealso blocks.
Rik <octave@nomad.inbox5.com>
parents:
12519
diff
changeset
|
721 @seealso{unwind_protect_cleanup, try}\n\ |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11572
diff
changeset
|
722 @end deftypefn"), |
928 | 723 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
724 pair_type ("unwind_protect_cleanup", |
5818 | 725 "-*- texinfo -*-\n\ |
11547 | 726 @deftypefn {Keyword} {} unwind_protect_cleanup\n\ |
5818 | 727 Begin the cleanup section of an unwind_protect block.\n\ |
728 @seealso{unwind_protect}\n\ | |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11572
diff
changeset
|
729 @end deftypefn"), |
1 | 730 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
731 pair_type ("varargin", |
5818 | 732 "-*- texinfo -*-\n\ |
11547 | 733 @deftypefn {Keyword} {} varargin\n\ |
5818 | 734 Pass an arbitrary number of arguments into a function.\n\ |
13749
62d1f56b0be7
New nthargout function
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
13246
diff
changeset
|
735 @seealso{varargout, nargin, isargout, nargout, nthargout}\n\ |
11547 | 736 @end deftypefn"), |
5040 | 737 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
738 pair_type ("varargout", |
5818 | 739 "-*- texinfo -*-\n\ |
11547 | 740 @deftypefn {Keyword} {} varargout\n\ |
5818 | 741 Pass an arbitrary number of arguments out of a function.\n\ |
13749
62d1f56b0be7
New nthargout function
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
13246
diff
changeset
|
742 @seealso{varargin, nargin, isargout, nargout, nthargout}\n\ |
11547 | 743 @end deftypefn"), |
5040 | 744 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
745 pair_type ("while", |
5818 | 746 "-*- texinfo -*-\n\ |
11547 | 747 @deftypefn {Keyword} {} while\n\ |
5818 | 748 Begin a while loop.\n\ |
749 @seealso{do}\n\ | |
11547 | 750 @end deftypefn"), |
1 | 751 }; |
752 | |
581 | 753 // Return a copy of the operator or keyword names. |
3016 | 754 static string_vector |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
755 names (const map_type& lst) |
1 | 756 { |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
757 string_vector retval (lst.size ()); |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
758 int j = 0; |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
759 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
|
760 retval [j++] = iter->first; |
1755 | 761 return retval; |
1 | 762 } |
763 | |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
764 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
|
765 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
|
766 const static string_vector keyword_names = names (keywords_map); |
1 | 767 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
768 // FIXME -- It's not likely that this does the right thing now. |
3016 | 769 |
770 string_vector | |
771 make_name_list (void) | |
772 { | |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
773 const int key_len = keyword_names.length (); |
3016 | 774 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
775 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
|
776 const int bif_len = bif.length (); |
4009 | 777 |
12911
d6151d774283
make completion work for command-line functions
John W. Eaton <jwe@octave.org>
parents:
12670
diff
changeset
|
778 const string_vector cfl = symbol_table::cmdline_function_names (); |
d6151d774283
make completion work for command-line functions
John W. Eaton <jwe@octave.org>
parents:
12670
diff
changeset
|
779 const int cfl_len = cfl.length (); |
d6151d774283
make completion work for command-line functions
John W. Eaton <jwe@octave.org>
parents:
12670
diff
changeset
|
780 |
10500
8f27f368aba2
fix generating names for TAB completion
Jaroslav Hajek <highegg@gmail.com>
parents:
10315
diff
changeset
|
781 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
|
782 const int lcl_len = lcl.length (); |
3016 | 783 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
784 const string_vector ffl = load_path::fcn_names (); |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
785 const int ffl_len = ffl.length (); |
3016 | 786 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
787 const string_vector afl = autoloaded_functions (); |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
788 const int afl_len = afl.length (); |
5592 | 789 |
12911
d6151d774283
make completion work for command-line functions
John W. Eaton <jwe@octave.org>
parents:
12670
diff
changeset
|
790 const int total_len |
d6151d774283
make completion work for command-line functions
John W. Eaton <jwe@octave.org>
parents:
12670
diff
changeset
|
791 = key_len + bif_len + cfl_len + lcl_len + ffl_len + afl_len; |
3016 | 792 |
793 string_vector list (total_len); | |
794 | |
795 // Put all the symbols in one big list. | |
796 | |
797 int j = 0; | |
798 int i = 0; | |
799 for (i = 0; i < key_len; i++) | |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
800 list[j++] = keyword_names[i]; |
3016 | 801 |
7336 | 802 for (i = 0; i < bif_len; i++) |
803 list[j++] = bif[i]; | |
4009 | 804 |
12911
d6151d774283
make completion work for command-line functions
John W. Eaton <jwe@octave.org>
parents:
12670
diff
changeset
|
805 for (i = 0; i < cfl_len; i++) |
d6151d774283
make completion work for command-line functions
John W. Eaton <jwe@octave.org>
parents:
12670
diff
changeset
|
806 list[j++] = cfl[i]; |
d6151d774283
make completion work for command-line functions
John W. Eaton <jwe@octave.org>
parents:
12670
diff
changeset
|
807 |
3016 | 808 for (i = 0; i < lcl_len; i++) |
809 list[j++] = lcl[i]; | |
810 | |
811 for (i = 0; i < ffl_len; i++) | |
812 list[j++] = ffl[i]; | |
813 | |
5592 | 814 for (i = 0; i < afl_len; i++) |
815 list[j++] = afl[i]; | |
816 | |
3016 | 817 return list; |
818 } | |
819 | |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
820 static bool |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
821 looks_like_html (const std::string& msg) |
3014 | 822 { |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
823 const size_t p1 = msg.find ('\n'); |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
824 std::string t = msg.substr (0, p1); |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
825 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
|
826 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
827 return (p2 != std::string::npos); |
2470 | 828 } |
3014 | 829 |
830 static bool | |
3523 | 831 looks_like_texinfo (const std::string& msg, size_t& p1) |
3295 | 832 { |
833 p1 = msg.find ('\n'); | |
834 | |
3523 | 835 std::string t = msg.substr (0, p1); |
3295 | 836 |
8021 | 837 if (p1 == std::string::npos) |
3295 | 838 p1 = 0; |
839 | |
840 size_t p2 = t.find ("-*- texinfo -*-"); | |
841 | |
8021 | 842 return (p2 != std::string::npos); |
3295 | 843 } |
844 | |
3355 | 845 static bool |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11572
diff
changeset
|
846 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
|
847 std::string& w, bool& symbol_found) |
3355 | 848 { |
849 bool retval = false; | |
850 | |
7336 | 851 octave_value val = symbol_table::find_function (nm); |
3355 | 852 |
7336 | 853 if (val.is_defined ()) |
3355 | 854 { |
7336 | 855 octave_function *fcn = val.function_value (); |
856 | |
857 if (fcn) | |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
858 { |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
859 symbol_found = true; |
5399 | 860 |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
861 h = fcn->doc_string (); |
7336 | 862 |
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
|
863 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
|
864 |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
865 w = fcn->fcn_file_name (); |
6243 | 866 |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
867 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
|
868 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
|
869 ? "command-line function" : "built-in function"; |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
870 } |
6243 | 871 } |
3355 | 872 |
6243 | 873 return retval; |
874 } | |
875 | |
876 static bool | |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11572
diff
changeset
|
877 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
|
878 std::string& file, bool& symbol_found) |
6243 | 879 { |
880 bool retval = false; | |
881 | |
8672
2a49c32d4322
allow help to work with files containing only comments
John W. Eaton <jwe@octave.org>
parents:
8631
diff
changeset
|
882 // FIXME -- this is a bit of a kluge... |
10066
2cd940306a06
make unwind_protect frames local
Jaroslav Hajek <highegg@gmail.com>
parents:
9806
diff
changeset
|
883 unwind_protect frame; |
2cd940306a06
make unwind_protect frames local
Jaroslav Hajek <highegg@gmail.com>
parents:
9806
diff
changeset
|
884 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
|
885 reading_script_file = true; |
2a49c32d4322
allow help to work with files containing only comments
John W. Eaton <jwe@octave.org>
parents:
8631
diff
changeset
|
886 |
6243 | 887 h = get_help_from_file (nm, symbol_found, file); |
888 | |
889 if (h.length () > 0) | |
890 retval = true; | |
891 | |
892 return retval; | |
893 } | |
894 | |
895 static bool | |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11572
diff
changeset
|
896 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
|
897 const map_type& map, bool& symbol_found) |
3355 | 898 { |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
899 map_iter idx = map.find (nm); |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
900 symbol_found = (idx != map.end ()); |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
901 h = (symbol_found) ? idx->second : ""; |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
902 return symbol_found; |
3355 | 903 } |
904 | |
6243 | 905 std::string |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
906 raw_help (const std::string& nm, bool& symbol_found) |
6243 | 907 { |
908 std::string h; | |
909 std::string w; | |
910 std::string f; | |
911 | |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
912 (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
|
913 || 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
|
914 || 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
|
915 || raw_help_from_map (nm, h, keywords_map, symbol_found)); |
6243 | 916 |
917 return h; | |
918 } | |
919 | |
1140 | 920 static void |
9806
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
921 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
|
922 std::string& format) |
1140 | 923 { |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
924 bool symbol_found = false; |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
925 text = raw_help (name, symbol_found); |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11572
diff
changeset
|
926 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
927 format = "Not found"; |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
928 if (symbol_found) |
1140 | 929 { |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
930 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
|
931 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
|
932 { |
52956d669506
Display sensible error message when the help text of an undocumented function is requested
Soren Hauberg <hauberg@gmail.com>
parents:
8630
diff
changeset
|
933 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
|
934 } |
52956d669506
Display sensible error message when the help text of an undocumented function is requested
Soren Hauberg <hauberg@gmail.com>
parents:
8630
diff
changeset
|
935 else if (looks_like_texinfo (text, idx)) |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
936 { |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
937 format = "texinfo"; |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
938 text.erase (0, idx); |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
939 } |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
940 else if (looks_like_html (text)) |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
941 { |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
942 format = "html"; |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
943 } |
5399 | 944 else |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
945 { |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
946 format = "plain text"; |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
947 } |
1140 | 948 } |
949 } | |
950 | |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
951 DEFUN (get_help_text, args, , "-*- texinfo -*-\n\ |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
952 @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
|
953 Return the raw help text of function @var{name}.\n\ |
3168 | 954 \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
|
955 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
|
956 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
|
957 @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
|
958 @end deftypefn") |
529 | 959 { |
2086 | 960 octave_value_list retval; |
529 | 961 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
962 if (args.length () == 1) |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
963 { |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
964 const std::string name = args (0).string_value (); |
1755 | 965 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
966 if (! error_state) |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
967 { |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
968 std::string text; |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
969 std::string format; |
529 | 970 |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
971 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
|
972 |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
973 retval(1) = format; |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
974 retval(0) = text; |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
975 } |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
976 else |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
977 error ("get_help_text: invalid input"); |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
978 } |
529 | 979 else |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
980 print_usage (); |
529 | 981 |
982 return retval; | |
983 } | |
984 | |
9806
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
985 static void |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
986 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
|
987 std::string& format) |
9806
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
988 { |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
989 bool symbol_found = false; |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
990 |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
991 std::string f; |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
992 |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
993 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
|
994 |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
995 format = "Not found"; |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
996 if (symbol_found) |
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 size_t idx = -1; |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
999 if (text.empty ()) |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
1000 { |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
1001 format = "Not documented"; |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
1002 } |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
1003 else if (looks_like_texinfo (text, idx)) |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
1004 { |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
1005 format = "texinfo"; |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
1006 text.erase (0, idx); |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
1007 } |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
1008 else if (looks_like_html (text)) |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
1009 { |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
1010 format = "html"; |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
1011 } |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
1012 else |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
1013 { |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
1014 format = "plain text"; |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
1015 } |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
1016 } |
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 |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
1019 DEFUN (get_help_text_from_file, args, , |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
1020 "-*- texinfo -*-\n\ |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
1021 @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
|
1022 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
|
1023 \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
|
1024 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
|
1025 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
|
1026 @t{\"plain text\"}.\n\ |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
1027 @end deftypefn") |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
1028 { |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
1029 octave_value_list retval; |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
1030 |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
1031 if (args.length () == 1) |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
1032 { |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
1033 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
|
1034 |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
1035 if (! error_state) |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
1036 { |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
1037 std::string text; |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
1038 std::string format; |
9806
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
1039 |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
1040 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
|
1041 |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
1042 retval(1) = format; |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
1043 retval(0) = text; |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
1044 } |
9806
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
1045 else |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
1046 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
|
1047 } |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
1048 else |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
1049 print_usage (); |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
1050 |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
1051 return retval; |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
1052 } |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
1053 |
8812
7d48766c21a5
use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents:
8672
diff
changeset
|
1054 // 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
|
1055 // operators. |
7d48766c21a5
use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents:
8672
diff
changeset
|
1056 |
7d48766c21a5
use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents:
8672
diff
changeset
|
1057 DEFUN (__operators__, , , |
7d48766c21a5
use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents:
8672
diff
changeset
|
1058 "-*- texinfo -*-\n\ |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1059 @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
|
1060 Undocumented internal function.\n\ |
7d48766c21a5
use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents:
8672
diff
changeset
|
1061 @end deftypefn") |
3355 | 1062 { |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1063 return octave_value (Cell (names (operators_map))); |
3355 | 1064 } |
1065 | |
8812
7d48766c21a5
use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents:
8672
diff
changeset
|
1066 // 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
|
1067 // keywords. |
7d48766c21a5
use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents:
8672
diff
changeset
|
1068 |
7d48766c21a5
use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents:
8672
diff
changeset
|
1069 DEFUN (__keywords__, , , |
7d48766c21a5
use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents:
8672
diff
changeset
|
1070 "-*- texinfo -*-\n\ |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1071 @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
|
1072 Undocumented internal function.\n\ |
7d48766c21a5
use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents:
8672
diff
changeset
|
1073 @end deftypefn") |
581 | 1074 { |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1075 return octave_value (Cell (names (keywords_map))); |
581 | 1076 } |
1077 | |
8812
7d48766c21a5
use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents:
8672
diff
changeset
|
1078 // 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
|
1079 // functions. |
7d48766c21a5
use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents:
8672
diff
changeset
|
1080 |
7d48766c21a5
use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents:
8672
diff
changeset
|
1081 DEFUN (__builtins__, , , |
7d48766c21a5
use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents:
8672
diff
changeset
|
1082 "-*- texinfo -*-\n\ |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1083 @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
|
1084 Undocumented internal function.\n\ |
7d48766c21a5
use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents:
8672
diff
changeset
|
1085 @end deftypefn") |
3355 | 1086 { |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1087 const string_vector bif = symbol_table::built_in_function_names (); |
3355 | 1088 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1089 return octave_value (Cell (bif)); |
3355 | 1090 } |
1091 | |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1092 static std::string |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1093 do_which (const std::string& name, std::string& type) |
3355 | 1094 { |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1095 std::string file; |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1096 |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1097 type = std::string (); |
3355 | 1098 |
7336 | 1099 octave_value val = symbol_table::find_function (name); |
1100 | |
9416
2cc47338e427
allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents:
9377
diff
changeset
|
1101 if (name.find_first_of ('.') == std::string::npos) |
3355 | 1102 { |
9416
2cc47338e427
allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents:
9377
diff
changeset
|
1103 if (val.is_defined ()) |
2cc47338e427
allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents:
9377
diff
changeset
|
1104 { |
2cc47338e427
allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents:
9377
diff
changeset
|
1105 octave_function *fcn = val.function_value (); |
7336 | 1106 |
9416
2cc47338e427
allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents:
9377
diff
changeset
|
1107 if (fcn) |
2cc47338e427
allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents:
9377
diff
changeset
|
1108 { |
2cc47338e427
allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents:
9377
diff
changeset
|
1109 file = fcn->fcn_file_name (); |
3355 | 1110 |
9416
2cc47338e427
allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents:
9377
diff
changeset
|
1111 if (file.empty ()) |
2cc47338e427
allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents:
9377
diff
changeset
|
1112 { |
2cc47338e427
allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents:
9377
diff
changeset
|
1113 if (fcn->is_user_function ()) |
2cc47338e427
allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents:
9377
diff
changeset
|
1114 type = "command-line function"; |
2cc47338e427
allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents:
9377
diff
changeset
|
1115 else |
2cc47338e427
allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents:
9377
diff
changeset
|
1116 type = "built-in function"; |
2cc47338e427
allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents:
9377
diff
changeset
|
1117 } |
2cc47338e427
allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents:
9377
diff
changeset
|
1118 else |
2cc47338e427
allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents:
9377
diff
changeset
|
1119 type = val.is_user_script () |
2cc47338e427
allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents:
9377
diff
changeset
|
1120 ? std::string ("script") : std::string ("function"); |
2cc47338e427
allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents:
9377
diff
changeset
|
1121 } |
2cc47338e427
allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents:
9377
diff
changeset
|
1122 } |
2cc47338e427
allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents:
9377
diff
changeset
|
1123 else |
2cc47338e427
allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents:
9377
diff
changeset
|
1124 { |
2cc47338e427
allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents:
9377
diff
changeset
|
1125 // 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
|
1126 |
2cc47338e427
allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents:
9377
diff
changeset
|
1127 file = load_path::find_fcn_file (name); |
2cc47338e427
allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents:
9377
diff
changeset
|
1128 } |
7336 | 1129 } |
8672
2a49c32d4322
allow help to work with files containing only comments
John W. Eaton <jwe@octave.org>
parents:
8631
diff
changeset
|
1130 else |
2a49c32d4322
allow help to work with files containing only comments
John W. Eaton <jwe@octave.org>
parents:
8631
diff
changeset
|
1131 { |
9416
2cc47338e427
allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents:
9377
diff
changeset
|
1132 // File query. |
8672
2a49c32d4322
allow help to work with files containing only comments
John W. Eaton <jwe@octave.org>
parents:
8631
diff
changeset
|
1133 |
9416
2cc47338e427
allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents:
9377
diff
changeset
|
1134 // For compatibility: "file." queries "file". |
2cc47338e427
allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents:
9377
diff
changeset
|
1135 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
|
1136 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
|
1137 else |
2cc47338e427
allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents:
9377
diff
changeset
|
1138 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
|
1139 } |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1140 |
9416
2cc47338e427
allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents:
9377
diff
changeset
|
1141 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1142 return file; |
3355 | 1143 } |
1144 | |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1145 std::string |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1146 do_which (const std::string& name) |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1147 { |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1148 std::string retval; |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1149 |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1150 std::string type; |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1151 |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1152 retval = do_which (name, type); |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1153 |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1154 return retval; |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1155 } |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1156 |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1157 DEFUN (__which__, args, , |
3361 | 1158 "-*- texinfo -*-\n\ |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1159 @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
|
1160 Undocumented internal function.\n\ |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1161 @end deftypefn") |
581 | 1162 { |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1163 octave_value retval; |
581 | 1164 |
1968 | 1165 string_vector argv = args.make_argv ("which"); |
1755 | 1166 |
3355 | 1167 if (! error_state) |
1168 { | |
1169 int argc = argv.length (); | |
581 | 1170 |
3355 | 1171 if (argc > 1) |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
1172 { |
11059
4ffa19147604
replace Octave_map->octave_scalar_map in help.cc and load-save.cc
Jaroslav Hajek <highegg@gmail.com>
parents:
10840
diff
changeset
|
1173 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
|
1174 |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
1175 Cell names (1, argc-1); |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
1176 Cell files (1, argc-1); |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
1177 Cell types (1, argc-1); |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1178 |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
1179 for (int i = 1; i < argc; i++) |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
1180 { |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
1181 std::string name = argv[i]; |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1182 |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
1183 std::string type; |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1184 |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
1185 std::string file = do_which (name, type); |
3141 | 1186 |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
1187 names(i-1) = name; |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
1188 files(i-1) = file; |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
1189 types(i-1) = type; |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
1190 } |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1191 |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
1192 m.assign ("name", names); |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
1193 m.assign ("file", files); |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
1194 m.assign ("type", types); |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1195 |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
1196 retval = m; |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
1197 } |
3355 | 1198 else |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
1199 print_usage (); |
581 | 1200 } |
1201 | |
1202 return retval; | |
1203 } | |
1204 | |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1205 // 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
|
1206 inline bool |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1207 file_is_in_dir (const std::string filename, const std::string dir) |
5447 | 1208 { |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1209 if (filename.find (dir) == 0) |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1210 { |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1211 const int dir_len = dir.size (); |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1212 const int filename_len = filename.size (); |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1213 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
|
1214 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1215 int num_seps = 0; |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1216 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
|
1217 if (file_ops::is_dir_sep (filename [i])) |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1218 num_seps ++; |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11572
diff
changeset
|
1219 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1220 return (num_seps <= max_allowed_seps); |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1221 } |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1222 else |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1223 return false; |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1224 } |
5447 | 1225 |
8812
7d48766c21a5
use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents:
8672
diff
changeset
|
1226 // 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
|
1227 // 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
|
1228 // the current path. |
7d48766c21a5
use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents:
8672
diff
changeset
|
1229 |
7d48766c21a5
use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents:
8672
diff
changeset
|
1230 DEFUN (__list_functions__, args, , |
7d48766c21a5
use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents:
8672
diff
changeset
|
1231 "-*- texinfo -*-\n\ |
10840 | 1232 @deftypefn {Function File} {@var{retval} =} __list_functions__ ()\n\ |
1233 @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
|
1234 Undocumented internal function.\n\ |
7d48766c21a5
use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents:
8672
diff
changeset
|
1235 @end deftypefn") |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1236 { |
8863
34a821854961
pkg.m (generate_lookfor_cache): generate a DOC file for each directory
Jason Riedy <jason@acm.org>
parents:
8861
diff
changeset
|
1237 octave_value retval; |
5447 | 1238 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1239 // 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
|
1240 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
|
1241 string_vector afl = autoloaded_functions (); |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11572
diff
changeset
|
1242 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1243 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
|
1244 retval = Cell (ffl.append (afl)); |
5447 | 1245 else |
1246 { | |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1247 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
|
1248 |
34a821854961
pkg.m (generate_lookfor_cache): generate a DOC file for each directory
Jason Riedy <jason@acm.org>
parents:
8861
diff
changeset
|
1249 if (! error_state) |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
1250 { |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
1251 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
|
1252 |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
1253 if (! error_state) |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
1254 { |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
1255 // 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
|
1256 // .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
|
1257 // directory, for example). |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
1258 fl.sort (true); |
9261
95445f9f5976
omit file extensions from __list_functions__ output
John W. Eaton <jwe@octave.org>
parents:
9133
diff
changeset
|
1259 |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
1260 retval = Cell (fl); |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
1261 } |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
1262 } |
5447 | 1263 else |
12483
7a5aacf65f81
Rewrite error strings in src/ to use variables named in documentation.
Rik <octave@nomad.inbox5.com>
parents:
11586
diff
changeset
|
1264 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
|
1265 } |
5447 | 1266 |
1267 return retval; | |
1268 } | |
1269 | |
8861 | 1270 DEFUN (doc_cache_file, args, nargout, |
1271 "-*- texinfo -*-\n\ | |
10840 | 1272 @deftypefn {Built-in Function} {@var{val} =} doc_cache_file ()\n\ |
8861 | 1273 @deftypefnx {Built-in Function} {@var{old_val} =} doc_cache_file (@var{new_val})\n\ |
13951
79aa00a94e9e
doc: Document "local" option for configuration variables.
Rik <octave@nomad.inbox5.com>
parents:
13773
diff
changeset
|
1274 @deftypefnx {Built-in Function} {} doc_cache_file (@var{new_val}, \"local\")\n\ |
8861 | 1275 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
|
1276 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
|
1277 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
|
1278 @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
|
1279 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
|
1280 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
|
1281 The default value may be overridden by the environment variable\n\ |
10840 | 1282 @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
|
1283 @samp{--doc-cache-file NAME}.\n\ |
13951
79aa00a94e9e
doc: Document "local" option for configuration variables.
Rik <octave@nomad.inbox5.com>
parents:
13773
diff
changeset
|
1284 \n\ |
79aa00a94e9e
doc: Document "local" option for configuration variables.
Rik <octave@nomad.inbox5.com>
parents:
13773
diff
changeset
|
1285 When called from inside a function with the \"local\" option, the variable is\n\ |
79aa00a94e9e
doc: Document "local" option for configuration variables.
Rik <octave@nomad.inbox5.com>
parents:
13773
diff
changeset
|
1286 changed locally for the function and any subroutines it calls. The original\n\ |
79aa00a94e9e
doc: Document "local" option for configuration variables.
Rik <octave@nomad.inbox5.com>
parents:
13773
diff
changeset
|
1287 variable value is restored when exiting the function.\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
|
1288 @seealso{lookfor, info_program, doc, help, makeinfo_program}\n\ |
8861 | 1289 @end deftypefn") |
1290 { | |
1291 return SET_NONEMPTY_INTERNAL_STRING_VARIABLE (doc_cache_file); | |
1292 } | |
1293 | |
5794 | 1294 DEFUN (info_file, args, nargout, |
1295 "-*- texinfo -*-\n\ | |
10840 | 1296 @deftypefn {Built-in Function} {@var{val} =} info_file ()\n\ |
5794 | 1297 @deftypefnx {Built-in Function} {@var{old_val} =} info_file (@var{new_val})\n\ |
13951
79aa00a94e9e
doc: Document "local" option for configuration variables.
Rik <octave@nomad.inbox5.com>
parents:
13773
diff
changeset
|
1298 @deftypefnx {Built-in Function} {} info_file (@var{new_val}, \"local\")\n\ |
5794 | 1299 Query or set the internal variable that specifies the name of the\n\ |
1300 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
|
1301 @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
|
1302 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
|
1303 The default value may be overridden by the environment variable\n\ |
10840 | 1304 @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
|
1305 @samp{--info-file NAME}.\n\ |
13951
79aa00a94e9e
doc: Document "local" option for configuration variables.
Rik <octave@nomad.inbox5.com>
parents:
13773
diff
changeset
|
1306 \n\ |
79aa00a94e9e
doc: Document "local" option for configuration variables.
Rik <octave@nomad.inbox5.com>
parents:
13773
diff
changeset
|
1307 When called from inside a function with the \"local\" option, the variable is\n\ |
79aa00a94e9e
doc: Document "local" option for configuration variables.
Rik <octave@nomad.inbox5.com>
parents:
13773
diff
changeset
|
1308 changed locally for the function and any subroutines it calls. The original\n\ |
79aa00a94e9e
doc: Document "local" option for configuration variables.
Rik <octave@nomad.inbox5.com>
parents:
13773
diff
changeset
|
1309 variable value is restored when exiting the function.\n\ |
5794 | 1310 @seealso{info_program, doc, help, makeinfo_program}\n\ |
1311 @end deftypefn") | |
2202 | 1312 { |
5794 | 1313 return SET_NONEMPTY_INTERNAL_STRING_VARIABLE (info_file); |
2202 | 1314 } |
1315 | |
5794 | 1316 DEFUN (info_program, args, nargout, |
1317 "-*- texinfo -*-\n\ | |
10840 | 1318 @deftypefn {Built-in Function} {@var{val} =} info_program ()\n\ |
5794 | 1319 @deftypefnx {Built-in Function} {@var{old_val} =} info_program (@var{new_val})\n\ |
13951
79aa00a94e9e
doc: Document "local" option for configuration variables.
Rik <octave@nomad.inbox5.com>
parents:
13773
diff
changeset
|
1320 @deftypefnx {Built-in Function} {} info_program (@var{new_val}, \"local\")\n\ |
5794 | 1321 Query or set the internal variable that specifies the name of the\n\ |
7096 | 1322 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
|
1323 @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
|
1324 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
|
1325 @var{version} is the Octave version number, and @var{arch}\n\ |
3686 | 1326 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
|
1327 default value may be overridden by the environment variable\n\ |
10840 | 1328 @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
|
1329 @samp{--info-program NAME}.\n\ |
13951
79aa00a94e9e
doc: Document "local" option for configuration variables.
Rik <octave@nomad.inbox5.com>
parents:
13773
diff
changeset
|
1330 \n\ |
79aa00a94e9e
doc: Document "local" option for configuration variables.
Rik <octave@nomad.inbox5.com>
parents:
13773
diff
changeset
|
1331 When called from inside a function with the \"local\" option, the variable is\n\ |
79aa00a94e9e
doc: Document "local" option for configuration variables.
Rik <octave@nomad.inbox5.com>
parents:
13773
diff
changeset
|
1332 changed locally for the function and any subroutines it calls. The original\n\ |
79aa00a94e9e
doc: Document "local" option for configuration variables.
Rik <octave@nomad.inbox5.com>
parents:
13773
diff
changeset
|
1333 variable value is restored when exiting the function.\n\ |
5794 | 1334 @seealso{info_file, doc, help, makeinfo_program}\n\ |
1335 @end deftypefn") | |
1336 { | |
1337 return SET_NONEMPTY_INTERNAL_STRING_VARIABLE (info_program); | |
1338 } | |
3686 | 1339 |
5794 | 1340 DEFUN (makeinfo_program, args, nargout, |
1341 "-*- texinfo -*-\n\ | |
10840 | 1342 @deftypefn {Built-in Function} {@var{val} =} makeinfo_program ()\n\ |
5794 | 1343 @deftypefnx {Built-in Function} {@var{old_val} =} makeinfo_program (@var{new_val})\n\ |
13951
79aa00a94e9e
doc: Document "local" option for configuration variables.
Rik <octave@nomad.inbox5.com>
parents:
13773
diff
changeset
|
1344 @deftypefnx {Built-in Function} {} makeinfo_program (@var{new_val}, \"local\")\n\ |
5794 | 1345 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
|
1346 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
|
1347 Texinfo markup commands. The default value is @code{makeinfo}.\n\ |
13951
79aa00a94e9e
doc: Document "local" option for configuration variables.
Rik <octave@nomad.inbox5.com>
parents:
13773
diff
changeset
|
1348 \n\ |
79aa00a94e9e
doc: Document "local" option for configuration variables.
Rik <octave@nomad.inbox5.com>
parents:
13773
diff
changeset
|
1349 When called from inside a function with the \"local\" option, the variable is\n\ |
79aa00a94e9e
doc: Document "local" option for configuration variables.
Rik <octave@nomad.inbox5.com>
parents:
13773
diff
changeset
|
1350 changed locally for the function and any subroutines it calls. The original\n\ |
79aa00a94e9e
doc: Document "local" option for configuration variables.
Rik <octave@nomad.inbox5.com>
parents:
13773
diff
changeset
|
1351 variable value is restored when exiting the function.\n\ |
5794 | 1352 @seealso{info_file, info_program, doc, help}\n\ |
1353 @end deftypefn") | |
1354 { | |
1355 return SET_NONEMPTY_INTERNAL_STRING_VARIABLE (makeinfo_program); | |
1356 } | |
2202 | 1357 |
5794 | 1358 DEFUN (suppress_verbose_help_message, args, nargout, |
1359 "-*- texinfo -*-\n\ | |
10840 | 1360 @deftypefn {Built-in Function} {@var{val} =} suppress_verbose_help_message ()\n\ |
5794 | 1361 @deftypefnx {Built-in Function} {@var{old_val} =} suppress_verbose_help_message (@var{new_val})\n\ |
13951
79aa00a94e9e
doc: Document "local" option for configuration variables.
Rik <octave@nomad.inbox5.com>
parents:
13773
diff
changeset
|
1362 @deftypefnx {Built-in Function} {} suppress_verbose_help_message (@var{new_val}, \"local\")\n\ |
7001 | 1363 Query or set the internal variable that controls whether Octave\n\ |
5794 | 1364 will add additional help information to the end of the output from\n\ |
3332 | 1365 the @code{help} command and usage messages for built-in commands.\n\ |
13951
79aa00a94e9e
doc: Document "local" option for configuration variables.
Rik <octave@nomad.inbox5.com>
parents:
13773
diff
changeset
|
1366 \n\ |
79aa00a94e9e
doc: Document "local" option for configuration variables.
Rik <octave@nomad.inbox5.com>
parents:
13773
diff
changeset
|
1367 When called from inside a function with the \"local\" option, the variable is\n\ |
79aa00a94e9e
doc: Document "local" option for configuration variables.
Rik <octave@nomad.inbox5.com>
parents:
13773
diff
changeset
|
1368 changed locally for the function and any subroutines it calls. The original\n\ |
79aa00a94e9e
doc: Document "local" option for configuration variables.
Rik <octave@nomad.inbox5.com>
parents:
13773
diff
changeset
|
1369 variable value is restored when exiting the function.\n\ |
5794 | 1370 @end deftypefn") |
1371 { | |
1372 return SET_INTERNAL_VARIABLE (suppress_verbose_help_message); | |
2189 | 1373 } |