# HG changeset patch # User jwe # Date 1196194579 0 # Node ID ffdbdf53665c730f30a09e54233fd8060c270567 # Parent 76341ffda11e071405bce761e436bbbfa03f99fa [project @ 2007-11-27 20:14:41 by jwe] diff -r 76341ffda11e -r ffdbdf53665c scripts/ChangeLog --- a/scripts/ChangeLog Tue Nov 27 18:23:48 2007 +0000 +++ b/scripts/ChangeLog Tue Nov 27 20:16:19 2007 +0000 @@ -1,9 +1,14 @@ +2007-11-27 David Bateman + + * plot/__go_draw_figure__.m: Force a multiplot mode with a + colorbar, to ensure that the colorbar is on the canvas for png and + postscipt outputs. + 2007-11-26 David Bateman * sparse/spstats.m, statistics/base/mode.m: More care with sparse return values. - * plot/plotyy.m: New function * plot/Makefile.in (SOURCES): Add it here. * plot/__go_draw_axes__.m: Force axis margins for plotyy. Set text diff -r 76341ffda11e -r ffdbdf53665c scripts/plot/__go_draw_figure__.m --- a/scripts/plot/__go_draw_figure__.m Tue Nov 27 18:23:48 2007 +0000 +++ b/scripts/plot/__go_draw_figure__.m Tue Nov 27 20:16:19 2007 +0000 @@ -37,6 +37,10 @@ switch (obj.type) case "axes" axes_count++; + ## Force multiplot with a colorbar to ensure colorbar on the page + if (!strcmp (obj.__colorbar__, "none")) + axes_count++; + endif endswitch endfor diff -r 76341ffda11e -r ffdbdf53665c src/ChangeLog --- a/src/ChangeLog Tue Nov 27 18:23:48 2007 +0000 +++ b/src/ChangeLog Tue Nov 27 20:16:19 2007 +0000 @@ -1,5 +1,13 @@ 2007-11-27 John W. Eaton + * error.cc (Fwarning): If setting state "all" to "error", leave + Octave:matlab-incompatible warning state unchanged. + + * octave.cc (execute_eval_option_code, execute_command_line_file): + Handle interrupts. + * toplev.cc (recover_from_exception): Now extern. + * toplev.h (recover_from_exception): Provide decl. + * pt-idx.cc (tree_index_expression::lvalue): Treat object == [] the same as undefined. diff -r 76341ffda11e -r ffdbdf53665c src/error.cc --- a/src/error.cc Tue Nov 27 18:23:48 2007 +0000 +++ b/src/error.cc Tue Nov 27 20:16:19 2007 +0000 @@ -1074,8 +1074,44 @@ { Octave_map tmp; - tmp.assign ("identifier", arg2); - tmp.assign ("state", arg1); + Cell id (1, 1); + Cell st (1, 1); + + id(0) = arg2; + st(0) = arg1; + + // Since internal Octave functions are not + // compatible, turning all warnings into errors + // should leave the state of + // Octave:matlab-incompatible alone. + + if (arg1 == "error" + && warning_options.contains ("identifier")) + { + Cell tid = warning_options.contents ("identifier"); + Cell tst = warning_options.contents ("state"); + + for (octave_idx_type i = 0; i < tid.numel (); i++) + { + octave_value vid = tid(i); + + if (vid.is_string () + && (vid.string_value () + == "Octave:matlab-incompatible")) + { + id.resize (dim_vector (1, 2)); + st.resize (dim_vector (1, 2)); + + id(1) = tid(i); + st(1) = tst(i); + + break; + } + } + } + + tmp.assign ("identifier", id); + tmp.assign ("state", st); warning_options = tmp; diff -r 76341ffda11e -r ffdbdf53665c src/octave.cc --- a/src/octave.cc Tue Nov 27 18:23:48 2007 +0000 +++ b/src/octave.cc Tue Nov 27 20:16:19 2007 +0000 @@ -366,6 +366,18 @@ { unwind_protect::begin_frame ("execute_eval_option_code"); + octave_save_signal_mask (); + + can_interrupt = true; + + octave_signal_hook = octave_signal_handler; + octave_interrupt_hook = unwind_protect::run_all; + octave_bad_alloc_hook = unwind_protect::run_all; + + octave_catch_interrupts (); + + octave_initialized = true; + unwind_protect_bool (interactive); interactive = false; @@ -376,6 +388,11 @@ { eval_string (code, false, parse_status, 0); } + catch (octave_interrupt_exception) + { + recover_from_exception (); + octave_stdout << "\n"; + } catch (std::bad_alloc) { std::cerr << "error: memory exhausted or requested size too large for range of Octave's index type -- eval failed" @@ -392,6 +409,18 @@ { unwind_protect::begin_frame ("execute_command_line_file"); + octave_save_signal_mask (); + + can_interrupt = true; + + octave_signal_hook = octave_signal_handler; + octave_interrupt_hook = unwind_protect::run_all; + octave_bad_alloc_hook = unwind_protect::run_all; + + octave_catch_interrupts (); + + octave_initialized = true; + unwind_protect_bool (interactive); unwind_protect_bool (reading_script_file); unwind_protect_bool (input_from_command_line_file); @@ -422,6 +451,11 @@ { parse_and_execute (fname, false, "octave"); } + catch (octave_interrupt_exception) + { + recover_from_exception (); + octave_stdout << "\n"; + } catch (std::bad_alloc) { std::cerr << "error: memory exhausted or requested size too large for range of Octave's index type -- execution of " diff -r 76341ffda11e -r ffdbdf53665c src/toplev.cc --- a/src/toplev.cc Tue Nov 27 18:23:48 2007 +0000 +++ b/src/toplev.cc Tue Nov 27 20:16:19 2007 +0000 @@ -175,7 +175,7 @@ delete f; } -static void +void recover_from_exception (void) { can_interrupt = true; diff -r 76341ffda11e -r ffdbdf53665c src/toplev.h --- a/src/toplev.h Tue Nov 27 18:23:48 2007 +0000 +++ b/src/toplev.h Tue Nov 27 20:16:19 2007 +0000 @@ -39,6 +39,8 @@ extern void clean_up_and_exit (int) GCC_ATTR_NORETURN; +extern void recover_from_exception (void); + extern int main_loop (void); extern void