# HG changeset patch # User John W. Eaton # Date 1209972112 14400 # Node ID 8e14a01ffe9f3d59e813e1ea579e6819f54c177a # Parent 4ff9a6fdde42de3343c12e2c812a78c9d4cbde43 input.cc (Fre_read_readline_init_file): new function diff -r 4ff9a6fdde42 -r 8e14a01ffe9f liboctave/ChangeLog --- a/liboctave/ChangeLog Mon May 05 03:10:16 2008 -0400 +++ b/liboctave/ChangeLog Mon May 05 03:21:52 2008 -0400 @@ -1,3 +1,12 @@ +2008-05-05 John W. Eaton + + * cmd-edit.cc (command_editor::re_read_init_file, + gnu_readline::do_re_read_init_file): New functions. + * cmd-edit.h (command_editor::re_read_init_file): Provide decl. + (command_editor::do_re_read_init_file): New function. + * oct-rl-edit.c (octave_rl_re_read_init_file): New function. + * oct-rl-edit.h: Provide decl. + 2008-05-05 Rafael Laboissiere * oct-rl-edit.c (octave_read_init_file): Simply call rl_read_init_file. diff -r 4ff9a6fdde42 -r 8e14a01ffe9f liboctave/cmd-edit.cc --- a/liboctave/cmd-edit.cc Mon May 05 03:10:16 2008 -0400 +++ b/liboctave/cmd-edit.cc Mon May 05 03:21:52 2008 -0400 @@ -156,6 +156,8 @@ void do_read_init_file (const std::string& file); + void do_re_read_init_file (void); + bool do_filename_completion_desired (bool); bool do_filename_quoting_desired (bool); @@ -560,6 +562,12 @@ ::octave_rl_read_init_file (file.c_str ()); } +void +gnu_readline::do_re_read_init_file (void) +{ + ::octave_rl_re_read_init_file (); +} + bool gnu_readline::do_filename_completion_desired (bool arg) { @@ -1186,6 +1194,13 @@ } } +void +command_editor::re_read_init_file (void) +{ + if (instance_ok ()) + instance->do_re_read_init_file (); +} + bool command_editor::filename_completion_desired (bool arg) { diff -r 4ff9a6fdde42 -r 8e14a01ffe9f liboctave/cmd-edit.h --- a/liboctave/cmd-edit.h Mon May 05 03:10:16 2008 -0400 +++ b/liboctave/cmd-edit.h Mon May 05 03:21:52 2008 -0400 @@ -138,6 +138,8 @@ static void read_init_file (const std::string& file = std::string ()); + static void re_read_init_file (void); + static bool filename_completion_desired (bool); static bool filename_quoting_desired (bool); @@ -270,6 +272,8 @@ virtual void do_read_init_file (const std::string&) { } + virtual void do_re_read_init_file (void) { } + virtual bool do_filename_completion_desired (bool) { return false; } virtual bool do_filename_quoting_desired (bool) { return false; } diff -r 4ff9a6fdde42 -r 8e14a01ffe9f liboctave/oct-rl-edit.c --- a/liboctave/oct-rl-edit.c Mon May 05 03:10:16 2008 -0400 +++ b/liboctave/oct-rl-edit.c Mon May 05 03:21:52 2008 -0400 @@ -197,6 +197,12 @@ rl_read_init_file (f); } +void +octave_rl_re_read_init_file (void) +{ + rl_re_read_init_file (0, 0); +} + int octave_rl_filename_completion_desired (int arg) { diff -r 4ff9a6fdde42 -r 8e14a01ffe9f liboctave/oct-rl-edit.h --- a/liboctave/oct-rl-edit.h Mon May 05 03:10:16 2008 -0400 +++ b/liboctave/oct-rl-edit.h Mon May 05 03:21:52 2008 -0400 @@ -84,6 +84,8 @@ extern void octave_rl_read_init_file (const char *); +extern void octave_rl_re_read_init_file (void); + extern int octave_rl_filename_completion_desired (int); extern int octave_rl_filename_quoting_desired (int); diff -r 4ff9a6fdde42 -r 8e14a01ffe9f src/ChangeLog --- a/src/ChangeLog Mon May 05 03:10:16 2008 -0400 +++ b/src/ChangeLog Mon May 05 03:21:52 2008 -0400 @@ -1,3 +1,7 @@ +2008-05-05 John W. Eaton + + * input.cc (Fre_read_readline_init_file): New function. + 2008-05-04 John W. Eaton * ov-fcn-handle.cc (Ffunctions): Pass octave_value object instead diff -r 4ff9a6fdde42 -r 8e14a01ffe9f src/input.cc --- a/src/input.cc Mon May 05 03:10:16 2008 -0400 +++ b/src/input.cc Mon May 05 03:21:52 2008 -0400 @@ -1133,6 +1133,24 @@ return retval; } +DEFUN (re_read_readline_init_file, args, , + "-*- texinfo -*-\n\ +@deftypefn {Built-in Function} {} re_read_readline_init_file ()\n\ +Re-read the last readline library initialization file that was read.\n\ +@xref{Readline Init File, , , readline, GNU Readline Library},\n\ +for details.\n\ +@end deftypefn") +{ + octave_value_list retval; + + if (args.length () == 0) + command_editor::re_read_init_file (); + else + print_usage (); + + return retval; +} + static std::string hook_fcn; static octave_value user_data;