Mercurial > hg > octave-lyh
comparison src/input.cc @ 13951:79aa00a94e9e
doc: Document "local" option for configuration variables.
* svd.cc, defaults.cc, dirfns.cc, error.cc, help.cc, input.cc, load-save.cc,
ls-oct-ascii.cc, oct-hist.cc, ov-base.cc, ov-range.cc, ov-struct.cc,
ov-usr-fcn.cc, pager.cc, pr-output.cc, pt-binop.cc, pt-eval.cc, pt-mat.cc,
sighandlers.cc, variables.cc: Document "local" option for configuration
variables.
author | Rik <octave@nomad.inbox5.com> |
---|---|
date | Sun, 27 Nov 2011 16:07:13 -0800 |
parents | c053740eb2aa |
children | c93b953f7d54 |
comparison
equal
deleted
inserted
replaced
13949:0c15fece33ad | 13951:79aa00a94e9e |
---|---|
1358 | 1358 |
1359 DEFUN (PS1, args, nargout, | 1359 DEFUN (PS1, args, nargout, |
1360 "-*- texinfo -*-\n\ | 1360 "-*- texinfo -*-\n\ |
1361 @deftypefn {Built-in Function} {@var{val} =} PS1 ()\n\ | 1361 @deftypefn {Built-in Function} {@var{val} =} PS1 ()\n\ |
1362 @deftypefnx {Built-in Function} {@var{old_val} =} PS1 (@var{new_val})\n\ | 1362 @deftypefnx {Built-in Function} {@var{old_val} =} PS1 (@var{new_val})\n\ |
1363 @deftypefnx {Built-in Function} {} PS1 (@var{new_val}, \"local\")\n\ | |
1363 Query or set the primary prompt string. When executing interactively,\n\ | 1364 Query or set the primary prompt string. When executing interactively,\n\ |
1364 Octave displays the primary prompt when it is ready to read a command.\n\ | 1365 Octave displays the primary prompt when it is ready to read a command.\n\ |
1365 \n\ | 1366 \n\ |
1366 The default value of the primary prompt string is @code{\"\\s:\\#> \"}.\n\ | 1367 The default value of the primary prompt string is @code{\"\\s:\\#> \"}.\n\ |
1367 To change it, use a command like\n\ | 1368 To change it, use a command like\n\ |
1383 PS1 (\"\\\\[\\\\033[01;31m\\\\]\\\\s:\\\\#> \\\\[\\\\033[0m\\]\")\n\ | 1384 PS1 (\"\\\\[\\\\033[01;31m\\\\]\\\\s:\\\\#> \\\\[\\\\033[0m\\]\")\n\ |
1384 @end example\n\ | 1385 @end example\n\ |
1385 \n\ | 1386 \n\ |
1386 @noindent\n\ | 1387 @noindent\n\ |
1387 will give the default Octave prompt a red coloring.\n\ | 1388 will give the default Octave prompt a red coloring.\n\ |
1389 \n\ | |
1390 When called from inside a function with the \"local\" option, the variable is\n\ | |
1391 changed locally for the function and any subroutines it calls. The original\n\ | |
1392 variable value is restored when exiting the function.\n\ | |
1388 @seealso{PS2, PS4}\n\ | 1393 @seealso{PS2, PS4}\n\ |
1389 @end deftypefn") | 1394 @end deftypefn") |
1390 { | 1395 { |
1391 return SET_INTERNAL_VARIABLE (PS1); | 1396 return SET_INTERNAL_VARIABLE (PS1); |
1392 } | 1397 } |
1393 | 1398 |
1394 DEFUN (PS2, args, nargout, | 1399 DEFUN (PS2, args, nargout, |
1395 "-*- texinfo -*-\n\ | 1400 "-*- texinfo -*-\n\ |
1396 @deftypefn {Built-in Function} {@var{val} =} PS2 ()\n\ | 1401 @deftypefn {Built-in Function} {@var{val} =} PS2 ()\n\ |
1397 @deftypefnx {Built-in Function} {@var{old_val} =} PS2 (@var{new_val})\n\ | 1402 @deftypefnx {Built-in Function} {@var{old_val} =} PS2 (@var{new_val})\n\ |
1403 @deftypefnx {Built-in Function} {} PS2 (@var{new_val}, \"local\")\n\ | |
1398 Query or set the secondary prompt string. The secondary prompt is\n\ | 1404 Query or set the secondary prompt string. The secondary prompt is\n\ |
1399 printed when Octave is expecting additional input to complete a\n\ | 1405 printed when Octave is expecting additional input to complete a\n\ |
1400 command. For example, if you are typing a @code{for} loop that spans several\n\ | 1406 command. For example, if you are typing a @code{for} loop that spans several\n\ |
1401 lines, Octave will print the secondary prompt at the beginning of\n\ | 1407 lines, Octave will print the secondary prompt at the beginning of\n\ |
1402 each line after the first. The default value of the secondary prompt\n\ | 1408 each line after the first. The default value of the secondary prompt\n\ |
1403 string is @code{\"> \"}.\n\ | 1409 string is @code{\"> \"}.\n\ |
1410 \n\ | |
1411 When called from inside a function with the \"local\" option, the variable is\n\ | |
1412 changed locally for the function and any subroutines it calls. The original\n\ | |
1413 variable value is restored when exiting the function.\n\ | |
1404 @seealso{PS1, PS4}\n\ | 1414 @seealso{PS1, PS4}\n\ |
1405 @end deftypefn") | 1415 @end deftypefn") |
1406 { | 1416 { |
1407 return SET_INTERNAL_VARIABLE (PS2); | 1417 return SET_INTERNAL_VARIABLE (PS2); |
1408 } | 1418 } |
1409 | 1419 |
1410 DEFUN (PS4, args, nargout, | 1420 DEFUN (PS4, args, nargout, |
1411 "-*- texinfo -*-\n\ | 1421 "-*- texinfo -*-\n\ |
1412 @deftypefn {Built-in Function} {@var{val} =} PS4 ()\n\ | 1422 @deftypefn {Built-in Function} {@var{val} =} PS4 ()\n\ |
1413 @deftypefnx {Built-in Function} {@var{old_val} =} PS4 (@var{new_val})\n\ | 1423 @deftypefnx {Built-in Function} {@var{old_val} =} PS4 (@var{new_val})\n\ |
1424 @deftypefnx {Built-in Function} {} PS4 (@var{new_val}, \"local\")\n\ | |
1414 Query or set the character string used to prefix output produced\n\ | 1425 Query or set the character string used to prefix output produced\n\ |
1415 when echoing commands is enabled.\n\ | 1426 when echoing commands is enabled.\n\ |
1416 The default value is @code{\"+ \"}.\n\ | 1427 The default value is @code{\"+ \"}.\n\ |
1417 @xref{Diary and Echo Commands}, for a description of echoing commands.\n\ | 1428 @xref{Diary and Echo Commands}, for a description of echoing commands.\n\ |
1429 \n\ | |
1430 When called from inside a function with the \"local\" option, the variable is\n\ | |
1431 changed locally for the function and any subroutines it calls. The original\n\ | |
1432 variable value is restored when exiting the function.\n\ | |
1418 @seealso{echo, echo_executing_commands, PS1, PS2}\n\ | 1433 @seealso{echo, echo_executing_commands, PS1, PS2}\n\ |
1419 @end deftypefn") | 1434 @end deftypefn") |
1420 { | 1435 { |
1421 return SET_INTERNAL_VARIABLE (PS4); | 1436 return SET_INTERNAL_VARIABLE (PS4); |
1422 } | 1437 } |
1423 | 1438 |
1424 DEFUN (completion_append_char, args, nargout, | 1439 DEFUN (completion_append_char, args, nargout, |
1425 "-*- texinfo -*-\n\ | 1440 "-*- texinfo -*-\n\ |
1426 @deftypefn {Built-in Function} {@var{val} =} completion_append_char ()\n\ | 1441 @deftypefn {Built-in Function} {@var{val} =} completion_append_char ()\n\ |
1427 @deftypefnx {Built-in Function} {@var{old_val} =} completion_append_char (@var{new_val})\n\ | 1442 @deftypefnx {Built-in Function} {@var{old_val} =} completion_append_char (@var{new_val})\n\ |
1443 @deftypefnx {Built-in Function} {} completion_append_char (@var{new_val}, \"local\")\n\ | |
1428 Query or set the internal character variable that is appended to\n\ | 1444 Query or set the internal character variable that is appended to\n\ |
1429 successful command-line completion attempts. The default\n\ | 1445 successful command-line completion attempts. The default\n\ |
1430 value is @code{\" \"} (a single space).\n\ | 1446 value is @code{\" \"} (a single space).\n\ |
1447 \n\ | |
1448 When called from inside a function with the \"local\" option, the variable is\n\ | |
1449 changed locally for the function and any subroutines it calls. The original\n\ | |
1450 variable value is restored when exiting the function.\n\ | |
1431 @end deftypefn") | 1451 @end deftypefn") |
1432 { | 1452 { |
1433 return SET_INTERNAL_VARIABLE (completion_append_char); | 1453 return SET_INTERNAL_VARIABLE (completion_append_char); |
1434 } | 1454 } |
1435 | 1455 |
1436 DEFUN (echo_executing_commands, args, nargout, | 1456 DEFUN (echo_executing_commands, args, nargout, |
1437 "-*- texinfo -*-\n\ | 1457 "-*- texinfo -*-\n\ |
1438 @deftypefn {Built-in Function} {@var{val} =} echo_executing_commands ()\n\ | 1458 @deftypefn {Built-in Function} {@var{val} =} echo_executing_commands ()\n\ |
1439 @deftypefnx {Built-in Function} {@var{old_val} =} echo_executing_commands (@var{new_val})\n\ | 1459 @deftypefnx {Built-in Function} {@var{old_val} =} echo_executing_commands (@var{new_val})\n\ |
1460 @deftypefnx {Built-in Function} {} echo_executing_commands (@var{new_val}, \"local\")\n\ | |
1440 Query or set the internal variable that controls the echo state.\n\ | 1461 Query or set the internal variable that controls the echo state.\n\ |
1441 It may be the sum of the following values:\n\ | 1462 It may be the sum of the following values:\n\ |
1442 \n\ | 1463 \n\ |
1443 @table @asis\n\ | 1464 @table @asis\n\ |
1444 @item 1\n\ | 1465 @item 1\n\ |
1454 More than one state can be active at once. For example, a value of 3 is\n\ | 1475 More than one state can be active at once. For example, a value of 3 is\n\ |
1455 equivalent to the command @kbd{echo on all}.\n\ | 1476 equivalent to the command @kbd{echo on all}.\n\ |
1456 \n\ | 1477 \n\ |
1457 The value of @code{echo_executing_commands} may be set by the @kbd{echo}\n\ | 1478 The value of @code{echo_executing_commands} may be set by the @kbd{echo}\n\ |
1458 command or the command line option @option{--echo-commands}.\n\ | 1479 command or the command line option @option{--echo-commands}.\n\ |
1480 \n\ | |
1481 When called from inside a function with the \"local\" option, the variable is\n\ | |
1482 changed locally for the function and any subroutines it calls. The original\n\ | |
1483 variable value is restored when exiting the function.\n\ | |
1459 @end deftypefn") | 1484 @end deftypefn") |
1460 { | 1485 { |
1461 return SET_INTERNAL_VARIABLE (echo_executing_commands); | 1486 return SET_INTERNAL_VARIABLE (echo_executing_commands); |
1462 } | 1487 } |
1463 | 1488 |
1504 | 1529 |
1505 DEFUN (filemarker, args, nargout, | 1530 DEFUN (filemarker, args, nargout, |
1506 "-*- texinfo -*-\n\ | 1531 "-*- texinfo -*-\n\ |
1507 @deftypefn {Built-in Function} {@var{val} =} filemarker ()\n\ | 1532 @deftypefn {Built-in Function} {@var{val} =} filemarker ()\n\ |
1508 @deftypefnx {Built-in Function} {} filemarker (@var{new_val})\n\ | 1533 @deftypefnx {Built-in Function} {} filemarker (@var{new_val})\n\ |
1534 @deftypefnx {Built-in Function} {} filemarker (@var{new_val}, \"local\")\n\ | |
1509 Query or set the character used to separate filename from the\n\ | 1535 Query or set the character used to separate filename from the\n\ |
1510 the subfunction names contained within the file. This can be used in\n\ | 1536 the subfunction names contained within the file. This can be used in\n\ |
1511 a generic manner to interact with subfunctions. For example,\n\ | 1537 a generic manner to interact with subfunctions. For example,\n\ |
1512 \n\ | 1538 \n\ |
1513 @example\n\ | 1539 @example\n\ |
1524 dbstop ([\"myfunc\", filemarker, \"mysubfunc\"])\n\ | 1550 dbstop ([\"myfunc\", filemarker, \"mysubfunc\"])\n\ |
1525 @end example\n\ | 1551 @end example\n\ |
1526 \n\ | 1552 \n\ |
1527 @noindent\n\ | 1553 @noindent\n\ |
1528 will set a breakpoint at the first line of the subfunction @code{mysubfunc}.\n\ | 1554 will set a breakpoint at the first line of the subfunction @code{mysubfunc}.\n\ |
1555 \n\ | |
1556 When called from inside a function with the \"local\" option, the variable is\n\ | |
1557 changed locally for the function and any subroutines it calls. The original\n\ | |
1558 variable value is restored when exiting the function.\n\ | |
1529 @end deftypefn") | 1559 @end deftypefn") |
1530 { | 1560 { |
1531 char tmp = Vfilemarker; | 1561 char tmp = Vfilemarker; |
1532 octave_value retval = SET_INTERNAL_VARIABLE (filemarker); | 1562 octave_value retval = SET_INTERNAL_VARIABLE (filemarker); |
1533 | 1563 |