# HG changeset patch # User jwe # Date 940990910 0 # Node ID 511caaa5e98eba34d64f3f4b6e5265775425f45a # Parent 8c6b4de3bdc89757d2af0b90889c5c68042a780a [project @ 1999-10-27 02:21:46 by jwe] diff -r 8c6b4de3bdc8 -r 511caaa5e98e ChangeLog --- a/ChangeLog Tue Oct 26 21:33:28 1999 +0000 +++ b/ChangeLog Wed Oct 27 02:21:50 1999 +0000 @@ -1,3 +1,10 @@ +1999-10-26 John W. Eaton + + * emacs/README: New file. + * emacs/Makefile.in (DISTFILES, BINDISTFILES): Add it to the lists. + + * emacs/Makefile.in: Don't distribute .elc files. + 1999-10-21 John W. Eaton * configure.in: Check for select and poll. Also check for poll.h diff -r 8c6b4de3bdc8 -r 511caaa5e98e emacs/Makefile.in --- a/emacs/Makefile.in Tue Oct 26 21:33:28 1999 +0000 +++ b/emacs/Makefile.in Wed Oct 27 02:21:50 1999 +0000 @@ -21,14 +21,11 @@ EL_FILES = octave-hlp.el octave-inf.el octave-mod.el -ELC_FILES = octave-hlp.elc octave-inf.elc octave-mod.elc - SOURCES = $(EL_FILES) otags -DISTFILES = Makefile.in $(EL_FILES) $(ELC_FILES) otags NEWS TODO +DISTFILES = Makefile.in $(EL_FILES) otags NEWS TODO README -BINDISTFILES = \ - $(addprefix $(srcdir)/, $(EL_FILES) $(ELC_FILES) otags NEWS TODO) +BINDISTFILES = $(addprefix $(srcdir)/, $(EL_FILES) otags NEWS TODO README) all: .PHONY: all diff -r 8c6b4de3bdc8 -r 511caaa5e98e emacs/octave-hlp.el --- a/emacs/octave-hlp.el Tue Oct 26 21:33:28 1999 +0000 +++ b/emacs/octave-hlp.el Wed Oct 27 02:21:50 1999 +0000 @@ -1,6 +1,6 @@ -;; octave-hlp.el --- getting help on Octave symbols using info +;;; octave-hlp.el --- getting help on Octave symbols using info -;;; Copyright (C) 1997 Free Software Foundation, Inc. +;; Copyright (C) 1997 Free Software Foundation, Inc. ;; Author: Kurt Hornik ;; Author: John Eaton diff -r 8c6b4de3bdc8 -r 511caaa5e98e emacs/octave-inf.el --- a/emacs/octave-inf.el Tue Oct 26 21:33:28 1999 +0000 +++ b/emacs/octave-inf.el Wed Oct 27 02:21:50 1999 +0000 @@ -371,4 +371,3 @@ (provide 'octave-inf) ;;; octave-inf.el ends here - diff -r 8c6b4de3bdc8 -r 511caaa5e98e emacs/octave-mod.el --- a/emacs/octave-mod.el Tue Oct 26 21:33:28 1999 +0000 +++ b/emacs/octave-mod.el Wed Oct 27 02:21:50 1999 +0000 @@ -40,6 +40,7 @@ ;; `run-octave' for further information on usage and customization. ;;; Code: +(require 'custom) (defgroup octave nil "Major mode for editing Octave source files." diff -r 8c6b4de3bdc8 -r 511caaa5e98e src/ChangeLog --- a/src/ChangeLog Tue Oct 26 21:33:28 1999 +0000 +++ b/src/ChangeLog Wed Oct 27 02:21:50 1999 +0000 @@ -1,5 +1,28 @@ 1999-10-26 John W. Eaton + * DLD-FUNCTIONS/lsode.cc (Flsode): Be sure to call + unwind_protect::run_frame before returning. + * DLD-FUNCTIONS/quad.cc (Fquad): Likewise. + * DLD-FUNCTIONS/fsolve.cc (Ffsolve): Likewise. + * DLD-FUNCTIONS/dassl.cc (Fdassl): Likewise. + + * load-save.cc (read_mat_ascii_data): When reading from + tmp_stream, check its state, not the state of is. + + * defun-dld.h (INSTALL_DLD_FCN, INSTALL_DLD_FCNS): New macros. + * DLD-FUNCTIONS/dassl.cc: Use them. + * DLD-FUNCTIONS/lsode.cc: Ditto. + * DLD-FUNCTIONS/fsolve.cc: Ditto. + * DLD-FUNCTIONS/quad.cc: Ditto. + * DLD-FUNCTIONS/time.cc: Ditto. + * DLD-FUNCTIONS/besselj.cc: Ditto. + * DLD-FUNCTIONS/getgrent.cc: Ditto. + * DLD-FUNCTIONS/getpwent.cc: Ditto. + * DLD-FUNCTIONS/inv.cc: Ditto. + * DLD-FUNCTIONS/log.cc: Ditto. + * DLD-FUNCTIONS/minmax.cc: Ditto. + * DLD-FUNCTIONS/rand.cc: Ditto. + * data.cc (Flinspace): Let linspace functions handle errors. * mkgendoc (print_doc_string): Handle quoted names. @@ -42,8 +65,9 @@ 1999-10-22 John W. Eaton - * ov-usr-fcn.cc (octave_user_function::do_index_op): If call_depth - is exceeded, call unwind_protect::run_frame before returning. + * ov-usr-fcn.cc (octave_user_function::do_index_op): If + Vmax_recursion_depth is exceeded, call unwind_protect::run_frame + before returning. 1999-10-21 John W. Eaton diff -r 8c6b4de3bdc8 -r 511caaa5e98e src/DLD-FUNCTIONS/besselj.cc --- a/src/DLD-FUNCTIONS/besselj.cc Tue Oct 26 21:33:28 1999 +0000 +++ b/src/DLD-FUNCTIONS/besselj.cc Wed Oct 27 02:21:50 1999 +0000 @@ -511,9 +511,15 @@ return retval; } +INSTALL_DLD_FCNS (INSTALL_DLD_FCN (besselj); + INSTALL_DLD_FCN (bessely); + INSTALL_DLD_FCN (besseli); + INSTALL_DLD_FCN (besselk); + INSTALL_DLD_FCN (besselh); + INSTALL_DLD_FCN (airy);) + /* ;;; Local Variables: *** ;;; mode: C++ *** ;;; End: *** */ - diff -r 8c6b4de3bdc8 -r 511caaa5e98e src/DLD-FUNCTIONS/dassl.cc --- a/src/DLD-FUNCTIONS/dassl.cc Tue Oct 26 21:33:28 1999 +0000 +++ b/src/DLD-FUNCTIONS/dassl.cc Wed Oct 27 02:21:50 1999 +0000 @@ -108,6 +108,30 @@ return retval; } +#define DASSL_ABORT() \ + do \ + { \ + unwind_protect::run_frame ("Fdassl"); \ + return retval; \ + } \ + while (0) + +#define DASSL_ABORT1(msg) \ + do \ + { \ + ::error ("dassl: " ## msg); \ + DASSL_ABORT (); \ + } \ + while (0) + +#define DASSL_ABORT2(fmt, arg) \ + do \ + { \ + ::error ("dassl: " ## fmt, arg); \ + DASSL_ABORT (); \ + } \ + while (0) + DEFUN_DLD (dassl, args, , "dassl (\"function_name\", x_0, xdot_0, t_out)\n\ dassl (F, X_0, XDOT_0, T_OUT, T_CRIT)\n\ @@ -127,10 +151,7 @@ call_depth++; if (call_depth > 1) - { - error ("dassl: invalid recursive call"); - return retval; - } + DASSL_ABORT1 ("invalid recursive call"); int nargin = args.length (); @@ -142,31 +163,22 @@ "; endfunction"); if (! dassl_fcn) - return retval; + DASSL_ABORT (); ColumnVector state = args(1).vector_value (); if (error_state) - { - error ("dassl: expecting state vector as second argument"); - return retval; - } + DASSL_ABORT1 ("expecting state vector as second argument"); ColumnVector deriv = args(2).vector_value (); if (error_state) - { - error ("dassl: expecting derivative vector as third argument"); - return retval; - } + DASSL_ABORT1 ("expecting derivative vector as third argument"); ColumnVector out_times = args(3).vector_value (); if (error_state) - { - error ("dassl: expecting output time vector as fourth argument"); - return retval; - } + DASSL_ABORT1 ("expecting output time vector as fourth argument"); ColumnVector crit_times; int crit_times_set = 0; @@ -175,19 +187,13 @@ crit_times = args(4).vector_value (); if (error_state) - { - error ("dassl: expecting critical time vector as fifth argument"); - return retval; - } + DASSL_ABORT1 ("expecting critical time vector as fifth argument"); crit_times_set = 1; } if (state.capacity () != deriv.capacity ()) - { - error ("dassl: x and xdot must have the same size"); - return retval; - } + DASSL_ABORT1 ("x and xdot must have the same size"); double tzero = out_times (0); @@ -385,21 +391,8 @@ return retval; } -#define DLD_INSTALLER_FCN() \ - bool \ - FSoctave_install_dld_functions (void) - -#define INSTALL_DLD_FCN(name) \ - if (! FS ## name ()) \ - return false - -DLD_INSTALLER_FCN () -{ - INSTALL_DLD_FCN (dassl); - INSTALL_DLD_FCN (dassl_options); - - return true; -} +INSTALL_DLD_FCNS (INSTALL_DLD_FCN (dassl); + INSTALL_DLD_FCN (dassl_options);) /* ;;; Local Variables: *** diff -r 8c6b4de3bdc8 -r 511caaa5e98e src/DLD-FUNCTIONS/fsolve.cc --- a/src/DLD-FUNCTIONS/fsolve.cc Tue Oct 26 21:33:28 1999 +0000 +++ b/src/DLD-FUNCTIONS/fsolve.cc Wed Oct 27 02:21:50 1999 +0000 @@ -124,6 +124,30 @@ return retval; } +#define FSOLVE_ABORT() \ + do \ + { \ + unwind_protect::run_frame ("Ffsolve"); \ + return retval; \ + } \ + while (0) + +#define FSOLVE_ABORT1(msg) \ + do \ + { \ + ::error ("fsolve: " ## msg); \ + FSOLVE_ABORT (); \ + } \ + while (0) + +#define FSOLVE_ABORT2(fmt, arg) \ + do \ + { \ + ::error ("fsolve: " ## fmt, arg); \ + FSOLVE_ABORT (); \ + } \ + while (0) + DEFUN_DLD (fsolve, args, nargout, "Solve nonlinear equations using Minpack. Usage:\n\ \n\ @@ -144,10 +168,7 @@ call_depth++; if (call_depth > 1) - { - error ("fsolve: invalid recursive call"); - return retval; - } + FSOLVE_ABORT1 ("invalid recursive call"); int nargin = args.length (); @@ -157,15 +178,12 @@ "function y = __fsolve_fcn__ (x) y = ", "; endfunction"); if (! fsolve_fcn) - return retval; + FSOLVE_ABORT (); ColumnVector x = args(1).vector_value (); if (error_state) - { - error ("fsolve: expecting vector as second argument"); - return retval; - } + FSOLVE_ABORT1 ("expecting vector as second argument"); if (nargin > 2) warning ("fsolve: ignoring extra arguments"); @@ -344,21 +362,8 @@ return retval; } -#define DLD_INSTALLER_FCN() \ - bool \ - FSoctave_install_dld_functions (void) - -#define INSTALL_DLD_FCN(name) \ - if (! FS ## name ()) \ - return false - -DLD_INSTALLER_FCN () -{ - INSTALL_DLD_FCN (fsolve); - INSTALL_DLD_FCN (fsolve_options); - - return true; -} +INSTALL_DLD_FCNS (INSTALL_DLD_FCN (fsolve); + INSTALL_DLD_FCN (fsolve_options);) /* ;;; Local Variables: *** diff -r 8c6b4de3bdc8 -r 511caaa5e98e src/DLD-FUNCTIONS/getgrent.cc --- a/src/DLD-FUNCTIONS/getgrent.cc Tue Oct 26 21:33:28 1999 +0000 +++ b/src/DLD-FUNCTIONS/getgrent.cc Wed Oct 27 02:21:50 1999 +0000 @@ -216,6 +216,12 @@ return retval; } +INSTALL_DLD_FCNS (INSTALL_DLD_FCN (getgrent); + INSTALL_DLD_FCN (getgrgid); + INSTALL_DLD_FCN (getgrnam); + INSTALL_DLD_FCN (setgrent); + INSTALL_DLD_FCN (endgrent);) + /* ;;; Local Variables: *** ;;; mode: C++ *** diff -r 8c6b4de3bdc8 -r 511caaa5e98e src/DLD-FUNCTIONS/getpwent.cc --- a/src/DLD-FUNCTIONS/getpwent.cc Tue Oct 26 21:33:28 1999 +0000 +++ b/src/DLD-FUNCTIONS/getpwent.cc Wed Oct 27 02:21:50 1999 +0000 @@ -220,6 +220,12 @@ return retval; } +INSTALL_DLD_FCNS (INSTALL_DLD_FCN (getpwent); + INSTALL_DLD_FCN (getpwuid); + INSTALL_DLD_FCN (getpwnam); + INSTALL_DLD_FCN (setpwent); + INSTALL_DLD_FCN (endpwent);) + /* ;;; Local Variables: *** ;;; mode: C++ *** diff -r 8c6b4de3bdc8 -r 511caaa5e98e src/DLD-FUNCTIONS/inv.cc --- a/src/DLD-FUNCTIONS/inv.cc Tue Oct 26 21:33:28 1999 +0000 +++ b/src/DLD-FUNCTIONS/inv.cc Wed Oct 27 02:21:50 1999 +0000 @@ -111,6 +111,9 @@ return Finv (args, nargout); } +INSTALL_DLD_FCNS (INSTALL_DLD_FCN (inv); + INSTALL_DLD_FCN (inverse);) + /* ;;; Local Variables: *** ;;; mode: C++ *** diff -r 8c6b4de3bdc8 -r 511caaa5e98e src/DLD-FUNCTIONS/log.cc --- a/src/DLD-FUNCTIONS/log.cc Tue Oct 26 21:33:28 1999 +0000 +++ b/src/DLD-FUNCTIONS/log.cc Wed Oct 27 02:21:50 1999 +0000 @@ -259,6 +259,9 @@ return retval; } +INSTALL_DLD_FCNS (INSTALL_DLD_FCN (logm); + INSTALL_DLD_FCN (sqrtm);) + /* ;;; Local Variables: *** ;;; mode: C++ *** diff -r 8c6b4de3bdc8 -r 511caaa5e98e src/DLD-FUNCTIONS/lsode.cc --- a/src/DLD-FUNCTIONS/lsode.cc Tue Oct 26 21:33:28 1999 +0000 +++ b/src/DLD-FUNCTIONS/lsode.cc Wed Oct 27 02:21:50 1999 +0000 @@ -132,6 +132,30 @@ return retval; } +#define LSODE_ABORT() \ + do \ + { \ + unwind_protect::run_frame ("Flsode"); \ + return retval; \ + } \ + while (0) + +#define LSODE_ABORT1(msg) \ + do \ + { \ + ::error ("lsode: " ## msg); \ + LSODE_ABORT (); \ + } \ + while (0) + +#define LSODE_ABORT2(fmt, arg) \ + do \ + { \ + ::error ("lsode: " ## fmt, arg); \ + LSODE_ABORT (); \ + } \ + while (0) + DEFUN_DLD (lsode, args, nargout, "lsode (F, X0, T_OUT, T_CRIT)\n\ \n\ @@ -150,10 +174,7 @@ call_depth++; if (call_depth > 1) - { - error ("lsode: invalid recursive call"); - return retval; - } + LSODE_ABORT1 ("invalid recursive call"); int nargin = args.length (); @@ -196,28 +217,22 @@ break; default: - error ("lsode: first arg should be a string or 2-element string array"); - break; + LSODE_ABORT1 + ("first arg should be a string or 2-element string array"); } if (error_state || ! lsode_fcn) - return retval; + LSODE_ABORT (); ColumnVector state = args(1).vector_value (); if (error_state) - { - error ("lsode: expecting state vector as second argument"); - return retval; - } + LSODE_ABORT1 ("expecting state vector as second argument"); ColumnVector out_times = args(2).vector_value (); if (error_state) - { - error ("lsode: expecting output time vector as third argument"); - return retval; - } + LSODE_ABORT1 ("expecting output time vector as third argument"); ColumnVector crit_times; @@ -227,10 +242,7 @@ crit_times = args(3).vector_value (); if (error_state) - { - error ("lsode: expecting critical time vector as fourth argument"); - return retval; - } + LSODE_ABORT1 ("expecting critical time vector as fourth argument"); crit_times_set = 1; } @@ -480,21 +492,8 @@ return retval; } -#define DLD_INSTALLER_FCN() \ - bool \ - FSoctave_install_dld_functions (void) - -#define INSTALL_DLD_FCN(name) \ - if (! FS ## name ()) \ - return false - -DLD_INSTALLER_FCN () -{ - INSTALL_DLD_FCN (lsode); - INSTALL_DLD_FCN (lsode_options); - - return true; -} +INSTALL_DLD_FCNS (INSTALL_DLD_FCN (lsode); + INSTALL_DLD_FCN (lsode_options);) /* ;;; Local Variables: *** diff -r 8c6b4de3bdc8 -r 511caaa5e98e src/DLD-FUNCTIONS/minmax.cc --- a/src/DLD-FUNCTIONS/minmax.cc Tue Oct 26 21:33:28 1999 +0000 +++ b/src/DLD-FUNCTIONS/minmax.cc Wed Oct 27 02:21:50 1999 +0000 @@ -701,6 +701,9 @@ return retval; } +INSTALL_DLD_FCNS (INSTALL_DLD_FCN (min); + INSTALL_DLD_FCN (max);) + /* ;;; Local Variables: *** ;;; mode: C++ *** diff -r 8c6b4de3bdc8 -r 511caaa5e98e src/DLD-FUNCTIONS/quad.cc --- a/src/DLD-FUNCTIONS/quad.cc Tue Oct 26 21:33:28 1999 +0000 +++ b/src/DLD-FUNCTIONS/quad.cc Wed Oct 27 02:21:50 1999 +0000 @@ -92,6 +92,30 @@ return retval; } +#define QUAD_ABORT() \ + do \ + { \ + unwind_protect::run_frame ("Fquad"); \ + return retval; \ + } \ + while (0) + +#define QUAD_ABORT1(msg) \ + do \ + { \ + ::error ("quad: " ## msg); \ + QUAD_ABORT (); \ + } \ + while (0) + +#define QUAD_ABORT2(fmt, arg) \ + do \ + { \ + ::error ("quad: " ## fmt, arg); \ + QUAD_ABORT (); \ + } \ + while (0) + DEFUN_DLD (quad, args, nargout, "[V, IER, NFUN] = quad (F, A, B [, TOL] [, SING])\n\ \n\ @@ -121,10 +145,7 @@ call_depth++; if (call_depth > 1) - { - error ("quad: invalid recursive call"); - return retval; - } + QUAD_ABORT1 ("invalid recursive call"); int nargin = args.length (); @@ -134,23 +155,17 @@ "function y = __quad_fcn__ (x) y = ", "; endfunction"); if (! quad_fcn) - return retval; + QUAD_ABORT (); double a = args(1).double_value (); if (error_state) - { - error ("quad: expecting second argument to be a scalar"); - return retval; - } + QUAD_ABORT1 ("expecting second argument to be a scalar"); double b = args(2).double_value (); if (error_state) - { - error ("quad: expecting third argument to be a scalar"); - return retval; - } + QUAD_ABORT1 ("expecting third argument to be a scalar"); int indefinite = 0; IndefQuad::IntegralType indef_type = IndefQuad::doubly_infinite; @@ -186,29 +201,20 @@ { case 5: if (indefinite) - { - error("quad: singularities not allowed on infinite intervals"); - return retval; - } + QUAD_ABORT1 ("singularities not allowed on infinite intervals"); have_sing = 1; sing = args(4).vector_value (); if (error_state) - { - error ("quad: expecting vector of singularities as fourth argument"); - return retval; - } + QUAD_ABORT1 ("expecting vector of singularities as fourth argument"); case 4: tol = args(3).vector_value (); if (error_state) - { - error ("quad: expecting vector of tolerances as fifth argument"); - return retval; - } + QUAD_ABORT1 ("expecting vector of tolerances as fifth argument"); switch (tol.capacity ()) { @@ -220,8 +226,7 @@ break; default: - error ("quad: expecting tol to contain no more than two values"); - return retval; + QUAD_ABORT1 ("expecting tol to contain no more than two values"); } case 3: @@ -259,10 +264,7 @@ retval(0) = val; } else - { - print_usage ("quad"); - return retval; - } + print_usage ("quad"); unwind_protect::run_frame ("Fquad"); @@ -417,21 +419,8 @@ return retval; } -#define DLD_INSTALLER_FCN() \ - bool \ - FSoctave_install_dld_functions (void) - -#define INSTALL_DLD_FCN(name) \ - if (! FS ## name ()) \ - return false - -DLD_INSTALLER_FCN () -{ - INSTALL_DLD_FCN (quad); - INSTALL_DLD_FCN (quad_options); - - return true; -} +INSTALL_DLD_FCNS (INSTALL_DLD_FCN (quad); + INSTALL_DLD_FCN (quad_options);) /* ;;; Local Variables: *** diff -r 8c6b4de3bdc8 -r 511caaa5e98e src/DLD-FUNCTIONS/rand.cc --- a/src/DLD-FUNCTIONS/rand.cc Tue Oct 26 21:33:28 1999 +0000 +++ b/src/DLD-FUNCTIONS/rand.cc Wed Oct 27 02:21:50 1999 +0000 @@ -408,6 +408,9 @@ return retval; } +INSTALL_DLD_FCNS (INSTALL_DLD_FCN (rand); + INSTALL_DLD_FCN (randn);) + /* ;;; Local Variables: *** ;;; mode: C++ *** diff -r 8c6b4de3bdc8 -r 511caaa5e98e src/DLD-FUNCTIONS/time.cc --- a/src/DLD-FUNCTIONS/time.cc Tue Oct 26 21:33:28 1999 +0000 +++ b/src/DLD-FUNCTIONS/time.cc Wed Oct 27 02:21:50 1999 +0000 @@ -396,6 +396,12 @@ return retval; } +INSTALL_DLD_FCNS (INSTALL_DLD_FCN (time); + INSTALL_DLD_FCN (gmtime); + INSTALL_DLD_FCN (localtime); + INSTALL_DLD_FCN (mktime); + INSTALL_DLD_FCN (strftime);) + /* ;;; Local Variables: *** ;;; mode: C++ *** diff -r 8c6b4de3bdc8 -r 511caaa5e98e src/defun-dld.h --- a/src/defun-dld.h Tue Oct 26 21:33:28 1999 +0000 +++ b/src/defun-dld.h Wed Oct 27 02:21:50 1999 +0000 @@ -55,6 +55,26 @@ DEFINE_FUN_INSTALLER_FUN (name, doc) \ DECLARE_FUN (name, args_name, nargout_name) +#if (defined (OCTAVE_LITE) && defined (WITH_DYNAMIC_LINKING)) + +#define INSTALL_DLD_FCNS(body) \ + bool \ + FSoctave_install_dld_functions (void) \ + { \ + body \ + return true; \ + } + +#else + +#define INSTALL_DLD_FCNS(body) + +#endif + +#define INSTALL_DLD_FCN(name) \ + if (! FS ## name ()) \ + return false + #endif #endif diff -r 8c6b4de3bdc8 -r 511caaa5e98e src/load-save.cc --- a/src/load-save.cc Tue Oct 26 21:33:28 1999 +0000 +++ b/src/load-save.cc Wed Oct 27 02:21:50 1999 +0000 @@ -1096,16 +1096,21 @@ for (int j = 0; j < nc; j++) { tmp_stream >> d; - if (is) + + if (tmp_stream) tmp.elem (i, j) = d; else - goto done; + { + error ("load: failed to read matrix from file `%s'", + filename.c_str ()); + + return name; + } + } } } - done: - if (is) { tc = tmp;