changeset 11405:51b6193e90bb

Documentation fixes * input.cc (PS1): Give an example of how PS1 can use ANSI escape codes for getting a colourised prompt. * oct-hist.cc (history): Correct documentation about how history('-r') appends to history, doesn't replace it.
author Jordi Gutiérrez Hermoso <jordigh@gmail.com>
date Wed, 22 Dec 2010 03:53:39 -0500
parents c98a8348971b
children a7e73f903ea6
files src/ChangeLog src/input.cc src/oct-hist.cc
diffstat 3 files changed, 20 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Wed Dec 22 03:50:42 2010 -0500
+++ b/src/ChangeLog	Wed Dec 22 03:53:39 2010 -0500
@@ -1,3 +1,10 @@
+2010-12-22  Jordi GutiƩrrez Hermoso  <jordigh@gmail.com>
+
+	* input.cc (PS1): Give an example of how PS1 can use ANSI escape
+	codes for getting a colourised prompt.
+	* oct-hist.cc (history): Correct documentation about how
+	history("-r") appends to history, doesn't replace it.
+
 2010-12-22  Judd Storrs  <jstorrs@gmail.com>
 
 	* data.cc (Fvec): New optional second argument to set dimension
--- a/src/input.cc	Wed Dec 22 03:50:42 2010 -0500
+++ b/src/input.cc	Wed Dec 22 03:53:39 2010 -0500
@@ -1370,15 +1370,23 @@
 To change it, use a command like\n\
 \n\
 @example\n\
-octave:13> PS1 (\"\\\\u@@\\\\H> \")\n\
+PS1 (\"\\\\u@@\\\\H> \")\n\
 @end example\n\
 \n\
 @noindent\n\
 which will result in the prompt @samp{boris@@kremvax> } for the user\n\
 @samp{boris} logged in on the host @samp{kremvax.kgb.su}.  Note that two\n\
 backslashes are required to enter a backslash into a double-quoted\n\
-character string.\n\
-@xref{Strings}.\n\
+character string. @xref{Strings}\n\
+\n\
+You can also use ANSI escape sequences if your terminal supports them.\n\
+This can be useful for colouring the prompt. For example,\n\
+\n\
+@example\n\
+PS1 (\"\\\\[\\\\033[01;31m\\\\]\\\\s:\\\\#> \\\\[\\\\033[0m\\]\")\n\
+@end example\n\
+\n\
+will give the default Octave prompt a red colouring.\n\
 @seealso{PS2, PS4}\n\
 @end deftypefn")
 {
--- a/src/oct-hist.cc	Wed Dec 22 03:50:42 2010 -0500
+++ b/src/oct-hist.cc	Wed Dec 22 03:53:39 2010 -0500
@@ -597,8 +597,8 @@
 omitted, use the default history file (normally @file{~/.octave_hist}).\n\
 \n\
 @item -r @var{file}\n\
-Read the file @var{file}, replacing the current history list with its\n\
-contents.  If the name is omitted, use the default history 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 @var{n}\n\