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