Mercurial > octave-nkf
annotate libinterp/corefcn/help.cc @ 20609:780431fc4137
linspace: add tests for the use of vectors as base and limit.
author | Carnë Draug <carandraug@octave.org> |
---|---|
date | Thu, 08 Oct 2015 20:06:45 +0100 |
parents | a9574e3c6e9e |
children | fd0efcdb3718 |
rev | line source |
---|---|
1 | 1 /* |
2 | |
19731
4197fc428c7d
maint: Update copyright notices for 2015.
John W. Eaton <jwe@octave.org>
parents:
19437
diff
changeset
|
3 Copyright (C) 1993-2015 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" |
19303
65554f5847ac
don't include oct-locbuf.h in header files unnecessarily
John W. Eaton <jwe@octave.org>
parents:
19186
diff
changeset
|
43 #include "oct-locbuf.h" |
1755 | 44 #include "str-vec.h" |
45 | |
2492 | 46 #include <defaults.h> |
1352 | 47 #include "defun.h" |
48 #include "dirfns.h" | |
49 #include "error.h" | |
2202 | 50 #include "gripes.h" |
1352 | 51 #include "help.h" |
2177 | 52 #include "input.h" |
5832 | 53 #include "load-path.h" |
1755 | 54 #include "oct-obj.h" |
2976 | 55 #include "ov-usr-fcn.h" |
1352 | 56 #include "pager.h" |
3018 | 57 #include "parse.h" |
1466 | 58 #include "pathsearch.h" |
3295 | 59 #include "procstream.h" |
7336 | 60 #include "pt-pr-code.h" |
529 | 61 #include "sighandlers.h" |
62 #include "symtab.h" | |
2694 | 63 #include "syswait.h" |
1755 | 64 #include "toplev.h" |
8672
2a49c32d4322
allow help to work with files containing only comments
John W. Eaton <jwe@octave.org>
parents:
8631
diff
changeset
|
65 #include "unwind-prot.h" |
242 | 66 #include "utils.h" |
1352 | 67 #include "variables.h" |
3301 | 68 #include "version.h" |
5447 | 69 #include "quit.h" |
529 | 70 |
8861 | 71 // Name of the doc cache file specified on the command line. |
72 // (--doc-cache-file file) | |
73 std::string Vdoc_cache_file; | |
74 | |
14614
4e9dc46d4125
handle texinfo macros consistently in help system and manual
John W. Eaton <jwe@octave.org>
parents:
14360
diff
changeset
|
75 // Name of the file containing local Texinfo macros that are prepended |
4e9dc46d4125
handle texinfo macros consistently in help system and manual
John W. Eaton <jwe@octave.org>
parents:
14360
diff
changeset
|
76 // to doc strings before processing. |
4e9dc46d4125
handle texinfo macros consistently in help system and manual
John W. Eaton <jwe@octave.org>
parents:
14360
diff
changeset
|
77 // (--texi-macros-file) |
4e9dc46d4125
handle texinfo macros consistently in help system and manual
John W. Eaton <jwe@octave.org>
parents:
14360
diff
changeset
|
78 std::string Vtexi_macros_file; |
4e9dc46d4125
handle texinfo macros consistently in help system and manual
John W. Eaton <jwe@octave.org>
parents:
14360
diff
changeset
|
79 |
2202 | 80 // Name of the info file specified on command line. |
81 // (--info-file file) | |
3523 | 82 std::string Vinfo_file; |
2202 | 83 |
84 // Name of the info reader we'd like to use. | |
85 // (--info-program program) | |
5794 | 86 std::string Vinfo_program; |
2202 | 87 |
3686 | 88 // Name of the makeinfo program to run. |
5794 | 89 static std::string Vmakeinfo_program = "makeinfo"; |
3686 | 90 |
2189 | 91 // If TRUE, don't print additional help message in help and usage |
92 // functions. | |
5794 | 93 static bool Vsuppress_verbose_help_message = false; |
2189 | 94 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
95 #include <map> |
3016 | 96 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
97 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
|
98 typedef map_type::value_type pair_type; |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
99 typedef map_type::const_iterator map_iter; |
3016 | 100 |
19907
d575cd1e0da7
Replace std::size_t with bare size_t for conformity to rest of code.
Rik <rik@octave.org>
parents:
19895
diff
changeset
|
101 template<typename T, size_t z> |
d575cd1e0da7
Replace std::size_t with bare size_t for conformity to rest of code.
Rik <rik@octave.org>
parents:
19895
diff
changeset
|
102 size_t |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
103 size (T const (&)[z]) |
1 | 104 { |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
105 return z; |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
106 } |
1 | 107 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
108 const static pair_type operators[] = |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
109 { |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
110 pair_type ("!", |
19895
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19731
diff
changeset
|
111 "-*- texinfo -*-\n\ |
12670
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
112 @deftypefn {Operator} {} !\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
113 Logical 'not' operator.\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
114 @seealso{~, not}\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
115 @end deftypefn"), |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
116 |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
117 pair_type ("~", |
19895
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19731
diff
changeset
|
118 "-*- texinfo -*-\n\ |
12670
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
119 @deftypefn {Operator} {} ~\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
120 Logical 'not' operator.\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
121 @seealso{!, not}\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
122 @end deftypefn"), |
1 | 123 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
124 pair_type ("!=", |
19895
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19731
diff
changeset
|
125 "-*- texinfo -*-\n\ |
12670
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
126 @deftypefn {Operator} {} !=\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
127 Logical 'not equals' operator.\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
128 @seealso{~=, ne}\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
129 @end deftypefn"), |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
130 |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
131 pair_type ("~=", |
19895
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19731
diff
changeset
|
132 "-*- texinfo -*-\n\ |
12670
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
133 @deftypefn {Operator} {} ~=\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
134 Logical 'not equals' operator.\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
135 @seealso{!=, ne}\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
136 @end deftypefn"), |
1 | 137 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
138 pair_type ("\"", |
19895
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19731
diff
changeset
|
139 "-*- texinfo -*-\n\ |
12670
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 String delimiter.\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
142 @end deftypefn"), |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
143 |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
144 pair_type ("#", |
19895
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19731
diff
changeset
|
145 "-*- texinfo -*-\n\ |
12670
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
146 @deftypefn {Operator} {} #\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
147 Begin comment character.\n\ |
14766
877263efaacc
doc: Fix bug with Texinfo special characters within Seealso macro.
Rik <octave@nomad.inbox5.com>
parents:
14618
diff
changeset
|
148 @seealso{%, #@\\{}\n\ |
12670
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
149 @end deftypefn"), |
1 | 150 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
151 pair_type ("%", |
19895
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19731
diff
changeset
|
152 "-*- texinfo -*-\n\ |
12670
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
153 @deftypefn {Operator} {} %\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
154 Begin comment character.\n\ |
14766
877263efaacc
doc: Fix bug with Texinfo special characters within Seealso macro.
Rik <octave@nomad.inbox5.com>
parents:
14618
diff
changeset
|
155 @seealso{#, %@\\{}\n\ |
12670
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
156 @end deftypefn"), |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
157 |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
158 pair_type ("#{", |
19895
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19731
diff
changeset
|
159 "-*- texinfo -*-\n\ |
12670
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
160 @deftypefn {Operator} {} #@{\n\ |
13773
59e5f8e1d516
Fix block comment Texinfo not appearing in documentation
Rik <octave@nomad.inbox5.com>
parents:
13749
diff
changeset
|
161 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
|
162 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
|
163 It is possible to nest block comments.\n\ |
14766
877263efaacc
doc: Fix bug with Texinfo special characters within Seealso macro.
Rik <octave@nomad.inbox5.com>
parents:
14618
diff
changeset
|
164 @seealso{%@\\{, #@\\}, #}\n\ |
12670
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
165 @end deftypefn"), |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
166 |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
167 pair_type ("%{", |
19895
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19731
diff
changeset
|
168 "-*- texinfo -*-\n\ |
12670
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
169 @deftypefn {Operator} {} %@{\n\ |
13773
59e5f8e1d516
Fix block comment Texinfo not appearing in documentation
Rik <octave@nomad.inbox5.com>
parents:
13749
diff
changeset
|
170 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
|
171 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
|
172 It is possible to nest block comments.\n\ |
14766
877263efaacc
doc: Fix bug with Texinfo special characters within Seealso macro.
Rik <octave@nomad.inbox5.com>
parents:
14618
diff
changeset
|
173 @seealso{#@\\{, %@\\}, %}\n\ |
12670
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
174 @end deftypefn"), |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
175 |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
176 pair_type ("#}", |
19895
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19731
diff
changeset
|
177 "-*- texinfo -*-\n\ |
12670
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
178 @deftypefn {Operator} {} #@}\n\ |
13773
59e5f8e1d516
Fix block comment Texinfo not appearing in documentation
Rik <octave@nomad.inbox5.com>
parents:
13749
diff
changeset
|
179 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
|
180 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
|
181 It is possible to nest block comments.\n\ |
14766
877263efaacc
doc: Fix bug with Texinfo special characters within Seealso macro.
Rik <octave@nomad.inbox5.com>
parents:
14618
diff
changeset
|
182 @seealso{%@\\}, #@\\{, #}\n\ |
12670
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
183 @end deftypefn"), |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
184 |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
185 pair_type ("%}", |
19895
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19731
diff
changeset
|
186 "-*- texinfo -*-\n\ |
12670
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
187 @deftypefn {Operator} {} %@}\n\ |
13773
59e5f8e1d516
Fix block comment Texinfo not appearing in documentation
Rik <octave@nomad.inbox5.com>
parents:
13749
diff
changeset
|
188 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
|
189 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
|
190 It is possible to nest block comments.\n\ |
14766
877263efaacc
doc: Fix bug with Texinfo special characters within Seealso macro.
Rik <octave@nomad.inbox5.com>
parents:
14618
diff
changeset
|
191 @seealso{#@\\}, %@\\{, %}\n\ |
12670
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
192 @end deftypefn"), |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
193 |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
194 pair_type ("...", |
19895
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19731
diff
changeset
|
195 "-*- texinfo -*-\n\ |
12670
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
196 @deftypefn {Operator} {} ...\n\ |
13773
59e5f8e1d516
Fix block comment Texinfo not appearing in documentation
Rik <octave@nomad.inbox5.com>
parents:
13749
diff
changeset
|
197 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
|
198 @end deftypefn"), |
1 | 199 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
200 pair_type ("&", |
19895
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19731
diff
changeset
|
201 "-*- texinfo -*-\n\ |
12670
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
202 @deftypefn {Operator} {} &\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
203 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
|
204 @seealso{&&, and}\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
205 @end deftypefn"), |
1 | 206 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
207 pair_type ("&&", |
19895
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19731
diff
changeset
|
208 "-*- texinfo -*-\n\ |
12670
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
209 @deftypefn {Operator} {} &&\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
210 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
|
211 @seealso{&, and}\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
212 @end deftypefn"), |
1 | 213 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
214 pair_type ("'", |
19895
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19731
diff
changeset
|
215 "-*- texinfo -*-\n\ |
12670
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
216 @deftypefn {Operator} {} '\n\ |
13773
59e5f8e1d516
Fix block comment Texinfo not appearing in documentation
Rik <octave@nomad.inbox5.com>
parents:
13749
diff
changeset
|
217 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
|
218 complex conjugate (Hermitian) transpose.\n\ |
1 | 219 \n\ |
220 The single quote character may also be used to delimit strings, but\n\ | |
221 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
|
222 ambiguous.\n\ |
12670
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
223 @seealso{.', transpose}\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 ("(", |
19895
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19731
diff
changeset
|
227 "-*- texinfo -*-\n\ |
12670
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 (")", |
19895
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19731
diff
changeset
|
233 "-*- texinfo -*-\n\ |
18712
6113e0c6920b
maint: Clean up extra spaces before/after parentheses.
Rik <rik@octave.org>
parents:
18232
diff
changeset
|
234 @deftypefn {Operator} {})\n\ |
12670
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
235 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
|
236 @end deftypefn"), |
1 | 237 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
238 pair_type ("*", |
19895
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19731
diff
changeset
|
239 "-*- texinfo -*-\n\ |
12670
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
240 @deftypefn {Operator} {} *\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
241 Multiplication operator.\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
242 @seealso{.*, times}\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
243 @end deftypefn"), |
1 | 244 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
245 pair_type ("**", |
19895
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19731
diff
changeset
|
246 "-*- texinfo -*-\n\ |
12670
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
247 @deftypefn {Operator} {} **\n\ |
14171
2ced2f59f523
doc: miscellaneous documentation improvements
Rik <octave@nomad.inbox5.com>
parents:
14169
diff
changeset
|
248 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
|
249 @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
|
250 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
|
251 @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
|
252 @end deftypefn"), |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
253 |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
254 pair_type ("^", |
19895
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19731
diff
changeset
|
255 "-*- texinfo -*-\n\ |
12670
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
256 @deftypefn {Operator} {} ^\n\ |
14171
2ced2f59f523
doc: miscellaneous documentation improvements
Rik <octave@nomad.inbox5.com>
parents:
14169
diff
changeset
|
257 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
|
258 @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
|
259 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
|
260 @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
|
261 @end deftypefn"), |
1 | 262 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
263 pair_type ("+", |
19895
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19731
diff
changeset
|
264 "-*- texinfo -*-\n\ |
12670
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
265 @deftypefn {Operator} {} +\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
266 Addition operator.\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
267 @seealso{plus}\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
268 @end deftypefn"), |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
269 |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
270 pair_type ("++", |
19895
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19731
diff
changeset
|
271 "-*- texinfo -*-\n\ |
12670
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
272 @deftypefn {Operator} {} ++\n\ |
13773
59e5f8e1d516
Fix block comment Texinfo not appearing in documentation
Rik <octave@nomad.inbox5.com>
parents:
13749
diff
changeset
|
273 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
|
274 operator.\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
275 @seealso{--}\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 (",", |
19895
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19731
diff
changeset
|
279 "-*- texinfo -*-\n\ |
12670
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 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
|
282 @end deftypefn"), |
1 | 283 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
284 pair_type ("-", |
19895
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19731
diff
changeset
|
285 "-*- texinfo -*-\n\ |
12670
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
286 @deftypefn {Operator} {} -\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
287 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
|
288 @seealso{minus}\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
289 @end deftypefn"), |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
290 |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
291 pair_type ("--", |
19895
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19731
diff
changeset
|
292 "-*- texinfo -*-\n\ |
12670
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
293 @deftypefn {Operator} {} --\n\ |
13773
59e5f8e1d516
Fix block comment Texinfo not appearing in documentation
Rik <octave@nomad.inbox5.com>
parents:
13749
diff
changeset
|
294 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
|
295 operator.\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
296 @seealso{++}\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
297 @end deftypefn"), |
1 | 298 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
299 pair_type (".'", |
19895
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19731
diff
changeset
|
300 "-*- texinfo -*-\n\ |
12670
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
301 @deftypefn {Operator} {} .'\n\ |
13773
59e5f8e1d516
Fix block comment Texinfo not appearing in documentation
Rik <octave@nomad.inbox5.com>
parents:
13749
diff
changeset
|
302 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
|
303 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
|
304 @seealso{', transpose}\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
305 @end deftypefn"), |
1 | 306 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
307 pair_type (".*", |
19895
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19731
diff
changeset
|
308 "-*- texinfo -*-\n\ |
12670
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
309 @deftypefn {Operator} {} .*\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
310 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
|
311 @seealso{*, times}\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
312 @end deftypefn"), |
1 | 313 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
314 pair_type (".**", |
19895
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19731
diff
changeset
|
315 "-*- texinfo -*-\n\ |
12670
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
316 @deftypefn {Operator} {} .*\n\ |
14171
2ced2f59f523
doc: miscellaneous documentation improvements
Rik <octave@nomad.inbox5.com>
parents:
14169
diff
changeset
|
317 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
|
318 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
|
319 @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
|
320 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
|
321 @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
|
322 @end deftypefn"), |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
323 |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
324 pair_type (".^", |
19895
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19731
diff
changeset
|
325 "-*- texinfo -*-\n\ |
12670
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
326 @deftypefn {Operator} {} .^\n\ |
14171
2ced2f59f523
doc: miscellaneous documentation improvements
Rik <octave@nomad.inbox5.com>
parents:
14169
diff
changeset
|
327 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
|
328 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
|
329 @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
|
330 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
|
331 @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
|
332 @end deftypefn"), |
1 | 333 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
334 pair_type ("./", |
19895
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19731
diff
changeset
|
335 "-*- texinfo -*-\n\ |
12670
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
336 @deftypefn {Operator} {} ./\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
337 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
|
338 @seealso{/, .\\, rdivide, mrdivide}\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
339 @end deftypefn"), |
1 | 340 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
341 pair_type ("/", |
19895
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19731
diff
changeset
|
342 "-*- texinfo -*-\n\ |
12670
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
343 @deftypefn {Operator} {} /\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
344 Right division operator.\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
345 @seealso{./, \\, rdivide, mrdivide}\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
346 @end deftypefn"), |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
347 |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
348 pair_type (".\\", |
19895
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19731
diff
changeset
|
349 "-*- texinfo -*-\n\ |
12670
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
350 @deftypefn {Operator} {} .\\\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
351 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
|
352 @seealso{\\, ./, rdivide, mrdivide}\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
353 @end deftypefn"), |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
354 |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
355 pair_type ("\\", |
19895
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19731
diff
changeset
|
356 "-*- texinfo -*-\n\ |
12670
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
357 @deftypefn {Operator} {} \\\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
358 Left division operator.\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
359 @seealso{.\\, /, ldivide, mldivide}\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 (":", |
19895
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19731
diff
changeset
|
363 "-*- texinfo -*-\n\ |
12670
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 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
|
366 @end deftypefn"), |
1 | 367 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
368 pair_type (";", |
19895
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19731
diff
changeset
|
369 "-*- texinfo -*-\n\ |
12670
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
370 @deftypefn {Operator} {} ;\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
371 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
|
372 @seealso{,}\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
373 @end deftypefn"), |
1 | 374 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
375 pair_type ("<", |
19895
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19731
diff
changeset
|
376 "-*- texinfo -*-\n\ |
12670
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
377 @deftypefn {Operator} {} <\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
378 'Less than' operator.\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
379 @seealso{lt}\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
380 @end deftypefn"), |
1 | 381 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
382 pair_type ("<=", |
19895
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19731
diff
changeset
|
383 "-*- texinfo -*-\n\ |
12670
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
384 @deftypefn {Operator} {} <=\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
385 '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
|
386 @seealso{le}\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 ("=", |
19895
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19731
diff
changeset
|
390 "-*- texinfo -*-\n\ |
12670
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 Assignment operator.\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
393 @end deftypefn"), |
1 | 394 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
395 pair_type ("==", |
19895
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19731
diff
changeset
|
396 "-*- texinfo -*-\n\ |
12670
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
397 @deftypefn {Operator} {} ==\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
398 Equality test operator.\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
399 @seealso{eq}\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
400 @end deftypefn"), |
1 | 401 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
402 pair_type (">", |
19895
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19731
diff
changeset
|
403 "-*- texinfo -*-\n\ |
12670
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
404 @deftypefn {Operator} {} >\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
405 'Greater than' operator.\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
406 @seealso{gt}\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
407 @end deftypefn"), |
1 | 408 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
409 pair_type (">=", |
19895
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19731
diff
changeset
|
410 "-*- texinfo -*-\n\ |
12670
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
411 @deftypefn {Operator} {} >=\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
412 '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
|
413 @seealso{ge}\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
414 @end deftypefn"), |
1 | 415 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
416 pair_type ("[", |
19895
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19731
diff
changeset
|
417 "-*- texinfo -*-\n\ |
12670
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
418 @deftypefn {Operator} {} [\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
419 Return list delimiter.\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
420 @seealso{]}\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
421 @end deftypefn"), |
1 | 422 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
423 pair_type ("]", |
19895
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19731
diff
changeset
|
424 "-*- texinfo -*-\n\ |
12670
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
425 @deftypefn {Operator} {} ]\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
426 Return list delimiter.\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
427 @seealso{[}\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
428 @end deftypefn"), |
1 | 429 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
430 pair_type ("|", |
19895
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19731
diff
changeset
|
431 "-*- texinfo -*-\n\ |
12670
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
432 @deftypefn {Operator} {} |\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
433 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
|
434 @seealso{||, or}\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
435 @end deftypefn"), |
1 | 436 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
437 pair_type ("||", |
19895
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19731
diff
changeset
|
438 "-*- texinfo -*-\n\ |
12670
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
439 @deftypefn {Operator} {} ||\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
440 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
|
441 @seealso{|, or}\n\ |
f83ec5ab90ad
doc: Use texinfo for help text of operators.
Carnë Draug <carandraug+dev@gmail.com>
parents:
12605
diff
changeset
|
442 @end deftypefn"), |
1 | 443 }; |
444 | |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
445 const static pair_type keywords[] = |
1 | 446 { |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
447 pair_type ("break", |
19895
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19731
diff
changeset
|
448 "-*- texinfo -*-\n\ |
11547 | 449 @deftypefn {Keyword} {} break\n\ |
5818 | 450 Exit the innermost enclosing do, while or for loop.\n\ |
13246 | 451 @seealso{do, while, for, parfor, continue}\n\ |
11547 | 452 @end deftypefn"), |
5040 | 453 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
454 pair_type ("case", |
19895
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19731
diff
changeset
|
455 "-*- texinfo -*-\n\ |
18227
64f178d8e1e0
doc: Minor updates to help for Octave keywords (bug #41108)
Felipe G. Nievinski <fgnievinski@gmail.com>
parents:
17829
diff
changeset
|
456 @deftypefn {Keyword} {} case @var{value}\n\ |
64f178d8e1e0
doc: Minor updates to help for Octave keywords (bug #41108)
Felipe G. Nievinski <fgnievinski@gmail.com>
parents:
17829
diff
changeset
|
457 @deftypefnx {Keyword} {} case @{@var{value}, @dots{}@}\n\ |
64f178d8e1e0
doc: Minor updates to help for Octave keywords (bug #41108)
Felipe G. Nievinski <fgnievinski@gmail.com>
parents:
17829
diff
changeset
|
458 A case statement in a switch. Octave cases are exclusive and do not\n\ |
9064
7c02ec148a3c
Check grammar on all .cc files
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
459 fall-through as do C-language cases. A switch statement must have at least\n\ |
5818 | 460 one case. See @code{switch} for an example.\n\ |
461 @seealso{switch}\n\ | |
11547 | 462 @end deftypefn"), |
1 | 463 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
464 pair_type ("catch", |
19895
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19731
diff
changeset
|
465 "-*- texinfo -*-\n\ |
18227
64f178d8e1e0
doc: Minor updates to help for Octave keywords (bug #41108)
Felipe G. Nievinski <fgnievinski@gmail.com>
parents:
17829
diff
changeset
|
466 @deftypefn {Keyword} {} catch\n\ |
64f178d8e1e0
doc: Minor updates to help for Octave keywords (bug #41108)
Felipe G. Nievinski <fgnievinski@gmail.com>
parents:
17829
diff
changeset
|
467 @deftypefnx {Keyword} {} catch @var{value}\n\ |
5818 | 468 Begin the cleanup part of a try-catch block.\n\ |
469 @seealso{try}\n\ | |
11547 | 470 @end deftypefn"), |
1489 | 471 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
472 pair_type ("continue", |
19895
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19731
diff
changeset
|
473 "-*- texinfo -*-\n\ |
11547 | 474 @deftypefn {Keyword} {} continue\n\ |
5818 | 475 Jump to the end of the innermost enclosing do, while or for loop.\n\ |
13246 | 476 @seealso{do, while, for, parfor, break}\n\ |
11547 | 477 @end deftypefn"), |
5040 | 478 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
479 pair_type ("do", |
19895
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19731
diff
changeset
|
480 "-*- texinfo -*-\n\ |
11547 | 481 @deftypefn {Keyword} {} do\n\ |
9064
7c02ec148a3c
Check grammar on all .cc files
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
482 Begin a do-until loop. This differs from a do-while loop in that the\n\ |
5818 | 483 body of the loop is executed at least once.\n\ |
15908
5a4a07a2ec73
doc: add while and do-until example to help text (bug #7915)
Carnë Draug <carandraug+dev@gmail.com>
parents:
15489
diff
changeset
|
484 \n\ |
5a4a07a2ec73
doc: add while and do-until example to help text (bug #7915)
Carnë Draug <carandraug+dev@gmail.com>
parents:
15489
diff
changeset
|
485 @example\n\ |
5a4a07a2ec73
doc: add while and do-until example to help text (bug #7915)
Carnë Draug <carandraug+dev@gmail.com>
parents:
15489
diff
changeset
|
486 @group\n\ |
5a4a07a2ec73
doc: add while and do-until example to help text (bug #7915)
Carnë Draug <carandraug+dev@gmail.com>
parents:
15489
diff
changeset
|
487 i = 0;\n\ |
5a4a07a2ec73
doc: add while and do-until example to help text (bug #7915)
Carnë Draug <carandraug+dev@gmail.com>
parents:
15489
diff
changeset
|
488 do\n\ |
5a4a07a2ec73
doc: add while and do-until example to help text (bug #7915)
Carnë Draug <carandraug+dev@gmail.com>
parents:
15489
diff
changeset
|
489 i++\n\ |
5a4a07a2ec73
doc: add while and do-until example to help text (bug #7915)
Carnë Draug <carandraug+dev@gmail.com>
parents:
15489
diff
changeset
|
490 until (i == 10)\n\ |
5a4a07a2ec73
doc: add while and do-until example to help text (bug #7915)
Carnë Draug <carandraug+dev@gmail.com>
parents:
15489
diff
changeset
|
491 @end group\n\ |
5a4a07a2ec73
doc: add while and do-until example to help text (bug #7915)
Carnë Draug <carandraug+dev@gmail.com>
parents:
15489
diff
changeset
|
492 @end example\n\ |
5a4a07a2ec73
doc: add while and do-until example to help text (bug #7915)
Carnë Draug <carandraug+dev@gmail.com>
parents:
15489
diff
changeset
|
493 @seealso{for, until, while}\n\ |
11547 | 494 @end deftypefn"), |
1 | 495 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
496 pair_type ("else", |
19895
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19731
diff
changeset
|
497 "-*- texinfo -*-\n\ |
11547 | 498 @deftypefn {Keyword} {} else\n\ |
5818 | 499 Alternate action for an if block. See @code{if} for an example.\n\ |
500 @seealso{if}\n\ | |
11547 | 501 @end deftypefn"), |
1 | 502 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
503 pair_type ("elseif", |
19895
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19731
diff
changeset
|
504 "-*- texinfo -*-\n\ |
11547 | 505 @deftypefn {Keyword} {} elseif (@var{condition})\n\ |
5818 | 506 Alternate conditional test for an if block. See @code{if} for an example.\n\ |
507 @seealso{if}\n\ | |
11547 | 508 @end deftypefn"), |
1 | 509 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
510 pair_type ("end", |
19895
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19731
diff
changeset
|
511 "-*- texinfo -*-\n\ |
11547 | 512 @deftypefn {Keyword} {} end\n\ |
18227
64f178d8e1e0
doc: Minor updates to help for Octave keywords (bug #41108)
Felipe G. Nievinski <fgnievinski@gmail.com>
parents:
17829
diff
changeset
|
513 Mark the end of any @code{for}, @code{parfor}, @code{if}, @code{do},\n\ |
64f178d8e1e0
doc: Minor updates to help for Octave keywords (bug #41108)
Felipe G. Nievinski <fgnievinski@gmail.com>
parents:
17829
diff
changeset
|
514 @code{while}, @code{function}, @code{switch}, @code{try}, or\n\ |
64f178d8e1e0
doc: Minor updates to help for Octave keywords (bug #41108)
Felipe G. Nievinski <fgnievinski@gmail.com>
parents:
17829
diff
changeset
|
515 @code{unwind_protect} block.\n\ |
64f178d8e1e0
doc: Minor updates to help for Octave keywords (bug #41108)
Felipe G. Nievinski <fgnievinski@gmail.com>
parents:
17829
diff
changeset
|
516 @seealso{for, parfor, if, do, while, function, switch, try, unwind_protect}\n\ |
11547 | 517 @end deftypefn"), |
928 | 518 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
519 pair_type ("end_try_catch", |
19895
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19731
diff
changeset
|
520 "-*- texinfo -*-\n\ |
11547 | 521 @deftypefn {Keyword} {} end_try_catch\n\ |
5818 | 522 Mark the end of an @code{try-catch} block.\n\ |
523 @seealso{try, catch}\n\ | |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11572
diff
changeset
|
524 @end deftypefn"), |
1489 | 525 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
526 pair_type ("end_unwind_protect", |
19895
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19731
diff
changeset
|
527 "-*- texinfo -*-\n\ |
11547 | 528 @deftypefn {Keyword} {} end_unwind_protect\n\ |
5818 | 529 Mark the end of an unwind_protect block.\n\ |
530 @seealso{unwind_protect}\n\ | |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11572
diff
changeset
|
531 @end deftypefn"), |
1 | 532 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
533 pair_type ("endfor", |
19895
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19731
diff
changeset
|
534 "-*- texinfo -*-\n\ |
11547 | 535 @deftypefn {Keyword} {} endfor\n\ |
5818 | 536 Mark the end of a for loop. See @code{for} for an example.\n\ |
537 @seealso{for}\n\ | |
11547 | 538 @end deftypefn"), |
1 | 539 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
540 pair_type ("endfunction", |
19895
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19731
diff
changeset
|
541 "-*- texinfo -*-\n\ |
11547 | 542 @deftypefn {Keyword} {} endfunction\n\ |
5818 | 543 Mark the end of a function.\n\ |
544 @seealso{function}\n\ | |
11547 | 545 @end deftypefn"), |
1 | 546 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
547 pair_type ("endif", |
19895
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19731
diff
changeset
|
548 "-*- texinfo -*-\n\ |
11547 | 549 @deftypefn {Keyword} {} endif\n\ |
5818 | 550 Mark the end of an if block. See @code{if} for an example.\n\ |
551 @seealso{if}\n\ | |
11547 | 552 @end deftypefn"), |
1 | 553 |
13246 | 554 pair_type ("endparfor", |
19895
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19731
diff
changeset
|
555 "-*- texinfo -*-\n\ |
13246 | 556 @deftypefn {Keyword} {} endparfor\n\ |
557 Mark the end of a parfor loop. See @code{parfor} for an example.\n\ | |
558 @seealso{parfor}\n\ | |
559 @end deftypefn"), | |
560 | |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
561 pair_type ("endswitch", |
19895
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19731
diff
changeset
|
562 "-*- texinfo -*-\n\ |
11547 | 563 @deftypefn {Keyword} {} endswitch\n\ |
5818 | 564 Mark the end of a switch block. See @code{switch} for an example.\n\ |
565 @seealso{switch}\n\ | |
11547 | 566 @end deftypefn"), |
5122 | 567 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
568 pair_type ("endwhile", |
19895
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19731
diff
changeset
|
569 "-*- texinfo -*-\n\ |
11547 | 570 @deftypefn {Keyword} {} endwhile\n\ |
5818 | 571 Mark the end of a while loop. See @code{while} for an example.\n\ |
572 @seealso{do, while}\n\ | |
11547 | 573 @end deftypefn"), |
1 | 574 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
575 pair_type ("for", |
19895
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19731
diff
changeset
|
576 "-*- texinfo -*-\n\ |
11547 | 577 @deftypefn {Keyword} {} for @var{i} = @var{range}\n\ |
5818 | 578 Begin a for loop.\n\ |
10840 | 579 \n\ |
5818 | 580 @example\n\ |
9064
7c02ec148a3c
Check grammar on all .cc files
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
581 @group\n\ |
5818 | 582 for i = 1:10\n\ |
583 i\n\ | |
584 endfor\n\ | |
9064
7c02ec148a3c
Check grammar on all .cc files
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
585 @end group\n\ |
5818 | 586 @end example\n\ |
13246 | 587 @seealso{do, parfor, while}\n\ |
11547 | 588 @end deftypefn"), |
1 | 589 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
590 pair_type ("function", |
19895
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19731
diff
changeset
|
591 "-*- texinfo -*-\n\ |
12605
307e177dbaa8
doc: Add spaces after commas in @seealso blocks.
Rik <octave@nomad.inbox5.com>
parents:
12519
diff
changeset
|
592 @deftypefn {Keyword} {} function @var{outputs} = function (@var{input}, @dots{})\n\ |
11547 | 593 @deftypefnx {Keyword} {} function {} function (@var{input}, @dots{})\n\ |
594 @deftypefnx {Keyword} {} function @var{outputs} = function\n\ | |
5818 | 595 Begin a function body with @var{outputs} as results and @var{inputs} as\n\ |
596 parameters.\n\ | |
597 @seealso{return}\n\ | |
11547 | 598 @end deftypefn"), |
1 | 599 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
600 pair_type ("global", |
19895
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19731
diff
changeset
|
601 "-*- texinfo -*-\n\ |
18227
64f178d8e1e0
doc: Minor updates to help for Octave keywords (bug #41108)
Felipe G. Nievinski <fgnievinski@gmail.com>
parents:
17829
diff
changeset
|
602 @deftypefn {Keyword} {} global @var{var}\n\ |
5818 | 603 Declare variables to have global scope.\n\ |
10840 | 604 \n\ |
5818 | 605 @example\n\ |
9064
7c02ec148a3c
Check grammar on all .cc files
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
606 @group\n\ |
5818 | 607 global @var{x};\n\ |
14360
97883071e8e4
doc: Correct off-by-1 spacings in all .cc docstrings
Rik <octave@nomad.inbox5.com>
parents:
14171
diff
changeset
|
608 if (isempty (@var{x}))\n\ |
5818 | 609 x = 1;\n\ |
610 endif\n\ | |
9064
7c02ec148a3c
Check grammar on all .cc files
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
611 @end group\n\ |
5818 | 612 @end example\n\ |
613 @seealso{persistent}\n\ | |
11547 | 614 @end deftypefn"), |
1 | 615 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
616 pair_type ("if", |
19895
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19731
diff
changeset
|
617 "-*- texinfo -*-\n\ |
12605
307e177dbaa8
doc: Add spaces after commas in @seealso blocks.
Rik <octave@nomad.inbox5.com>
parents:
12519
diff
changeset
|
618 @deftypefn {Keyword} {} if (@var{cond}) @dots{} endif\n\ |
11547 | 619 @deftypefnx {Keyword} {} if (@var{cond}) @dots{} else @dots{} endif\n\ |
620 @deftypefnx {Keyword} {} if (@var{cond}) @dots{} elseif (@var{cond}) @dots{} endif\n\ | |
621 @deftypefnx {Keyword} {} if (@var{cond}) @dots{} elseif (@var{cond}) @dots{} else @dots{} endif\n\ | |
5393 | 622 Begin an if block.\n\ |
10840 | 623 \n\ |
5818 | 624 @example\n\ |
9064
7c02ec148a3c
Check grammar on all .cc files
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
625 @group\n\ |
5818 | 626 x = 1;\n\ |
627 if (x == 1)\n\ | |
628 disp (\"one\");\n\ | |
629 elseif (x == 2)\n\ | |
630 disp (\"two\");\n\ | |
631 else\n\ | |
632 disp (\"not one or two\");\n\ | |
633 endif\n\ | |
9064
7c02ec148a3c
Check grammar on all .cc files
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
634 @end group\n\ |
5818 | 635 @end example\n\ |
5646 | 636 @seealso{switch}\n\ |
11547 | 637 @end deftypefn"), |
1 | 638 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
639 pair_type ("otherwise", |
19895
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19731
diff
changeset
|
640 "-*- texinfo -*-\n\ |
11547 | 641 @deftypefn {Keyword} {} otherwise\n\ |
5818 | 642 The default statement in a switch block (similar to else in an if block).\n\ |
643 @seealso{switch}\n\ | |
11547 | 644 @end deftypefn"), |
5040 | 645 |
13246 | 646 pair_type ("parfor", |
19895
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19731
diff
changeset
|
647 "-*- texinfo -*-\n\ |
17311
56404cdcb723
Correct parfor keyword documentation and add some %!tests.
Rik <rik@octave.org>
parents:
17281
diff
changeset
|
648 @deftypefn {Keyword} {} parfor @var{i} = @var{range}\n\ |
56404cdcb723
Correct parfor keyword documentation and add some %!tests.
Rik <rik@octave.org>
parents:
17281
diff
changeset
|
649 @deftypefnx {Keyword} {} parfor (@var{i} = @var{range}, @var{maxproc})\n\ |
13246 | 650 Begin a for loop that may execute in parallel.\n\ |
651 \n\ | |
652 @example\n\ | |
653 @group\n\ | |
654 parfor i = 1:10\n\ | |
655 i\n\ | |
656 endparfor\n\ | |
657 @end group\n\ | |
658 @end example\n\ | |
13773
59e5f8e1d516
Fix block comment Texinfo not appearing in documentation
Rik <octave@nomad.inbox5.com>
parents:
13749
diff
changeset
|
659 @seealso{for, do, while}\n\ |
13246 | 660 @end deftypefn"), |
661 | |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
662 pair_type ("persistent", |
19895
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19731
diff
changeset
|
663 "-*- texinfo -*-\n\ |
11547 | 664 @deftypefn {Keyword} {} persistent @var{var}\n\ |
5818 | 665 Declare variables as persistent. A variable that has been declared\n\ |
5623 | 666 persistent within a function will retain its contents in memory between\n\ |
667 subsequent calls to the same function. The difference between persistent\n\ | |
20207
4f45eaf83908
doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents:
20173
diff
changeset
|
668 variables and global variables is that persistent variables are local in\n\ |
5818 | 669 scope to a particular function and are not visible elsewhere.\n\ |
670 @seealso{global}\n\ | |
11547 | 671 @end deftypefn"), |
4686 | 672 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
673 pair_type ("return", |
19895
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19731
diff
changeset
|
674 "-*- texinfo -*-\n\ |
11547 | 675 @deftypefn {Keyword} {} return\n\ |
5818 | 676 Return from a function.\n\ |
677 @seealso{function}\n\ | |
11547 | 678 @end deftypefn"), |
928 | 679 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
680 pair_type ("static", |
19895
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19731
diff
changeset
|
681 "-*- texinfo -*-\n\ |
11547 | 682 @deftypefn {Keyword} {} static\n\ |
18227
64f178d8e1e0
doc: Minor updates to help for Octave keywords (bug #41108)
Felipe G. Nievinski <fgnievinski@gmail.com>
parents:
17829
diff
changeset
|
683 This statement has been deprecated in favor of @code{persistent}.\n\ |
5818 | 684 @seealso{persistent}\n\ |
11547 | 685 @end deftypefn"), |
5040 | 686 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
687 pair_type ("switch", |
19895
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19731
diff
changeset
|
688 "-*- texinfo -*-\n\ |
11547 | 689 @deftypefn {Keyword} {} switch @var{statement}\n\ |
5818 | 690 Begin a switch block.\n\ |
10840 | 691 \n\ |
5818 | 692 @example\n\ |
9064
7c02ec148a3c
Check grammar on all .cc files
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
693 @group\n\ |
5818 | 694 yesno = \"yes\"\n\ |
695 \n\ | |
696 switch yesno\n\ | |
5832 | 697 case @{\"Yes\" \"yes\" \"YES\" \"y\" \"Y\"@}\n\ |
5818 | 698 value = 1;\n\ |
5832 | 699 case @{\"No\" \"no\" \"NO\" \"n\" \"N\"@}\n\ |
5818 | 700 value = 0;\n\ |
701 otherwise\n\ | |
702 error (\"invalid value\");\n\ | |
703 endswitch\n\ | |
9064
7c02ec148a3c
Check grammar on all .cc files
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
704 @end group\n\ |
5818 | 705 @end example\n\ |
706 @seealso{if, case, otherwise}\n\ | |
11547 | 707 @end deftypefn"), |
5040 | 708 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
709 pair_type ("try", |
19895
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19731
diff
changeset
|
710 "-*- texinfo -*-\n\ |
11547 | 711 @deftypefn {Keyword} {} try\n\ |
5818 | 712 Begin a try-catch block.\n\ |
6138 | 713 \n\ |
714 If an error occurs within a try block, then the catch code will be run and\n\ | |
715 execution will proceed after the catch block (though it is often\n\ | |
716 recommended to use the lasterr function to re-throw the error after cleanup\n\ | |
717 is completed).\n\ | |
12605
307e177dbaa8
doc: Add spaces after commas in @seealso blocks.
Rik <octave@nomad.inbox5.com>
parents:
12519
diff
changeset
|
718 @seealso{catch, unwind_protect}\n\ |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11572
diff
changeset
|
719 @end deftypefn"), |
1489 | 720 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
721 pair_type ("until", |
19895
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19731
diff
changeset
|
722 "-*- texinfo -*-\n\ |
18227
64f178d8e1e0
doc: Minor updates to help for Octave keywords (bug #41108)
Felipe G. Nievinski <fgnievinski@gmail.com>
parents:
17829
diff
changeset
|
723 @deftypefn {Keyword} {} until (@var{cond})\n\ |
15908
5a4a07a2ec73
doc: add while and do-until example to help text (bug #7915)
Carnë Draug <carandraug+dev@gmail.com>
parents:
15489
diff
changeset
|
724 End a do-until loop. See @code{do} for an example.\n\ |
5818 | 725 @seealso{do}\n\ |
11547 | 726 @end deftypefn"), |
5040 | 727 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
728 pair_type ("unwind_protect", |
19895
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19731
diff
changeset
|
729 "-*- texinfo -*-\n\ |
11547 | 730 @deftypefn {Keyword} {} unwind_protect\n\ |
5818 | 731 Begin an unwind_protect block.\n\ |
6138 | 732 \n\ |
733 If an error occurs within the first part of an unwind_protect block\n\ | |
734 the commands within the unwind_protect_cleanup block are executed before\n\ | |
735 the error is thrown. If an error is not thrown, then the\n\ | |
736 unwind_protect_cleanup block is still executed (in other words, the\n\ | |
737 unwind_protect_cleanup will be run with or without an error in the\n\ | |
738 unwind_protect block).\n\ | |
12605
307e177dbaa8
doc: Add spaces after commas in @seealso blocks.
Rik <octave@nomad.inbox5.com>
parents:
12519
diff
changeset
|
739 @seealso{unwind_protect_cleanup, try}\n\ |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11572
diff
changeset
|
740 @end deftypefn"), |
928 | 741 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
742 pair_type ("unwind_protect_cleanup", |
19895
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19731
diff
changeset
|
743 "-*- texinfo -*-\n\ |
11547 | 744 @deftypefn {Keyword} {} unwind_protect_cleanup\n\ |
5818 | 745 Begin the cleanup section of an unwind_protect block.\n\ |
746 @seealso{unwind_protect}\n\ | |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11572
diff
changeset
|
747 @end deftypefn"), |
1 | 748 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
749 pair_type ("varargin", |
19895
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19731
diff
changeset
|
750 "-*- texinfo -*-\n\ |
11547 | 751 @deftypefn {Keyword} {} varargin\n\ |
5818 | 752 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
|
753 @seealso{varargout, nargin, isargout, nargout, nthargout}\n\ |
11547 | 754 @end deftypefn"), |
5040 | 755 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
756 pair_type ("varargout", |
19895
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19731
diff
changeset
|
757 "-*- texinfo -*-\n\ |
11547 | 758 @deftypefn {Keyword} {} varargout\n\ |
5818 | 759 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
|
760 @seealso{varargin, nargin, isargout, nargout, nthargout}\n\ |
11547 | 761 @end deftypefn"), |
5040 | 762 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
763 pair_type ("while", |
19895
19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19731
diff
changeset
|
764 "-*- texinfo -*-\n\ |
11547 | 765 @deftypefn {Keyword} {} while\n\ |
5818 | 766 Begin a while loop.\n\ |
15908
5a4a07a2ec73
doc: add while and do-until example to help text (bug #7915)
Carnë Draug <carandraug+dev@gmail.com>
parents:
15489
diff
changeset
|
767 \n\ |
5a4a07a2ec73
doc: add while and do-until example to help text (bug #7915)
Carnë Draug <carandraug+dev@gmail.com>
parents:
15489
diff
changeset
|
768 @example\n\ |
5a4a07a2ec73
doc: add while and do-until example to help text (bug #7915)
Carnë Draug <carandraug+dev@gmail.com>
parents:
15489
diff
changeset
|
769 @group\n\ |
5a4a07a2ec73
doc: add while and do-until example to help text (bug #7915)
Carnë Draug <carandraug+dev@gmail.com>
parents:
15489
diff
changeset
|
770 i = 0;\n\ |
5a4a07a2ec73
doc: add while and do-until example to help text (bug #7915)
Carnë Draug <carandraug+dev@gmail.com>
parents:
15489
diff
changeset
|
771 while (i < 10)\n\ |
5a4a07a2ec73
doc: add while and do-until example to help text (bug #7915)
Carnë Draug <carandraug+dev@gmail.com>
parents:
15489
diff
changeset
|
772 i++\n\ |
5a4a07a2ec73
doc: add while and do-until example to help text (bug #7915)
Carnë Draug <carandraug+dev@gmail.com>
parents:
15489
diff
changeset
|
773 endwhile\n\ |
5a4a07a2ec73
doc: add while and do-until example to help text (bug #7915)
Carnë Draug <carandraug+dev@gmail.com>
parents:
15489
diff
changeset
|
774 @end group\n\ |
5a4a07a2ec73
doc: add while and do-until example to help text (bug #7915)
Carnë Draug <carandraug+dev@gmail.com>
parents:
15489
diff
changeset
|
775 @end example\n\ |
5a4a07a2ec73
doc: add while and do-until example to help text (bug #7915)
Carnë Draug <carandraug+dev@gmail.com>
parents:
15489
diff
changeset
|
776 @seealso{do, endwhile, for, until}\n\ |
11547 | 777 @end deftypefn"), |
1 | 778 }; |
779 | |
581 | 780 // Return a copy of the operator or keyword names. |
3016 | 781 static string_vector |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
782 names (const map_type& lst) |
1 | 783 { |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
784 string_vector retval (lst.size ()); |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
785 int j = 0; |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
786 for (map_iter iter = lst.begin (); iter != lst.end (); iter ++) |
15020
560317fd5977
maint: Cuddle open bracket used for indexing C++ arrays in source code.
Rik <rik@octave.org>
parents:
15005
diff
changeset
|
787 retval[j++] = iter->first; |
1755 | 788 return retval; |
1 | 789 } |
790 | |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
791 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
|
792 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
|
793 const static string_vector keyword_names = names (keywords_map); |
1 | 794 |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
795 // FIXME: It's not likely that this does the right thing now. |
3016 | 796 |
797 string_vector | |
798 make_name_list (void) | |
799 { | |
20267
a9574e3c6e9e
Deprecate Array::length() and Sparse::length() in favour of ::numel().
Carnë Draug <carandraug@octave.org>
parents:
20207
diff
changeset
|
800 const int key_len = keyword_names.numel (); |
3016 | 801 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
802 const string_vector bif = symbol_table::built_in_function_names (); |
20267
a9574e3c6e9e
Deprecate Array::length() and Sparse::length() in favour of ::numel().
Carnë Draug <carandraug@octave.org>
parents:
20207
diff
changeset
|
803 const int bif_len = bif.numel (); |
4009 | 804 |
12911
d6151d774283
make completion work for command-line functions
John W. Eaton <jwe@octave.org>
parents:
12670
diff
changeset
|
805 const string_vector cfl = symbol_table::cmdline_function_names (); |
20267
a9574e3c6e9e
Deprecate Array::length() and Sparse::length() in favour of ::numel().
Carnë Draug <carandraug@octave.org>
parents:
20207
diff
changeset
|
806 const int cfl_len = cfl.numel (); |
12911
d6151d774283
make completion work for command-line functions
John W. Eaton <jwe@octave.org>
parents:
12670
diff
changeset
|
807 |
10500
8f27f368aba2
fix generating names for TAB completion
Jaroslav Hajek <highegg@gmail.com>
parents:
10315
diff
changeset
|
808 const string_vector lcl = symbol_table::variable_names (); |
20267
a9574e3c6e9e
Deprecate Array::length() and Sparse::length() in favour of ::numel().
Carnë Draug <carandraug@octave.org>
parents:
20207
diff
changeset
|
809 const int lcl_len = lcl.numel (); |
3016 | 810 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
811 const string_vector ffl = load_path::fcn_names (); |
20267
a9574e3c6e9e
Deprecate Array::length() and Sparse::length() in favour of ::numel().
Carnë Draug <carandraug@octave.org>
parents:
20207
diff
changeset
|
812 const int ffl_len = ffl.numel (); |
3016 | 813 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
814 const string_vector afl = autoloaded_functions (); |
20267
a9574e3c6e9e
Deprecate Array::length() and Sparse::length() in favour of ::numel().
Carnë Draug <carandraug@octave.org>
parents:
20207
diff
changeset
|
815 const int afl_len = afl.numel (); |
5592 | 816 |
12911
d6151d774283
make completion work for command-line functions
John W. Eaton <jwe@octave.org>
parents:
12670
diff
changeset
|
817 const int total_len |
d6151d774283
make completion work for command-line functions
John W. Eaton <jwe@octave.org>
parents:
12670
diff
changeset
|
818 = key_len + bif_len + cfl_len + lcl_len + ffl_len + afl_len; |
3016 | 819 |
820 string_vector list (total_len); | |
821 | |
822 // Put all the symbols in one big list. | |
823 | |
824 int j = 0; | |
825 int i = 0; | |
826 for (i = 0; i < key_len; i++) | |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
827 list[j++] = keyword_names[i]; |
3016 | 828 |
7336 | 829 for (i = 0; i < bif_len; i++) |
830 list[j++] = bif[i]; | |
4009 | 831 |
12911
d6151d774283
make completion work for command-line functions
John W. Eaton <jwe@octave.org>
parents:
12670
diff
changeset
|
832 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
|
833 list[j++] = cfl[i]; |
d6151d774283
make completion work for command-line functions
John W. Eaton <jwe@octave.org>
parents:
12670
diff
changeset
|
834 |
3016 | 835 for (i = 0; i < lcl_len; i++) |
836 list[j++] = lcl[i]; | |
837 | |
838 for (i = 0; i < ffl_len; i++) | |
839 list[j++] = ffl[i]; | |
840 | |
5592 | 841 for (i = 0; i < afl_len; i++) |
842 list[j++] = afl[i]; | |
843 | |
3016 | 844 return list; |
845 } | |
846 | |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
847 static bool |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
848 looks_like_html (const std::string& msg) |
3014 | 849 { |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
850 const size_t p1 = msg.find ('\n'); |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
851 std::string t = msg.substr (0, p1); |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
852 // FIXME: this comparison should be case-insensitive |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
853 const size_t p2 = t.find ("<html"); |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11572
diff
changeset
|
854 |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
855 return (p2 != std::string::npos); |
2470 | 856 } |
3014 | 857 |
858 static bool | |
3523 | 859 looks_like_texinfo (const std::string& msg, size_t& p1) |
3295 | 860 { |
861 p1 = msg.find ('\n'); | |
862 | |
3523 | 863 std::string t = msg.substr (0, p1); |
3295 | 864 |
8021 | 865 if (p1 == std::string::npos) |
3295 | 866 p1 = 0; |
867 | |
868 size_t p2 = t.find ("-*- texinfo -*-"); | |
869 | |
8021 | 870 return (p2 != std::string::npos); |
3295 | 871 } |
872 | |
3355 | 873 static bool |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11572
diff
changeset
|
874 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
|
875 std::string& w, bool& symbol_found) |
3355 | 876 { |
877 bool retval = false; | |
878 | |
7336 | 879 octave_value val = symbol_table::find_function (nm); |
3355 | 880 |
7336 | 881 if (val.is_defined ()) |
3355 | 882 { |
7336 | 883 octave_function *fcn = val.function_value (); |
884 | |
885 if (fcn) | |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
886 { |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
887 symbol_found = true; |
5399 | 888 |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
889 h = fcn->doc_string (); |
7336 | 890 |
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
|
891 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
|
892 |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
893 w = fcn->fcn_file_name (); |
6243 | 894 |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
895 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
|
896 w = fcn->is_user_function () |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
897 ? "command-line function" : "built-in function"; |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
898 } |
6243 | 899 } |
3355 | 900 |
6243 | 901 return retval; |
902 } | |
903 | |
904 static bool | |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11572
diff
changeset
|
905 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
|
906 std::string& file, bool& symbol_found) |
6243 | 907 { |
908 bool retval = false; | |
909 | |
910 h = get_help_from_file (nm, symbol_found, file); | |
911 | |
912 if (h.length () > 0) | |
913 retval = true; | |
914 | |
915 return retval; | |
916 } | |
917 | |
918 static bool | |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11572
diff
changeset
|
919 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
|
920 const map_type& map, bool& symbol_found) |
3355 | 921 { |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
922 map_iter idx = map.find (nm); |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
923 symbol_found = (idx != map.end ()); |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
924 h = (symbol_found) ? idx->second : ""; |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
925 return symbol_found; |
3355 | 926 } |
927 | |
6243 | 928 std::string |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
929 raw_help (const std::string& nm, bool& symbol_found) |
6243 | 930 { |
931 std::string h; | |
932 std::string w; | |
933 std::string f; | |
934 | |
20173
4ff975c58584
Check error_state before searching for help text (bug #44934).
Rik <rik@octave.org>
parents:
19907
diff
changeset
|
935 bool found; |
4ff975c58584
Check error_state before searching for help text (bug #44934).
Rik <rik@octave.org>
parents:
19907
diff
changeset
|
936 |
4ff975c58584
Check error_state before searching for help text (bug #44934).
Rik <rik@octave.org>
parents:
19907
diff
changeset
|
937 found = raw_help_from_symbol_table (nm, h, w, symbol_found); |
4ff975c58584
Check error_state before searching for help text (bug #44934).
Rik <rik@octave.org>
parents:
19907
diff
changeset
|
938 if (! found && ! error_state) |
4ff975c58584
Check error_state before searching for help text (bug #44934).
Rik <rik@octave.org>
parents:
19907
diff
changeset
|
939 { |
4ff975c58584
Check error_state before searching for help text (bug #44934).
Rik <rik@octave.org>
parents:
19907
diff
changeset
|
940 found = raw_help_from_file (nm, h, f, symbol_found); |
4ff975c58584
Check error_state before searching for help text (bug #44934).
Rik <rik@octave.org>
parents:
19907
diff
changeset
|
941 if (! found && ! error_state) |
4ff975c58584
Check error_state before searching for help text (bug #44934).
Rik <rik@octave.org>
parents:
19907
diff
changeset
|
942 { |
4ff975c58584
Check error_state before searching for help text (bug #44934).
Rik <rik@octave.org>
parents:
19907
diff
changeset
|
943 found = raw_help_from_map (nm, h, operators_map, symbol_found); |
4ff975c58584
Check error_state before searching for help text (bug #44934).
Rik <rik@octave.org>
parents:
19907
diff
changeset
|
944 if (! found && ! error_state) |
4ff975c58584
Check error_state before searching for help text (bug #44934).
Rik <rik@octave.org>
parents:
19907
diff
changeset
|
945 { |
4ff975c58584
Check error_state before searching for help text (bug #44934).
Rik <rik@octave.org>
parents:
19907
diff
changeset
|
946 raw_help_from_map (nm, h, keywords_map, symbol_found); |
4ff975c58584
Check error_state before searching for help text (bug #44934).
Rik <rik@octave.org>
parents:
19907
diff
changeset
|
947 } |
4ff975c58584
Check error_state before searching for help text (bug #44934).
Rik <rik@octave.org>
parents:
19907
diff
changeset
|
948 } |
4ff975c58584
Check error_state before searching for help text (bug #44934).
Rik <rik@octave.org>
parents:
19907
diff
changeset
|
949 } |
6243 | 950 |
951 return h; | |
952 } | |
953 | |
15470
bf0857c789f4
initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
954 DEFUN (built_in_docstrings_file, args, nargout, |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
955 "-*- texinfo -*-\n\ |
15470
bf0857c789f4
initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
956 @deftypefn {Built-in Function} {@var{val} =} built_in_docstrings_file ()\n\ |
bf0857c789f4
initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
957 @deftypefnx {Built-in Function} {@var{old_val} =} built_in_docstrings_file (@var{new_val})\n\ |
bf0857c789f4
initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
958 @deftypefnx {Built-in Function} {} built_in_docstrings_file (@var{new_val}, \"local\")\n\ |
bf0857c789f4
initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
959 Query or set the internal variable that specifies the name of the\n\ |
bf0857c789f4
initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
960 file containing docstrings for built-in Octave functions.\n\ |
20207
4f45eaf83908
doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents:
20173
diff
changeset
|
961 \n\ |
16807
2fd22fbaffa3
doc: Add built_in_docstrings_file() to documentation.
Rik <rik@octave.org>
parents:
16199
diff
changeset
|
962 The default value is\n\ |
2fd22fbaffa3
doc: Add built_in_docstrings_file() to documentation.
Rik <rik@octave.org>
parents:
16199
diff
changeset
|
963 @file{@var{octave-home}/share/octave/@var{version}/etc/built-in-docstrings},\n\ |
2fd22fbaffa3
doc: Add built_in_docstrings_file() to documentation.
Rik <rik@octave.org>
parents:
16199
diff
changeset
|
964 in which @var{octave-home} is the root directory of the Octave installation,\n\ |
20207
4f45eaf83908
doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents:
20173
diff
changeset
|
965 and @var{version} is the Octave version number. The default value may be\n\ |
4f45eaf83908
doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents:
20173
diff
changeset
|
966 overridden by the environment variable\n\ |
16807
2fd22fbaffa3
doc: Add built_in_docstrings_file() to documentation.
Rik <rik@octave.org>
parents:
16199
diff
changeset
|
967 @w{@env{OCTAVE_BUILT_IN_DOCSTRINGS_FILE}}, or the command line argument\n\ |
20207
4f45eaf83908
doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents:
20173
diff
changeset
|
968 @option{--built-in-docstrings-file FNAME}.\n\ |
15470
bf0857c789f4
initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
969 \n\ |
16807
2fd22fbaffa3
doc: Add built_in_docstrings_file() to documentation.
Rik <rik@octave.org>
parents:
16199
diff
changeset
|
970 Note: This variable is only used when Octave is initializing itself.\n\ |
2fd22fbaffa3
doc: Add built_in_docstrings_file() to documentation.
Rik <rik@octave.org>
parents:
16199
diff
changeset
|
971 Modifying it during a running session of Octave will have no effect.\n\ |
15470
bf0857c789f4
initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
972 @end deftypefn") |
bf0857c789f4
initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
973 { |
bf0857c789f4
initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
974 return SET_NONEMPTY_INTERNAL_STRING_VARIABLE (built_in_docstrings_file); |
bf0857c789f4
initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
975 } |
bf0857c789f4
initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
976 |
bf0857c789f4
initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
977 void |
bf0857c789f4
initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
978 install_built_in_docstrings (void) |
bf0857c789f4
initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
979 { |
bf0857c789f4
initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
980 std::string fname = Vbuilt_in_docstrings_file; |
bf0857c789f4
initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
981 |
bf0857c789f4
initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
982 std::ifstream file (fname.c_str (), std::ios::in | std::ios::binary); |
bf0857c789f4
initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
983 |
bf0857c789f4
initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
984 if (file) |
bf0857c789f4
initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
985 { |
bf0857c789f4
initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
986 // Ignore header; |
17256
ee1d19174316
doc: Use 0x1d as record separator for joint compatibility with Texinfo 4.x and 5.x.
Rik <rik@octave.org>
parents:
17242
diff
changeset
|
987 file.ignore (1000, 0x1d); |
15470
bf0857c789f4
initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
988 |
bf0857c789f4
initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
989 if (file.gcount () == 1000) |
bf0857c789f4
initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
990 { |
bf0857c789f4
initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
991 // We use std::cerr here instead of calling Octave's warning |
bf0857c789f4
initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
992 // function because install_built_in_docstrings is called |
bf0857c789f4
initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
993 // before the interpreter is initialized, so warning messages |
bf0857c789f4
initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
994 // won't work properly. |
bf0857c789f4
initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
995 |
bf0857c789f4
initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
996 std::cerr << "warning: is builtin-docstrings file corrupted?" |
bf0857c789f4
initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
997 << std::endl; |
bf0857c789f4
initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
998 return; |
bf0857c789f4
initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
999 } |
bf0857c789f4
initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
1000 |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1001 // FIXME: eliminate fixed buffer size. |
15470
bf0857c789f4
initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
1002 size_t bufsize = 100000; |
bf0857c789f4
initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
1003 |
bf0857c789f4
initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
1004 OCTAVE_LOCAL_BUFFER (char, buf, bufsize); |
bf0857c789f4
initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
1005 |
bf0857c789f4
initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
1006 while (! file.eof ()) |
bf0857c789f4
initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
1007 { |
17256
ee1d19174316
doc: Use 0x1d as record separator for joint compatibility with Texinfo 4.x and 5.x.
Rik <rik@octave.org>
parents:
17242
diff
changeset
|
1008 file.getline (buf, bufsize, 0x1d); |
15470
bf0857c789f4
initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
1009 |
bf0857c789f4
initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
1010 std::string tmp (buf); |
bf0857c789f4
initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
1011 |
bf0857c789f4
initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
1012 size_t pos = tmp.find ('\n'); |
bf0857c789f4
initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
1013 |
bf0857c789f4
initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
1014 std::string fcn = tmp.substr (0, pos); |
bf0857c789f4
initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
1015 |
bf0857c789f4
initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
1016 octave_value ov = symbol_table::find_built_in_function (fcn); |
bf0857c789f4
initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
1017 |
bf0857c789f4
initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
1018 if (ov.is_defined ()) |
bf0857c789f4
initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
1019 { |
bf0857c789f4
initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
1020 octave_function *fp = ov.function_value (); |
bf0857c789f4
initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
1021 |
bf0857c789f4
initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
1022 if (fp) |
bf0857c789f4
initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
1023 { |
bf0857c789f4
initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
1024 tmp = tmp.substr (pos+1); |
15489
720a3bd76492
Backout changeset afc002de3ade until final built-in docstrings file format chosen.
Rik <rik@octave.org>
parents:
15486
diff
changeset
|
1025 |
720a3bd76492
Backout changeset afc002de3ade until final built-in docstrings file format chosen.
Rik <rik@octave.org>
parents:
15486
diff
changeset
|
1026 // Strip @c FILENAME which is part of current DOCSTRINGS |
720a3bd76492
Backout changeset afc002de3ade until final built-in docstrings file format chosen.
Rik <rik@octave.org>
parents:
15486
diff
changeset
|
1027 // syntax. This may disappear if a specific format for |
720a3bd76492
Backout changeset afc002de3ade until final built-in docstrings file format chosen.
Rik <rik@octave.org>
parents:
15486
diff
changeset
|
1028 // docstring files is developed. |
720a3bd76492
Backout changeset afc002de3ade until final built-in docstrings file format chosen.
Rik <rik@octave.org>
parents:
15486
diff
changeset
|
1029 while (tmp.length () > 2 && tmp[0] == '@' && tmp[1] == 'c') |
720a3bd76492
Backout changeset afc002de3ade until final built-in docstrings file format chosen.
Rik <rik@octave.org>
parents:
15486
diff
changeset
|
1030 { |
720a3bd76492
Backout changeset afc002de3ade until final built-in docstrings file format chosen.
Rik <rik@octave.org>
parents:
15486
diff
changeset
|
1031 pos = tmp.find ('\n'); |
720a3bd76492
Backout changeset afc002de3ade until final built-in docstrings file format chosen.
Rik <rik@octave.org>
parents:
15486
diff
changeset
|
1032 tmp = tmp.substr (pos+1); |
720a3bd76492
Backout changeset afc002de3ade until final built-in docstrings file format chosen.
Rik <rik@octave.org>
parents:
15486
diff
changeset
|
1033 } |
720a3bd76492
Backout changeset afc002de3ade until final built-in docstrings file format chosen.
Rik <rik@octave.org>
parents:
15486
diff
changeset
|
1034 |
15470
bf0857c789f4
initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
1035 fp->document (tmp); |
bf0857c789f4
initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
1036 } |
bf0857c789f4
initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
1037 } |
bf0857c789f4
initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
1038 } |
bf0857c789f4
initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
1039 } |
bf0857c789f4
initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
1040 else |
bf0857c789f4
initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
1041 { |
bf0857c789f4
initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
1042 // See note above about using std::cerr instead of warning. |
bf0857c789f4
initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
1043 |
bf0857c789f4
initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
1044 std::cerr << "warning: docstring file '" << fname << "' not found" |
bf0857c789f4
initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
1045 << std::endl; |
bf0857c789f4
initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
1046 } |
bf0857c789f4
initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
1047 |
bf0857c789f4
initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
1048 } |
bf0857c789f4
initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
1049 |
1140 | 1050 static void |
9806
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
1051 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
|
1052 std::string& format) |
1140 | 1053 { |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1054 bool symbol_found = false; |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1055 text = raw_help (name, symbol_found); |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11572
diff
changeset
|
1056 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1057 format = "Not found"; |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1058 if (symbol_found) |
1140 | 1059 { |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1060 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
|
1061 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
|
1062 { |
52956d669506
Display sensible error message when the help text of an undocumented function is requested
Soren Hauberg <hauberg@gmail.com>
parents:
8630
diff
changeset
|
1063 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
|
1064 } |
52956d669506
Display sensible error message when the help text of an undocumented function is requested
Soren Hauberg <hauberg@gmail.com>
parents:
8630
diff
changeset
|
1065 else if (looks_like_texinfo (text, idx)) |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1066 { |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1067 format = "texinfo"; |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1068 text.erase (0, idx); |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1069 } |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1070 else if (looks_like_html (text)) |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1071 { |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1072 format = "html"; |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1073 } |
5399 | 1074 else |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1075 { |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1076 format = "plain text"; |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1077 } |
1140 | 1078 } |
1079 } | |
1080 | |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1081 DEFUN (get_help_text, args, , "-*- texinfo -*-\n\ |
15038
ab18578c2ade
doc: Update docstrings for built-in functions to not use "Loadable Function" as type.
Rik <rik@octave.org>
parents:
15020
diff
changeset
|
1082 @deftypefn {Built-in 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
|
1083 Return the raw help text of function @var{name}.\n\ |
3168 | 1084 \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
|
1085 The raw help text is returned in @var{text} and the format in @var{format}\n\ |
17281
bc924baa2c4e
doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents:
17256
diff
changeset
|
1086 The format is a string which is one of @qcode{\"texinfo\"},\n\ |
bc924baa2c4e
doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents:
17256
diff
changeset
|
1087 @qcode{\"html\"}, or @qcode{\"plain text\"}.\n\ |
20207
4f45eaf83908
doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents:
20173
diff
changeset
|
1088 @seealso{get_help_text_from_file}\n\ |
8812
7d48766c21a5
use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents:
8672
diff
changeset
|
1089 @end deftypefn") |
529 | 1090 { |
2086 | 1091 octave_value_list retval; |
529 | 1092 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1093 if (args.length () == 1) |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1094 { |
18111
b560bac0fca2
maint: Don't use space between 'args' and '(' when doing indexing.
Rik <rik@octave.org>
parents:
17829
diff
changeset
|
1095 const std::string name = args(0).string_value (); |
1755 | 1096 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1097 if (! error_state) |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
1098 { |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
1099 std::string text; |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
1100 std::string format; |
529 | 1101 |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
1102 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
|
1103 |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
1104 retval(1) = format; |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
1105 retval(0) = text; |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
1106 } |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1107 else |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
1108 error ("get_help_text: invalid input"); |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1109 } |
529 | 1110 else |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1111 print_usage (); |
529 | 1112 |
1113 return retval; | |
1114 } | |
1115 | |
9806
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
1116 static void |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
1117 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
|
1118 std::string& format) |
9806
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
1119 { |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
1120 bool symbol_found = false; |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
1121 |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
1122 std::string f; |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
1123 |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
1124 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
|
1125 |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
1126 format = "Not found"; |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
1127 if (symbol_found) |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
1128 { |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
1129 size_t idx = -1; |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
1130 if (text.empty ()) |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
1131 { |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
1132 format = "Not documented"; |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
1133 } |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
1134 else if (looks_like_texinfo (text, idx)) |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
1135 { |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
1136 format = "texinfo"; |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
1137 text.erase (0, idx); |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
1138 } |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
1139 else if (looks_like_html (text)) |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
1140 { |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
1141 format = "html"; |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
1142 } |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
1143 else |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
1144 { |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
1145 format = "plain text"; |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
1146 } |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
1147 } |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
1148 } |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
1149 |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
1150 DEFUN (get_help_text_from_file, args, , |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1151 "-*- texinfo -*-\n\ |
15038
ab18578c2ade
doc: Update docstrings for built-in functions to not use "Loadable Function" as type.
Rik <rik@octave.org>
parents:
15020
diff
changeset
|
1152 @deftypefn {Built-in 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
|
1153 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
|
1154 \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
|
1155 The raw help text is returned in @var{text} and the format in @var{format}\n\ |
17281
bc924baa2c4e
doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents:
17256
diff
changeset
|
1156 The format is a string which is one of @qcode{\"texinfo\"},\n\ |
bc924baa2c4e
doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents:
17256
diff
changeset
|
1157 @qcode{\"html\"}, or @qcode{\"plain text\"}.\n\ |
20207
4f45eaf83908
doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents:
20173
diff
changeset
|
1158 @seealso{get_help_text}\n\ |
9806
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
1159 @end deftypefn") |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
1160 { |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
1161 octave_value_list retval; |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
1162 |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
1163 if (args.length () == 1) |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
1164 { |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
1165 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
|
1166 |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
1167 if (! error_state) |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
1168 { |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
1169 std::string text; |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
1170 std::string format; |
9806
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
1171 |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
1172 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
|
1173 |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
1174 retval(1) = format; |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
1175 retval(0) = text; |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
1176 } |
9806
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
1177 else |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
1178 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
|
1179 } |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
1180 else |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
1181 print_usage (); |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
1182 |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
1183 return retval; |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
1184 } |
8e345f2fe4d6
improved support for Contents.m files
John W. Eaton <jwe@octave.org>
parents:
9416
diff
changeset
|
1185 |
8812
7d48766c21a5
use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents:
8672
diff
changeset
|
1186 // 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
|
1187 // operators. |
7d48766c21a5
use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents:
8672
diff
changeset
|
1188 |
7d48766c21a5
use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents:
8672
diff
changeset
|
1189 DEFUN (__operators__, , , |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1190 "-*- texinfo -*-\n\ |
19186
0f9c5a15c8fa
doc: Periodic grammarcheck of documentation.
Rik <rik@octave.org>
parents:
18712
diff
changeset
|
1191 @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
|
1192 Undocumented internal function.\n\ |
7d48766c21a5
use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents:
8672
diff
changeset
|
1193 @end deftypefn") |
3355 | 1194 { |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1195 return octave_value (Cell (names (operators_map))); |
3355 | 1196 } |
1197 | |
8812
7d48766c21a5
use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents:
8672
diff
changeset
|
1198 // 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
|
1199 // keywords. |
7d48766c21a5
use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents:
8672
diff
changeset
|
1200 |
7d48766c21a5
use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents:
8672
diff
changeset
|
1201 DEFUN (__keywords__, , , |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1202 "-*- texinfo -*-\n\ |
19186
0f9c5a15c8fa
doc: Periodic grammarcheck of documentation.
Rik <rik@octave.org>
parents:
18712
diff
changeset
|
1203 @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
|
1204 Undocumented internal function.\n\ |
7d48766c21a5
use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents:
8672
diff
changeset
|
1205 @end deftypefn") |
581 | 1206 { |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1207 return octave_value (Cell (names (keywords_map))); |
581 | 1208 } |
1209 | |
8812
7d48766c21a5
use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents:
8672
diff
changeset
|
1210 // 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
|
1211 // functions. |
7d48766c21a5
use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents:
8672
diff
changeset
|
1212 |
7d48766c21a5
use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents:
8672
diff
changeset
|
1213 DEFUN (__builtins__, , , |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1214 "-*- texinfo -*-\n\ |
19186
0f9c5a15c8fa
doc: Periodic grammarcheck of documentation.
Rik <rik@octave.org>
parents:
18712
diff
changeset
|
1215 @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
|
1216 Undocumented internal function.\n\ |
7d48766c21a5
use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents:
8672
diff
changeset
|
1217 @end deftypefn") |
3355 | 1218 { |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1219 const string_vector bif = symbol_table::built_in_function_names (); |
3355 | 1220 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1221 return octave_value (Cell (bif)); |
3355 | 1222 } |
1223 | |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1224 static std::string |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1225 do_which (const std::string& name, std::string& type) |
3355 | 1226 { |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1227 std::string file; |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1228 |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1229 type = std::string (); |
3355 | 1230 |
7336 | 1231 octave_value val = symbol_table::find_function (name); |
1232 | |
9416
2cc47338e427
allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents:
9377
diff
changeset
|
1233 if (name.find_first_of ('.') == std::string::npos) |
3355 | 1234 { |
9416
2cc47338e427
allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents:
9377
diff
changeset
|
1235 if (val.is_defined ()) |
2cc47338e427
allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents:
9377
diff
changeset
|
1236 { |
2cc47338e427
allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents:
9377
diff
changeset
|
1237 octave_function *fcn = val.function_value (); |
7336 | 1238 |
9416
2cc47338e427
allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents:
9377
diff
changeset
|
1239 if (fcn) |
2cc47338e427
allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents:
9377
diff
changeset
|
1240 { |
2cc47338e427
allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents:
9377
diff
changeset
|
1241 file = fcn->fcn_file_name (); |
3355 | 1242 |
9416
2cc47338e427
allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents:
9377
diff
changeset
|
1243 if (file.empty ()) |
2cc47338e427
allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents:
9377
diff
changeset
|
1244 { |
2cc47338e427
allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents:
9377
diff
changeset
|
1245 if (fcn->is_user_function ()) |
2cc47338e427
allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents:
9377
diff
changeset
|
1246 type = "command-line function"; |
2cc47338e427
allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents:
9377
diff
changeset
|
1247 else |
15005
74c7265c057a
fix failure with function handles caused by changeset ea6997657614
John W. Eaton <jwe@octave.org>
parents:
14766
diff
changeset
|
1248 { |
74c7265c057a
fix failure with function handles caused by changeset ea6997657614
John W. Eaton <jwe@octave.org>
parents:
14766
diff
changeset
|
1249 file = fcn->src_file_name (); |
74c7265c057a
fix failure with function handles caused by changeset ea6997657614
John W. Eaton <jwe@octave.org>
parents:
14766
diff
changeset
|
1250 type = "built-in function"; |
74c7265c057a
fix failure with function handles caused by changeset ea6997657614
John W. Eaton <jwe@octave.org>
parents:
14766
diff
changeset
|
1251 } |
9416
2cc47338e427
allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents:
9377
diff
changeset
|
1252 } |
2cc47338e427
allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents:
9377
diff
changeset
|
1253 else |
2cc47338e427
allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents:
9377
diff
changeset
|
1254 type = val.is_user_script () |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1255 ? std::string ("script") : std::string ("function"); |
9416
2cc47338e427
allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents:
9377
diff
changeset
|
1256 } |
2cc47338e427
allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents:
9377
diff
changeset
|
1257 } |
2cc47338e427
allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents:
9377
diff
changeset
|
1258 else |
2cc47338e427
allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents:
9377
diff
changeset
|
1259 { |
2cc47338e427
allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents:
9377
diff
changeset
|
1260 // 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
|
1261 |
2cc47338e427
allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents:
9377
diff
changeset
|
1262 file = load_path::find_fcn_file (name); |
2cc47338e427
allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents:
9377
diff
changeset
|
1263 } |
7336 | 1264 } |
8672
2a49c32d4322
allow help to work with files containing only comments
John W. Eaton <jwe@octave.org>
parents:
8631
diff
changeset
|
1265 else |
2a49c32d4322
allow help to work with files containing only comments
John W. Eaton <jwe@octave.org>
parents:
8631
diff
changeset
|
1266 { |
9416
2cc47338e427
allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents:
9377
diff
changeset
|
1267 // File query. |
8672
2a49c32d4322
allow help to work with files containing only comments
John W. Eaton <jwe@octave.org>
parents:
8631
diff
changeset
|
1268 |
9416
2cc47338e427
allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents:
9377
diff
changeset
|
1269 // For compatibility: "file." queries "file". |
2cc47338e427
allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents:
9377
diff
changeset
|
1270 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
|
1271 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
|
1272 else |
2cc47338e427
allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents:
9377
diff
changeset
|
1273 file = load_path::find_file (name); |
17829
c2d9d42f4fe1
which: return the full path to a regular file (bug #40332)
Mike Miller <mtmiller@ieee.org>
parents:
17787
diff
changeset
|
1274 |
c2d9d42f4fe1
which: return the full path to a regular file (bug #40332)
Mike Miller <mtmiller@ieee.org>
parents:
17787
diff
changeset
|
1275 file = octave_env::make_absolute (file); |
8672
2a49c32d4322
allow help to work with files containing only comments
John W. Eaton <jwe@octave.org>
parents:
8631
diff
changeset
|
1276 } |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1277 |
9416
2cc47338e427
allow which look for files on path
Jaroslav Hajek <highegg@gmail.com>
parents:
9377
diff
changeset
|
1278 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1279 return file; |
3355 | 1280 } |
1281 | |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1282 std::string |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1283 do_which (const std::string& name) |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1284 { |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1285 std::string retval; |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1286 |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1287 std::string type; |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1288 |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1289 retval = do_which (name, type); |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1290 |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1291 return retval; |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1292 } |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1293 |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1294 DEFUN (__which__, args, , |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1295 "-*- texinfo -*-\n\ |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1296 @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
|
1297 Undocumented internal function.\n\ |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1298 @end deftypefn") |
581 | 1299 { |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1300 octave_value retval; |
581 | 1301 |
1968 | 1302 string_vector argv = args.make_argv ("which"); |
1755 | 1303 |
3355 | 1304 if (! error_state) |
1305 { | |
20267
a9574e3c6e9e
Deprecate Array::length() and Sparse::length() in favour of ::numel().
Carnë Draug <carandraug@octave.org>
parents:
20207
diff
changeset
|
1306 int argc = argv.numel (); |
581 | 1307 |
3355 | 1308 if (argc > 1) |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
1309 { |
11059
4ffa19147604
replace Octave_map->octave_scalar_map in help.cc and load-save.cc
Jaroslav Hajek <highegg@gmail.com>
parents:
10840
diff
changeset
|
1310 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
|
1311 |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
1312 Cell names (1, argc-1); |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
1313 Cell files (1, argc-1); |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
1314 Cell types (1, argc-1); |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1315 |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
1316 for (int i = 1; i < argc; i++) |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
1317 { |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
1318 std::string name = argv[i]; |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1319 |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
1320 std::string type; |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1321 |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
1322 std::string file = do_which (name, type); |
3141 | 1323 |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
1324 names(i-1) = name; |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
1325 files(i-1) = file; |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
1326 types(i-1) = type; |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
1327 } |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1328 |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
1329 m.assign ("name", names); |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
1330 m.assign ("file", files); |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
1331 m.assign ("type", types); |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1332 |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
1333 retval = m; |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
1334 } |
3355 | 1335 else |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
1336 print_usage (); |
581 | 1337 } |
1338 | |
1339 return retval; | |
1340 } | |
1341 | |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1342 // FIXME: Are we sure this function always does the right thing? |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1343 inline bool |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1344 file_is_in_dir (const std::string filename, const std::string dir) |
5447 | 1345 { |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1346 if (filename.find (dir) == 0) |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1347 { |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1348 const int dir_len = dir.size (); |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1349 const int filename_len = filename.size (); |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1350 const int max_allowed_seps = file_ops::is_dir_sep (dir[dir_len-1]) ? 0 |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1351 : 1; |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11572
diff
changeset
|
1352 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1353 int num_seps = 0; |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1354 for (int i = dir_len; i < filename_len; i++) |
15020
560317fd5977
maint: Cuddle open bracket used for indexing C++ arrays in source code.
Rik <rik@octave.org>
parents:
15005
diff
changeset
|
1355 if (file_ops::is_dir_sep (filename[i])) |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1356 num_seps ++; |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11572
diff
changeset
|
1357 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1358 return (num_seps <= max_allowed_seps); |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1359 } |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1360 else |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1361 return false; |
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1362 } |
5447 | 1363 |
8812
7d48766c21a5
use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents:
8672
diff
changeset
|
1364 // 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
|
1365 // 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
|
1366 // the current path. |
7d48766c21a5
use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents:
8672
diff
changeset
|
1367 |
7d48766c21a5
use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents:
8672
diff
changeset
|
1368 DEFUN (__list_functions__, args, , |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1369 "-*- texinfo -*-\n\ |
10840 | 1370 @deftypefn {Function File} {@var{retval} =} __list_functions__ ()\n\ |
1371 @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
|
1372 Undocumented internal function.\n\ |
7d48766c21a5
use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents:
8672
diff
changeset
|
1373 @end deftypefn") |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1374 { |
8863
34a821854961
pkg.m (generate_lookfor_cache): generate a DOC file for each directory
Jason Riedy <jason@acm.org>
parents:
8861
diff
changeset
|
1375 octave_value retval; |
5447 | 1376 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1377 // 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
|
1378 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
|
1379 string_vector afl = autoloaded_functions (); |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11572
diff
changeset
|
1380 |
8575
f134925a1cfa
m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
8503
diff
changeset
|
1381 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
|
1382 retval = Cell (ffl.append (afl)); |
19437
03067dab10ca
Use stricter input validation when looking for a string as input (bug #42651).
Rik <rik@octave.org>
parents:
19303
diff
changeset
|
1383 else if (args(0).is_string ()) |
5447 | 1384 { |
18111
b560bac0fca2
maint: Don't use space between 'args' and '(' when doing indexing.
Rik <rik@octave.org>
parents:
17829
diff
changeset
|
1385 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
|
1386 |
19437
03067dab10ca
Use stricter input validation when looking for a string as input (bug #42651).
Rik <rik@octave.org>
parents:
19303
diff
changeset
|
1387 string_vector fl = load_path::files (dir, true); |
03067dab10ca
Use stricter input validation when looking for a string as input (bug #42651).
Rik <rik@octave.org>
parents:
19303
diff
changeset
|
1388 |
8863
34a821854961
pkg.m (generate_lookfor_cache): generate a DOC file for each directory
Jason Riedy <jason@acm.org>
parents:
8861
diff
changeset
|
1389 if (! error_state) |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
1390 { |
19437
03067dab10ca
Use stricter input validation when looking for a string as input (bug #42651).
Rik <rik@octave.org>
parents:
19303
diff
changeset
|
1391 // Return a sorted list with unique entries (in case of |
03067dab10ca
Use stricter input validation when looking for a string as input (bug #42651).
Rik <rik@octave.org>
parents:
19303
diff
changeset
|
1392 // .m and .oct versions of the same function in a given |
03067dab10ca
Use stricter input validation when looking for a string as input (bug #42651).
Rik <rik@octave.org>
parents:
19303
diff
changeset
|
1393 // directory, for example). |
03067dab10ca
Use stricter input validation when looking for a string as input (bug #42651).
Rik <rik@octave.org>
parents:
19303
diff
changeset
|
1394 fl.sort (true); |
8863
34a821854961
pkg.m (generate_lookfor_cache): generate a DOC file for each directory
Jason Riedy <jason@acm.org>
parents:
8861
diff
changeset
|
1395 |
19437
03067dab10ca
Use stricter input validation when looking for a string as input (bug #42651).
Rik <rik@octave.org>
parents:
19303
diff
changeset
|
1396 retval = Cell (fl); |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
1397 } |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11572
diff
changeset
|
1398 } |
19437
03067dab10ca
Use stricter input validation when looking for a string as input (bug #42651).
Rik <rik@octave.org>
parents:
19303
diff
changeset
|
1399 else |
03067dab10ca
Use stricter input validation when looking for a string as input (bug #42651).
Rik <rik@octave.org>
parents:
19303
diff
changeset
|
1400 error ("__list_functions__: DIRECTORY argument must be a string"); |
5447 | 1401 |
1402 return retval; | |
1403 } | |
1404 | |
8861 | 1405 DEFUN (doc_cache_file, args, nargout, |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1406 "-*- texinfo -*-\n\ |
10840 | 1407 @deftypefn {Built-in Function} {@var{val} =} doc_cache_file ()\n\ |
8861 | 1408 @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
|
1409 @deftypefnx {Built-in Function} {} doc_cache_file (@var{new_val}, \"local\")\n\ |
8861 | 1410 Query or set the internal variable that specifies the name of the\n\ |
20207
4f45eaf83908
doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents:
20173
diff
changeset
|
1411 Octave documentation cache file.\n\ |
4f45eaf83908
doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents:
20173
diff
changeset
|
1412 \n\ |
4f45eaf83908
doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents:
20173
diff
changeset
|
1413 A cache file significantly improves the performance of the @code{lookfor}\n\ |
4f45eaf83908
doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents:
20173
diff
changeset
|
1414 command. 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
|
1415 @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
|
1416 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
|
1417 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
|
1418 The default value may be overridden by the environment variable\n\ |
10840 | 1419 @w{@env{OCTAVE_DOC_CACHE_FILE}}, or the command line argument\n\ |
20207
4f45eaf83908
doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents:
20173
diff
changeset
|
1420 @option{--doc-cache-file FNAME}.\n\ |
13951
79aa00a94e9e
doc: Document "local" option for configuration variables.
Rik <octave@nomad.inbox5.com>
parents:
13773
diff
changeset
|
1421 \n\ |
17281
bc924baa2c4e
doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents:
17256
diff
changeset
|
1422 When called from inside a function with the @qcode{\"local\"} option, the\n\ |
20207
4f45eaf83908
doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents:
20173
diff
changeset
|
1423 variable is changed locally for the function and any subroutines it calls.\n\ |
17281
bc924baa2c4e
doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents:
17256
diff
changeset
|
1424 The original variable value is restored when exiting the function.\n\ |
16872
5372068bb148
Rename gen_doc_cache() to doc_cache_create().
Rik <rik@octave.org>
parents:
16807
diff
changeset
|
1425 @seealso{doc_cache_create, lookfor, info_program, doc, help, makeinfo_program}\n\ |
20207
4f45eaf83908
doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents:
20173
diff
changeset
|
1426 @seealso{lookfor}\n\ |
8861 | 1427 @end deftypefn") |
1428 { | |
1429 return SET_NONEMPTY_INTERNAL_STRING_VARIABLE (doc_cache_file); | |
1430 } | |
1431 | |
14614
4e9dc46d4125
handle texinfo macros consistently in help system and manual
John W. Eaton <jwe@octave.org>
parents:
14360
diff
changeset
|
1432 DEFUN (texi_macros_file, args, nargout, |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1433 "-*- texinfo -*-\n\ |
14614
4e9dc46d4125
handle texinfo macros consistently in help system and manual
John W. Eaton <jwe@octave.org>
parents:
14360
diff
changeset
|
1434 @deftypefn {Built-in Function} {@var{val} =} texi_macros_file ()\n\ |
4e9dc46d4125
handle texinfo macros consistently in help system and manual
John W. Eaton <jwe@octave.org>
parents:
14360
diff
changeset
|
1435 @deftypefnx {Built-in Function} {@var{old_val} =} texi_macros_file (@var{new_val})\n\ |
4e9dc46d4125
handle texinfo macros consistently in help system and manual
John W. Eaton <jwe@octave.org>
parents:
14360
diff
changeset
|
1436 @deftypefnx {Built-in Function} {} texi_macros_file (@var{new_val}, \"local\")\n\ |
4e9dc46d4125
handle texinfo macros consistently in help system and manual
John W. Eaton <jwe@octave.org>
parents:
14360
diff
changeset
|
1437 Query or set the internal variable that specifies the name of the\n\ |
14618
36f451642f79
doc: Add texi_macros_file to manual.
Rik <octave@nomad.inbox5.com>
parents:
14614
diff
changeset
|
1438 file containing Texinfo macros that are prepended to documentation strings\n\ |
20207
4f45eaf83908
doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents:
20173
diff
changeset
|
1439 before they are passed to makeinfo.\n\ |
4f45eaf83908
doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents:
20173
diff
changeset
|
1440 \n\ |
4f45eaf83908
doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents:
20173
diff
changeset
|
1441 The default value is\n\ |
14614
4e9dc46d4125
handle texinfo macros consistently in help system and manual
John W. Eaton <jwe@octave.org>
parents:
14360
diff
changeset
|
1442 @file{@var{octave-home}/share/octave/@var{version}/etc/macros.texi},\n\ |
4e9dc46d4125
handle texinfo macros consistently in help system and manual
John W. Eaton <jwe@octave.org>
parents:
14360
diff
changeset
|
1443 in which @var{octave-home} is the root directory of the Octave installation,\n\ |
4e9dc46d4125
handle texinfo macros consistently in help system and manual
John W. Eaton <jwe@octave.org>
parents:
14360
diff
changeset
|
1444 and @var{version} is the Octave version number.\n\ |
4e9dc46d4125
handle texinfo macros consistently in help system and manual
John W. Eaton <jwe@octave.org>
parents:
14360
diff
changeset
|
1445 The default value may be overridden by the environment variable\n\ |
4e9dc46d4125
handle texinfo macros consistently in help system and manual
John W. Eaton <jwe@octave.org>
parents:
14360
diff
changeset
|
1446 @w{@env{OCTAVE_TEXI_MACROS_FILE}}, or the command line argument\n\ |
20207
4f45eaf83908
doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents:
20173
diff
changeset
|
1447 @option{--texi-macros-file FNAME}.\n\ |
14614
4e9dc46d4125
handle texinfo macros consistently in help system and manual
John W. Eaton <jwe@octave.org>
parents:
14360
diff
changeset
|
1448 \n\ |
17281
bc924baa2c4e
doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents:
17256
diff
changeset
|
1449 When called from inside a function with the @qcode{\"local\"} option, the\n\ |
20207
4f45eaf83908
doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents:
20173
diff
changeset
|
1450 variable is changed locally for the function and any subroutines it calls.\n\ |
17281
bc924baa2c4e
doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents:
17256
diff
changeset
|
1451 The original variable value is restored when exiting the function.\n\ |
14618
36f451642f79
doc: Add texi_macros_file to manual.
Rik <octave@nomad.inbox5.com>
parents:
14614
diff
changeset
|
1452 @seealso{makeinfo_program}\n\ |
14614
4e9dc46d4125
handle texinfo macros consistently in help system and manual
John W. Eaton <jwe@octave.org>
parents:
14360
diff
changeset
|
1453 @end deftypefn") |
4e9dc46d4125
handle texinfo macros consistently in help system and manual
John W. Eaton <jwe@octave.org>
parents:
14360
diff
changeset
|
1454 { |
4e9dc46d4125
handle texinfo macros consistently in help system and manual
John W. Eaton <jwe@octave.org>
parents:
14360
diff
changeset
|
1455 return SET_NONEMPTY_INTERNAL_STRING_VARIABLE (texi_macros_file); |
4e9dc46d4125
handle texinfo macros consistently in help system and manual
John W. Eaton <jwe@octave.org>
parents:
14360
diff
changeset
|
1456 } |
4e9dc46d4125
handle texinfo macros consistently in help system and manual
John W. Eaton <jwe@octave.org>
parents:
14360
diff
changeset
|
1457 |
5794 | 1458 DEFUN (info_file, args, nargout, |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1459 "-*- texinfo -*-\n\ |
10840 | 1460 @deftypefn {Built-in Function} {@var{val} =} info_file ()\n\ |
5794 | 1461 @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
|
1462 @deftypefnx {Built-in Function} {} info_file (@var{new_val}, \"local\")\n\ |
5794 | 1463 Query or set the internal variable that specifies the name of the\n\ |
20207
4f45eaf83908
doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents:
20173
diff
changeset
|
1464 Octave info file.\n\ |
4f45eaf83908
doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents:
20173
diff
changeset
|
1465 \n\ |
4f45eaf83908
doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents:
20173
diff
changeset
|
1466 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
|
1467 @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
|
1468 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
|
1469 The default value may be overridden by the environment variable\n\ |
10840 | 1470 @w{@env{OCTAVE_INFO_FILE}}, or the command line argument\n\ |
20207
4f45eaf83908
doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents:
20173
diff
changeset
|
1471 @option{--info-file FNAME}.\n\ |
13951
79aa00a94e9e
doc: Document "local" option for configuration variables.
Rik <octave@nomad.inbox5.com>
parents:
13773
diff
changeset
|
1472 \n\ |
17281
bc924baa2c4e
doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents:
17256
diff
changeset
|
1473 When called from inside a function with the @qcode{\"local\"} option, the\n\ |
20207
4f45eaf83908
doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents:
20173
diff
changeset
|
1474 variable is changed locally for the function and any subroutines it calls.\n\ |
17281
bc924baa2c4e
doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents:
17256
diff
changeset
|
1475 The original variable value is restored when exiting the function.\n\ |
5794 | 1476 @seealso{info_program, doc, help, makeinfo_program}\n\ |
1477 @end deftypefn") | |
2202 | 1478 { |
5794 | 1479 return SET_NONEMPTY_INTERNAL_STRING_VARIABLE (info_file); |
2202 | 1480 } |
1481 | |
5794 | 1482 DEFUN (info_program, args, nargout, |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1483 "-*- texinfo -*-\n\ |
10840 | 1484 @deftypefn {Built-in Function} {@var{val} =} info_program ()\n\ |
5794 | 1485 @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
|
1486 @deftypefnx {Built-in Function} {} info_program (@var{new_val}, \"local\")\n\ |
5794 | 1487 Query or set the internal variable that specifies the name of the\n\ |
20207
4f45eaf83908
doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents:
20173
diff
changeset
|
1488 info program to run.\n\ |
4f45eaf83908
doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents:
20173
diff
changeset
|
1489 \n\ |
4f45eaf83908
doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents:
20173
diff
changeset
|
1490 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
|
1491 @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
|
1492 in which @var{octave-home} is the root directory of the Octave installation,\n\ |
20207
4f45eaf83908
doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents:
20173
diff
changeset
|
1493 @var{version} is the Octave version number, and @var{arch} is the system\n\ |
4f45eaf83908
doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents:
20173
diff
changeset
|
1494 type (for example, @code{i686-pc-linux-gnu}). The default value may be\n\ |
4f45eaf83908
doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents:
20173
diff
changeset
|
1495 overridden by the environment variable\n\ |
10840 | 1496 @w{@env{OCTAVE_INFO_PROGRAM}}, or the command line argument\n\ |
20207
4f45eaf83908
doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents:
20173
diff
changeset
|
1497 @option{--info-program NAME}.\n\ |
13951
79aa00a94e9e
doc: Document "local" option for configuration variables.
Rik <octave@nomad.inbox5.com>
parents:
13773
diff
changeset
|
1498 \n\ |
17281
bc924baa2c4e
doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents:
17256
diff
changeset
|
1499 When called from inside a function with the @qcode{\"local\"} option, the\n\ |
20207
4f45eaf83908
doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents:
20173
diff
changeset
|
1500 variable is changed locally for the function and any subroutines it calls.\n\ |
17281
bc924baa2c4e
doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents:
17256
diff
changeset
|
1501 The original variable value is restored when exiting the function.\n\ |
5794 | 1502 @seealso{info_file, doc, help, makeinfo_program}\n\ |
1503 @end deftypefn") | |
1504 { | |
1505 return SET_NONEMPTY_INTERNAL_STRING_VARIABLE (info_program); | |
1506 } | |
3686 | 1507 |
5794 | 1508 DEFUN (makeinfo_program, args, nargout, |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1509 "-*- texinfo -*-\n\ |
10840 | 1510 @deftypefn {Built-in Function} {@var{val} =} makeinfo_program ()\n\ |
5794 | 1511 @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
|
1512 @deftypefnx {Built-in Function} {} makeinfo_program (@var{new_val}, \"local\")\n\ |
5794 | 1513 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
|
1514 program that Octave runs to format help text containing\n\ |
20207
4f45eaf83908
doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents:
20173
diff
changeset
|
1515 Texinfo markup commands.\n\ |
4f45eaf83908
doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents:
20173
diff
changeset
|
1516 \n\ |
4f45eaf83908
doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents:
20173
diff
changeset
|
1517 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
|
1518 \n\ |
17281
bc924baa2c4e
doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents:
17256
diff
changeset
|
1519 When called from inside a function with the @qcode{\"local\"} option, the\n\ |
20207
4f45eaf83908
doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents:
20173
diff
changeset
|
1520 variable is changed locally for the function and any subroutines it calls.\n\ |
17281
bc924baa2c4e
doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents:
17256
diff
changeset
|
1521 The original variable value is restored when exiting the function.\n\ |
14618
36f451642f79
doc: Add texi_macros_file to manual.
Rik <octave@nomad.inbox5.com>
parents:
14614
diff
changeset
|
1522 @seealso{texi_macros_file, info_file, info_program, doc, help}\n\ |
5794 | 1523 @end deftypefn") |
1524 { | |
1525 return SET_NONEMPTY_INTERNAL_STRING_VARIABLE (makeinfo_program); | |
1526 } | |
2202 | 1527 |
5794 | 1528 DEFUN (suppress_verbose_help_message, args, nargout, |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1529 "-*- texinfo -*-\n\ |
10840 | 1530 @deftypefn {Built-in Function} {@var{val} =} suppress_verbose_help_message ()\n\ |
5794 | 1531 @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
|
1532 @deftypefnx {Built-in Function} {} suppress_verbose_help_message (@var{new_val}, \"local\")\n\ |
7001 | 1533 Query or set the internal variable that controls whether Octave\n\ |
5794 | 1534 will add additional help information to the end of the output from\n\ |
3332 | 1535 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
|
1536 \n\ |
17281
bc924baa2c4e
doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents:
17256
diff
changeset
|
1537 When called from inside a function with the @qcode{\"local\"} option, the\n\ |
20207
4f45eaf83908
doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents:
20173
diff
changeset
|
1538 variable is changed locally for the function and any subroutines it calls.\n\ |
17281
bc924baa2c4e
doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents:
17256
diff
changeset
|
1539 The original variable value is restored when exiting the function.\n\ |
5794 | 1540 @end deftypefn") |
1541 { | |
1542 return SET_INTERNAL_VARIABLE (suppress_verbose_help_message); | |
2189 | 1543 } |