Mercurial > octave
diff libinterp/corefcn/oct-hist.cc @ 21966:112b20240c87
move docstrings in C++ files out of C strings and into comments
* __contourc__.cc, __dispatch__.cc, __dsearchn__.cc, __ichol__.cc,
__ilu__.cc, __lin_interpn__.cc, __luinc__.cc, __magick_read__.cc,
__pchip_deriv__.cc, __qp__.cc, balance.cc, besselj.cc, betainc.cc,
bitfcns.cc, bsxfun.cc, cellfun.cc, colloc.cc, conv2.cc, daspk.cc,
dasrt.cc, dassl.cc, data.cc, debug.cc, defaults.cc, det.cc, dirfns.cc,
dlmread.cc, dot.cc, eig.cc, ellipj.cc, error.cc, fft.cc, fft2.cc,
fftn.cc, file-io.cc, filter.cc, find.cc, gammainc.cc, gcd.cc,
getgrent.cc, getpwent.cc, getrusage.cc, givens.cc, graphics.cc,
hash.cc, help.cc, hess.cc, hex2num.cc, input.cc, inv.cc, kron.cc,
load-path.cc, load-save.cc, lookup.cc, ls-oct-text.cc, lsode.cc,
lu.cc, mappers.cc, matrix_type.cc, max.cc, mgorth.cc, nproc.cc,
oct-hist.cc, octave-link.cc, ordschur.cc, pager.cc, pinv.cc,
pr-output.cc, profiler.cc, psi.cc, pt-jit.cc, quad.cc, quadcc.cc,
qz.cc, rand.cc, rcond.cc, regexp.cc, schur.cc, sighandlers.cc,
sparse.cc, spparms.cc, sqrtm.cc, str2double.cc, strfind.cc, strfns.cc,
sub2ind.cc, svd.cc, sylvester.cc, symtab.cc, syscalls.cc, sysdep.cc,
time.cc, toplev.cc, tril.cc, tsearch.cc, typecast.cc, urlwrite.cc,
utils.cc, variables.cc, __delaunayn__.cc, __eigs__.cc,
__fltk_uigetfile__.cc, __glpk__.cc, __init_fltk__.cc,
__init_gnuplot__.cc, __osmesa_print__.cc, __voronoi__.cc, amd.cc,
audiodevinfo.cc, audioread.cc, ccolamd.cc, chol.cc, colamd.cc,
convhulln.cc, dmperm.cc, fftw.cc, qr.cc, symbfact.cc, symrcm.cc,
ov-base.cc, ov-bool-mat.cc, ov-cell.cc, ov-class.cc, ov-classdef.cc,
ov-fcn-handle.cc, ov-fcn-inline.cc, ov-flt-re-mat.cc, ov-int16.cc,
ov-int32.cc, ov-int64.cc, ov-int8.cc, ov-java.cc, ov-null-mat.cc,
ov-oncleanup.cc, ov-range.cc, ov-re-mat.cc, ov-struct.cc,
ov-typeinfo.cc, ov-uint16.cc, ov-uint32.cc, ov-uint64.cc, ov-uint8.cc,
ov-usr-fcn.cc, ov.cc, octave.cc, pt-arg-list.cc, pt-binop.cc,
pt-eval.cc, pt-mat.cc, lex.ll, oct-parse.in.yy:
Docstrings are now comments instead of C strings.
* build-aux/mk-opts.pl: Emit docstrings as comments instead of C
strings.
* DASPK-opts.in, LSODE-opts.in: Don't quote " in docstring fragments.
* builtins.h: Include builtin-defun-decls.h unconditionally.
* defun.h (DEFUN, DEFUNX, DEFCONSTFUN): Simply emit declaration.
(DEFALIAS): Always expand to nothing.
* defun-dld.h: No special macro expansions for MAKE_BUILTINS.
(DEFUN_DLD): Use FORWARD_DECLARE_FUN.
(DEFUNX_DLD): Use FORWARD_DECLARE_FUNX.
* defun-int.h: No special macro expansions for MAKE_BUILTINS.
(FORWARD_DECLARE_FUN, FORWARD_DECLARE_FUNX): New macros.
(DEFINE_FUN_INSTALLER_FUN): If compiling an Octave source file, pass
"external-doc" to DEFINE_FUNX_INSTALLER_FUN.
(DEFUN_INTERNAL, DEFCONSTFUN_INTERNAL, DEFUNX_INTERNAL,
DEFALIAS_INTERNAL): Delete.
* common.mk (move_if_change_rule): New macro.
(simple_move_if_change_rule): Define using move_if_change_rule.
* find-defun-files.sh (DEFUN_PATTERN): Update. Don't transform file
name extension to ".df".
* libinterp/mk-pkg-add, gendoc.pl: Operate directly on source files.
* mkbuiltins: New argument, SRCDIR. Operate directly on source files.
* mkdefs: Delete.
* libinterp/module.mk (BUILT_SOURCES): Update list to contain only
files included in other source files.
(GENERATED_MAKE_BUILTINS_INCS, DEF_FILES): Delete.
(LIBINTERP_BUILT_DISTFILES): Include $(OPT_HANDLERS) here.
(LIBINTERP_BUILT_NODISTFILES): Not here. Remove $(ALL_DEF_FILES from
the list.
(libinterp_EXTRA_DIST): Remove mkdefs from the list.
(FOUND_DEFUN_FILES): Rename from SRC_DEF_FILES.
(DLDFCN_DEFUN_FILES): Rename from DLDFCN_DEF_FILES.
(SRC_DEFUN_FILES): Rename from SRC_DEF_FILES.
(ALL_DEFUN_FILES): Rename from ALL_DEF_FILES.
(%.df: %.cc): Delete pattern rule.
(libinterp/build-env-features.cc, libinterp/builtins.cc,
libinterp/dldfcn/PKG_ADD): Use mv instead of move-if-change.
(libinterp/builtins.cc, libinterp/builtin-defun-decls.h):
Update mkbuiltins command.
($(srcdir)/libinterp/DOCSTRINGS): Update gendoc.pl command.
* liboctave/module.mk (BUILT_SOURCES): Don't include
liboctave-build-info.cc in the list.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Tue, 21 Jun 2016 16:07:51 -0400 |
parents | 4d723ba06b4a |
children | 6db928d06b07 |
line wrap: on
line diff
--- a/libinterp/corefcn/oct-hist.cc Tue Jun 21 13:08:25 2016 -0700 +++ b/libinterp/corefcn/oct-hist.cc Tue Jun 21 16:07:51 2016 -0400 @@ -552,39 +552,39 @@ } DEFUN (edit_history, args, , - "-*- texinfo -*-\n\ -@deftypefn {} {} edit_history\n\ -@deftypefnx {} {} edit_history @var{cmd_number}\n\ -@deftypefnx {} {} edit_history @var{first} @var{last}\n\ -Edit the history list using the editor named by the variable @env{EDITOR}.\n\ -\n\ -The commands to be edited are first copied to a temporary file. When you\n\ -exit the editor, Octave executes the commands that remain in the file. It\n\ -is often more convenient to use @code{edit_history} to define functions\n\ -rather than attempting to enter them directly on the command line.\n\ -The block of commands is executed as soon as you exit the editor.\n\ -To avoid executing any commands, simply delete all the lines from the buffer\n\ -before leaving the editor.\n\ -\n\ -When invoked with no arguments, edit the previously executed command;\n\ -With one argument, edit the specified command @var{cmd_number};\n\ -With two arguments, edit the list of commands between @var{first} and\n\ -@var{last}. Command number specifiers may also be negative where -1\n\ -refers to the most recently executed command.\n\ -The following are equivalent and edit the most recently executed command.\n\ -\n\ -@example\n\ -@group\n\ -edit_history\n\ -edit_history -1\n\ -@end group\n\ -@end example\n\ -\n\ -When using ranges, specifying a larger number for the first command than the\n\ -last command reverses the list of commands before they are placed in the\n\ -buffer to be edited.\n\ -@seealso{run_history, history}\n\ -@end deftypefn") + doc: /* -*- texinfo -*- +@deftypefn {} {} edit_history +@deftypefnx {} {} edit_history @var{cmd_number} +@deftypefnx {} {} edit_history @var{first} @var{last} +Edit the history list using the editor named by the variable @env{EDITOR}. + +The commands to be edited are first copied to a temporary file. When you +exit the editor, Octave executes the commands that remain in the file. It +is often more convenient to use @code{edit_history} to define functions +rather than attempting to enter them directly on the command line. +The block of commands is executed as soon as you exit the editor. +To avoid executing any commands, simply delete all the lines from the buffer +before leaving the editor. + +When invoked with no arguments, edit the previously executed command; +With one argument, edit the specified command @var{cmd_number}; +With two arguments, edit the list of commands between @var{first} and +@var{last}. Command number specifiers may also be negative where -1 +refers to the most recently executed command. +The following are equivalent and edit the most recently executed command. + +@example +@group +edit_history +edit_history -1 +@end group +@end example + +When using ranges, specifying a larger number for the first command than the +last command reverses the list of commands before they are placed in the +buffer to be edited. +@seealso{run_history, history} +@end deftypefn */) { if (args.length () > 2) print_usage (); @@ -595,46 +595,46 @@ } DEFUN (history, args, nargout, - "-*- texinfo -*-\n\ -@deftypefn {} {} history\n\ -@deftypefnx {} {} history @var{opt1} @dots{}\n\ -@deftypefnx {} {@var{h} =} history ()\n\ -@deftypefnx {} {@var{h} =} history (@var{opt1}, @dots{})\n\ -If invoked with no arguments, @code{history} displays a list of commands\n\ -that you have executed.\n\ -\n\ -Valid options are:\n\ -\n\ -@table @code\n\ -@item @var{n}\n\ -@itemx -@var{n}\n\ -Display only the most recent @var{n} lines of history.\n\ -\n\ -@item -c\n\ -Clear the history list.\n\ -\n\ -@item -q\n\ -Don't number the displayed lines of history. This is useful for cutting\n\ -and pasting commands using the X Window System.\n\ -\n\ -@item -r @var{file}\n\ -Read the file @var{file}, appending its contents to the current\n\ -history list. If the name is omitted, use the default history file\n\ -(normally @file{~/.octave_hist}).\n\ -\n\ -@item -w @var{file}\n\ -Write the current history to the file @var{file}. If the name is\n\ -omitted, use the default history file (normally @file{~/.octave_hist}).\n\ -@end table\n\ -\n\ -For example, to display the five most recent commands that you have\n\ -typed without displaying line numbers, use the command\n\ -@kbd{history -q 5}.\n\ -\n\ -If invoked with a single output argument, the history will be saved to that\n\ -argument as a cell string and will not be output to screen.\n\ -@seealso{edit_history, run_history}\n\ -@end deftypefn") + doc: /* -*- texinfo -*- +@deftypefn {} {} history +@deftypefnx {} {} history @var{opt1} @dots{} +@deftypefnx {} {@var{h} =} history () +@deftypefnx {} {@var{h} =} history (@var{opt1}, @dots{}) +If invoked with no arguments, @code{history} displays a list of commands +that you have executed. + +Valid options are: + +@table @code +@item @var{n} +@itemx -@var{n} +Display only the most recent @var{n} lines of history. + +@item -c +Clear the history list. + +@item -q +Don't number the displayed lines of history. This is useful for cutting +and pasting commands using the X Window System. + +@item -r @var{file} +Read the file @var{file}, appending its contents to the current +history list. If the name is omitted, use the default history file +(normally @file{~/.octave_hist}). + +@item -w @var{file} +Write the current history to the file @var{file}. If the name is +omitted, use the default history file (normally @file{~/.octave_hist}). +@end table + +For example, to display the five most recent commands that you have +typed without displaying line numbers, use the command +@kbd{history -q 5}. + +If invoked with a single output argument, the history will be saved to that +argument as a cell string and will not be output to screen. +@seealso{edit_history, run_history} +@end deftypefn */) { // Call do_history even if nargout is zero to display history list. @@ -644,56 +644,56 @@ } DEFUN (run_history, args, , - "-*- texinfo -*-\n\ -@deftypefn {} {} run_history\n\ -@deftypefnx {} {} run_history @var{cmd_number}\n\ -@deftypefnx {} {} run_history @var{first} @var{last}\n\ -Run commands from the history list.\n\ -\n\ -When invoked with no arguments, run the previously executed command;\n\ -\n\ -With one argument, run the specified command @var{cmd_number};\n\ -\n\ -With two arguments, run the list of commands between @var{first} and\n\ -@var{last}. Command number specifiers may also be negative where -1\n\ -refers to the most recently executed command. For example, the command\n\ -\n\ -@example\n\ -@group\n\ -run_history\n\ - OR\n\ -run_history -1\n\ -@end group\n\ -@end example\n\ -\n\ -@noindent\n\ -executes the most recent command again.\n\ -The command\n\ -\n\ -@example\n\ -run_history 13 169\n\ -@end example\n\ -\n\ -@noindent\n\ -executes commands 13 through 169.\n\ -\n\ -Specifying a larger number for the first command than the last command\n\ -reverses the list of commands before executing them.\n\ -For example:\n\ -\n\ -@example\n\ -@group\n\ -disp (1)\n\ -disp (2)\n\ -run_history -1 -2\n\ -@result{}\n\ - 2\n\ - 1\n\ -@end group\n\ -@end example\n\ -\n\ -@seealso{edit_history, history}\n\ -@end deftypefn") + doc: /* -*- texinfo -*- +@deftypefn {} {} run_history +@deftypefnx {} {} run_history @var{cmd_number} +@deftypefnx {} {} run_history @var{first} @var{last} +Run commands from the history list. + +When invoked with no arguments, run the previously executed command; + +With one argument, run the specified command @var{cmd_number}; + +With two arguments, run the list of commands between @var{first} and +@var{last}. Command number specifiers may also be negative where -1 +refers to the most recently executed command. For example, the command + +@example +@group +run_history + OR +run_history -1 +@end group +@end example + +@noindent +executes the most recent command again. +The command + +@example +run_history 13 169 +@end example + +@noindent +executes commands 13 through 169. + +Specifying a larger number for the first command than the last command +reverses the list of commands before executing them. +For example: + +@example +@group +disp (1) +disp (2) +run_history -1 -2 +@result{} + 2 + 1 +@end group +@end example + +@seealso{edit_history, history} +@end deftypefn */) { if (args.length () > 2) print_usage (); @@ -704,28 +704,28 @@ } DEFUN (history_control, args, nargout, - "-*- texinfo -*-\n\ -@deftypefn {} {@var{val} =} history_control ()\n\ -@deftypefnx {} {@var{old_val} =} history_control (@var{new_val})\n\ -Query or set the internal variable that specifies how commands are saved\n\ -to the history list.\n\ -\n\ -The default value is an empty character string, but may be overridden by the\n\ -environment variable @w{@env{OCTAVE_HISTCONTROL}}.\n\ -\n\ -The value of @code{history_control} is a colon-separated list of values\n\ -controlling how commands are saved on the history list. If the list\n\ -of values includes @code{ignorespace}, lines which begin with a space\n\ -character are not saved in the history list. A value of @code{ignoredups}\n\ -causes lines matching the previous history entry to not be saved.\n\ -A value of @code{ignoreboth} is shorthand for @code{ignorespace} and\n\ -@code{ignoredups}. A value of @code{erasedups} causes all previous lines\n\ -matching the current line to be removed from the history list before that\n\ -line is saved. Any value not in the above list is ignored. If\n\ -@code{history_control} is the empty string, all commands are saved on\n\ -the history list, subject to the value of @code{history_save}.\n\ -@seealso{history_file, history_size, history_timestamp_format_string, history_save}\n\ -@end deftypefn") + doc: /* -*- texinfo -*- +@deftypefn {} {@var{val} =} history_control () +@deftypefnx {} {@var{old_val} =} history_control (@var{new_val}) +Query or set the internal variable that specifies how commands are saved +to the history list. + +The default value is an empty character string, but may be overridden by the +environment variable @w{@env{OCTAVE_HISTCONTROL}}. + +The value of @code{history_control} is a colon-separated list of values +controlling how commands are saved on the history list. If the list +of values includes @code{ignorespace}, lines which begin with a space +character are not saved in the history list. A value of @code{ignoredups} +causes lines matching the previous history entry to not be saved. +A value of @code{ignoreboth} is shorthand for @code{ignorespace} and +@code{ignoredups}. A value of @code{erasedups} causes all previous lines +matching the current line to be removed from the history list before that +line is saved. Any value not in the above list is ignored. If +@code{history_control} is the empty string, all commands are saved on +the history list, subject to the value of @code{history_save}. +@seealso{history_file, history_size, history_timestamp_format_string, history_save} +@end deftypefn */) { octave_value retval; @@ -742,16 +742,16 @@ } DEFUN (history_size, args, nargout, - "-*- texinfo -*-\n\ -@deftypefn {} {@var{val} =} history_size ()\n\ -@deftypefnx {} {@var{old_val} =} history_size (@var{new_val})\n\ -Query or set the internal variable that specifies how many entries\n\ -to store in the history file.\n\ -\n\ -The default value is @code{1000}, but may be overridden by the environment\n\ -variable @w{@env{OCTAVE_HISTSIZE}}.\n\ -@seealso{history_file, history_timestamp_format_string, history_save}\n\ -@end deftypefn") + doc: /* -*- texinfo -*- +@deftypefn {} {@var{val} =} history_size () +@deftypefnx {} {@var{old_val} =} history_size (@var{new_val}) +Query or set the internal variable that specifies how many entries +to store in the history file. + +The default value is @code{1000}, but may be overridden by the environment +variable @w{@env{OCTAVE_HISTSIZE}}. +@seealso{history_file, history_timestamp_format_string, history_save} +@end deftypefn */) { octave_value retval; @@ -770,16 +770,16 @@ } DEFUN (history_file, args, nargout, - "-*- texinfo -*-\n\ -@deftypefn {} {@var{val} =} history_file ()\n\ -@deftypefnx {} {@var{old_val} =} history_file (@var{new_val})\n\ -Query or set the internal variable that specifies the name of the\n\ -file used to store command history.\n\ -\n\ -The default value is @file{~/.octave_hist}, but may be overridden by the\n\ -environment variable @w{@env{OCTAVE_HISTFILE}}.\n\ -@seealso{history_size, history_save, history_timestamp_format_string}\n\ -@end deftypefn") + doc: /* -*- texinfo -*- +@deftypefn {} {@var{val} =} history_file () +@deftypefnx {} {@var{old_val} =} history_file (@var{new_val}) +Query or set the internal variable that specifies the name of the +file used to store command history. + +The default value is @file{~/.octave_hist}, but may be overridden by the +environment variable @w{@env{OCTAVE_HISTFILE}}. +@seealso{history_size, history_save, history_timestamp_format_string} +@end deftypefn */) { octave_value retval; @@ -796,42 +796,42 @@ } DEFUN (history_timestamp_format_string, args, nargout, - "-*- texinfo -*-\n\ -@deftypefn {} {@var{val} =} history_timestamp_format_string ()\n\ -@deftypefnx {} {@var{old_val} =} history_timestamp_format_string (@var{new_val})\n\ -@deftypefnx {} {} history_timestamp_format_string (@var{new_val}, \"local\")\n\ -Query or set the internal variable that specifies the format string\n\ -for the comment line that is written to the history file when Octave\n\ -exits.\n\ -\n\ -The format string is passed to @code{strftime}. The default value is\n\ -\n\ -@example\n\ -\"# Octave VERSION, %a %b %d %H:%M:%S %Y %Z <USER@@HOST>\"\n\ -@end example\n\ -\n\ -When called from inside a function with the @qcode{\"local\"} option, the\n\ -variable is changed locally for the function and any subroutines it calls.\n\ -The original variable value is restored when exiting the function.\n\ -@seealso{strftime, history_file, history_size, history_save}\n\ -@end deftypefn") + doc: /* -*- texinfo -*- +@deftypefn {} {@var{val} =} history_timestamp_format_string () +@deftypefnx {} {@var{old_val} =} history_timestamp_format_string (@var{new_val}) +@deftypefnx {} {} history_timestamp_format_string (@var{new_val}, "local") +Query or set the internal variable that specifies the format string +for the comment line that is written to the history file when Octave +exits. + +The format string is passed to @code{strftime}. The default value is + +@example +"# Octave VERSION, %a %b %d %H:%M:%S %Y %Z <USER@@HOST>" +@end example + +When called from inside a function with the @qcode{"local"} option, the +variable is changed locally for the function and any subroutines it calls. +The original variable value is restored when exiting the function. +@seealso{strftime, history_file, history_size, history_save} +@end deftypefn */) { return SET_INTERNAL_VARIABLE (history_timestamp_format_string); } DEFUN (history_save, args, nargout, - "-*- texinfo -*-\n\ -@deftypefn {} {@var{val} =} history_save ()\n\ -@deftypefnx {} {@var{old_val} =} history_save (@var{new_val})\n\ -@deftypefnx {} {} history_save (@var{new_val}, \"local\")\n\ -Query or set the internal variable that controls whether commands entered\n\ -on the command line are saved in the history file.\n\ -\n\ -When called from inside a function with the @qcode{\"local\"} option, the\n\ -variable is changed locally for the function and any subroutines it calls.\n\ -The original variable value is restored when exiting the function.\n\ -@seealso{history_control, history_file, history_size, history_timestamp_format_string}\n\ -@end deftypefn") + doc: /* -*- texinfo -*- +@deftypefn {} {@var{val} =} history_save () +@deftypefnx {} {@var{old_val} =} history_save (@var{new_val}) +@deftypefnx {} {} history_save (@var{new_val}, "local") +Query or set the internal variable that controls whether commands entered +on the command line are saved in the history file. + +When called from inside a function with the @qcode{"local"} option, the +variable is changed locally for the function and any subroutines it calls. +The original variable value is restored when exiting the function. +@seealso{history_control, history_file, history_size, history_timestamp_format_string} +@end deftypefn */) { octave_value retval;