# HG changeset patch # User jwe # Date 874706912 0 # Node ID e6d14959bea9df37ed13240575e63893d86ffecb # Parent e08136623329b42fc92dc35b2a07d8e185c66752 [project @ 1997-09-19 22:06:12 by jwe] diff -r e08136623329 -r e6d14959bea9 ChangeLog --- a/ChangeLog Fri Sep 19 14:36:38 1997 +0000 +++ b/ChangeLog Fri Sep 19 22:08:32 1997 +0000 @@ -1,3 +1,50 @@ +Fri Sep 19 09:35:59 1997 Kurt Hornik + + * octave-inf.el (inferior-octave-startup-args): Set to '("-i") to + force interactive behavior. + +Wed Sep 10 15:31:03 1997 Kurt Hornik + + * emacs/octave-mod.el (octave-auto-indent): New variable. + (octave-electric-semi, octave-electric-space): Use it. + + * emacs/octave-mod.el (octave-maybe-insert-continuation-string): New + function. + (octave-auto-fill): No longer calls do-auto-fill. Should now + avoid breaking lines after comment starts or before code line + continuation expressions. + (octave-fill-paragraph): Move forward a line if octave-auto-fill + gave up. + + * emacs/octave-mod.el (octave-before-magic-comment-p): New function. + (octave-comment-indent): Handle magic comments correctly. + (calculate-octave-indent): Handle magic comments correctly. + + * emacs/octave-inf.el (inferior-octave-prompt): Include the `debug' + prompt issued by the Octave `keyboard' command. + + * emacs/octave-mod.el (octave-abbrev-table): Added abbrevs for switch, + case, otherwise, and endswitch. + (octave-begin-keywords): Added switch. + (octave-else-keywords): Added case and otherwise. + (octave-end-keywords): Added endswitch. + (octave-block-match-alist): Added an entry for switch syntax. + (calculate-octave-indent): Added support for switch syntax. + (octave-block-end-offset): New function. + (octave-comment-indent): Fix a typo. + + * emacs/octave-hlp.el: Provide octave-hlp. + + * emacs/octave-inf.el: Provide octave-inf. + +Sun Sep 7 23:16:33 1997 John W. Eaton + + * configure.in Don't use OCTAVE_SET_DEFAULT to set values for + bindir, datadir, exec_prefix, includedir, infodir, libdir, + libexecdir, mandir. + Don't use AC_PREFIX_DEFAULT, since we don't want to override the + default setting anyway. + Tue Aug 26 13:30:36 1997 John W. Eaton * octave-bug.in: CC bug report to user if $USER or $LOGNAME is set. diff -r e08136623329 -r e6d14959bea9 configure.in --- a/configure.in Fri Sep 19 14:36:38 1997 +0000 +++ b/configure.in Fri Sep 19 22:08:32 1997 +0000 @@ -21,7 +21,7 @@ ### Software Foundation, 59 Temple Place - Suite 330, Boston, MA ### 02111-1307, USA. -AC_REVISION($Revision: 1.284 $) +AC_REVISION($Revision: 1.285 $) AC_PREREQ(2.9) AC_INIT(src/octave.cc) AC_CONFIG_HEADER(config.h) @@ -32,16 +32,6 @@ ### some defaults -AC_PREFIX_DEFAULT(/usr/local) -AC_MSG_RESULT([defining prefix to be $prefix]) -OCTAVE_SET_DEFAULT(exec_prefix) -OCTAVE_SET_DEFAULT(bindir) -OCTAVE_SET_DEFAULT(datadir) -OCTAVE_SET_DEFAULT(libdir) -OCTAVE_SET_DEFAULT(libexecdir) -OCTAVE_SET_DEFAULT(includedir) -OCTAVE_SET_DEFAULT(mandir) -OCTAVE_SET_DEFAULT(infodir) OCTAVE_SET_DEFAULT(man1dir, '$(mandir)/man1') OCTAVE_SET_DEFAULT(man1ext, '.1') OCTAVE_SET_DEFAULT(infofile, '$(infodir)/octave.info') diff -r e08136623329 -r e6d14959bea9 doc/interpreter/emacs.texi --- a/doc/interpreter/emacs.texi Fri Sep 19 14:36:38 1997 +0000 +++ b/doc/interpreter/emacs.texi Fri Sep 19 22:08:32 1997 +0000 @@ -1,11 +1,11 @@ @c Copyright (C) 1996, 1997 John W. Eaton @c Written by Kurt Hornik on 1996/05/17. -@c Last updated by KH on 1997/01/22. +@c Last updated by KH on 1997/07/31. @c This is part of the Octave manual. @c For copying conditions, see the file gpl.texi. @node Emacs, Grammar, Installation, Top -@appendix Using Emacs With Octave +@appendix Emacs Octave Support The development of Octave code can greatly be facilitated using Emacs with Octave mode, a major mode for editing Octave files which can e.g.@: @@ -21,37 +21,38 @@ Finally, you can convince Octave to use the Emacs info reader for @kbd{help -i}. -All functionality is provided by the Emacs Lisp package @file{octave}. -This chapter describes how to set up and use this package. +All functionality is provided by the Emacs Lisp package EOS (for ``Emacs +Octave Support''). This chapter describes how to set up and use this +package. -Please contact @email{Kurt.Hornik@@ci.tuwien.ac.at} if you have any -questions or suggestions on using Emacs with Octave. +Please contact if you have any questions +or suggestions on using EOS. @menu -* Installing the Emacs Octave Package:: +* Installing EOS:: * Using Octave Mode:: * Running Octave From Within Emacs:: * Using the Emacs Info Reader for Octave:: @end menu -@node Installing the Emacs Octave Package, Using Octave Mode, Emacs, Emacs -@appendixsec Installing the Emacs Octave Package +@node Installing EOS, Using Octave Mode, Emacs, Emacs +@appendixsec Installing EOS -The Emacs package @file{octave} consists of @file{octave-mod.el}, +The Emacs package EOS consists of the three files @file{octave-mod.el}, @file{octave-inf.el}, and @file{octave-hlp.el}. These files, or better yet their byte-compiled versions, should be somewhere in your Emacs load-path. If you have GNU Emacs with a version number at least as high as 19.35, -you are all set up, because the package is respectively will be part of -GNU Emacs as of version 19.35. +you are all set up, because EOS is respectively will be part of GNU +Emacs as of version 19.35. Otherwise, copy the three files from the @file{emacs} subdirectory of the Octave distribution to a place where Emacs can find them (this depends on how your Emacs was installed). Byte-compile them for speed if you want. -@node Using Octave Mode, Running Octave From Within Emacs, Installing the Emacs Octave Package, Emacs +@node Using Octave Mode, Running Octave From Within Emacs, Installing EOS, Emacs @appendixsec Using Octave Mode If you are lucky, your sysadmins have already arranged everything so @@ -68,7 +69,7 @@ @lisp (autoload 'octave-mode "octave-mod" nil t) (setq auto-mode-alist - (cons '("\\.m$" . octave-mode) auto-mode-alist)) + (cons '(\"\\\\.m$\" . octave-mode) auto-mode-alist)) @end lisp @item @@ -94,20 +95,20 @@ @item C-h m Describe the features of Octave mode. -@item @key{LFD} +@item LFD Reindent the current Octave line, insert a newline and indent the new line (@code{octave-reindent-then-newline-and-indent}). An abbrev before point is expanded if @code{abbrev-mode} is non-@code{nil}. -@item @key{TAB} +@item TAB Indents current Octave line based on its contents and on previous lines (@code{indent-according-to-mode}). @item ; Insert an ``electric'' semicolon (@code{octave-electric-semi}). If -@code{octave-auto-newline} is non-@code{nil}, typing a @samp{;} -automatically reindents the current line, inserts a newline and indents -the new line. +@code{octave-auto-indent} is non-@code{nil}, reindent the current line. +If @code{octave-auto-newline} is non-@code{nil}, automagically insert a +newline and indent the new line. @item ` Start entering an abbreviation (@code{octave-abbrev-start}). If Abbrev @@ -115,11 +116,11 @@ Any other key combination is executed normally. Note that all Octave abbrevs start with a grave accent. -@item M-@key{LFD} +@item M-LFD Break line at point and insert continuation marker and alignment (@code{octave-split-line}). -@item M-@key{TAB} +@item M-TAB Perform completion on Octave symbol preceding point, comparing that symbol against Octave's reserved words and builtin variables (@code{octave-complete-symbol}). @@ -272,15 +273,18 @@ @noindent (this works for all modes by adding to the startup hooks, without having to know the particular binding of @key{RET} in that mode!). Similar -considerations apply for using @kbd{M-@key{RET}} as @kbd{M-@key{LFD}}. -As Barry A. Warsaw says in the -documentation for his @code{cc-mode}, ``This is a very common -question. @code{:-)} If you want this to be the default behavior, don't -lobby me, lobby RMS!'' +considerations apply for using @key{M-RET} as @key{M-LFD}. As Barry +A. Warsaw says in the documentation for his +@code{cc-mode}, ``This is a very common question. @code{:-)} If you want +this to be the default behavior, don't lobby me, lobby RMS!'' The following variables can be used to customize Octave mode. @table @code +@item octave-auto-indent +Non-@code{nil} means auto-indent the current line after a semicolon or +space. Default is @code{nil}. + @item octave-auto-newline Non-@code{nil} means auto-insert a newline and indent after semicolons are typed. The default value is @code{nil}. @@ -457,9 +461,11 @@ @node Using the Emacs Info Reader for Octave, , Running Octave From Within Emacs, Emacs @appendixsec Using the Emacs Info Reader for Octave -You can also have Octave's @kbd{help -i} command invoke the Emacs Info -reader. To do this, you'll need @file{gnuserv}, which can be retrieved -from any GNU Emacs Lisp Code Directory archive, e.g.@: +You can also set up the Emacs Info reader for dealing with the results +of Octave's @samp{help -i}. For this, the package @file{gnuserv} needs +to be installed, which unfortunately still does not come with GNU Emacs +(it does with XEmacs). It can be retrieved from any GNU Emacs Lisp Code +Directory archive, e.g.@: @url{ftp://ftp.cis.ohio-state.edu/pub/gnu/emacs/elisp-archive}, in the @file{packages} subdirectory. The alpha version of an enhanced version of gnuserv is available at @@ -483,7 +489,7 @@ this case, set @code{INFO_PROGRAM} to @code{"info-emacs-octave-help"}. If you use Octave from within Emacs, these settings are best done in the -startup file @file{~/.emacs-octave} (or the file pointed to by the Emacs +@file{~/.emacs-octave} startup file (or the file pointed to by the Emacs variable @code{inferior-octave-startup-file}). @c Local Variables: diff -r e08136623329 -r e6d14959bea9 doc/interpreter/octave.texi --- a/doc/interpreter/octave.texi Fri Sep 19 14:36:38 1997 +0000 +++ b/doc/interpreter/octave.texi Fri Sep 19 22:08:32 1997 +0000 @@ -147,6 +147,7 @@ * Function Index:: An item for each documented function. * Operator Index:: An item for each documented operator. + --- The Detailed Node Listing --- Preface @@ -411,9 +412,9 @@ * Installing Octave from a Binary Distribution:: * Creating a Binary Distribution:: -Using Emacs With Octave +Emacs Octave Support -* Installing the Emacs Octave Package:: +* Installing EOS:: * Using Octave Mode:: * Running Octave From Within Emacs:: * Using the Emacs Info Reader for Octave:: diff -r e08136623329 -r e6d14959bea9 octMakefile.in --- a/octMakefile.in Fri Sep 19 14:36:38 1997 +0000 +++ b/octMakefile.in Fri Sep 19 22:08:32 1997 +0000 @@ -34,7 +34,7 @@ DISTDIRS = glob kpathsea readline # plplot # Subdirectories in which to run `make all'. -SUBDIRS = @INFO_DIR@ @PLPLOT_DIR@ @READLINE_DIR@ @DLFCN_DIR@ glob \ +SUBDIRS = @PLPLOT_DIR@ @READLINE_DIR@ @DLFCN_DIR@ glob \ kpathsea libcruft liboctave src scripts doc examples diff -r e08136623329 -r e6d14959bea9 scripts/ChangeLog --- a/scripts/ChangeLog Fri Sep 19 14:36:38 1997 +0000 +++ b/scripts/ChangeLog Fri Sep 19 22:08:32 1997 +0000 @@ -1,3 +1,21 @@ +Fri Sep 19 17:04:40 1997 John W. Eaton + + * linear-algebra/cross.m: Use direct formula instead of calling + det three times in a loop. If both args are column (row) vectors, + return a column (row) vector. If they don't match, pay attention + to the value of prefer_column_vectors. + +Thu Aug 28 15:31:20 1997 Rolf Fabian + + * polynomial/polyvalm.m: Don't assume orthogonal eigenvectors for + nonsymmetric matrices. + + * general/tril.m: Fix usage message. + + * polynomial/polyvalm.m: Fix error messages. + * polynomial/polyderiv.m: Likewise. + * polynomial/polyval.m: Likewise. + Wed Aug 13 14:14:16 1997 John W. Eaton * strings/blanks.m: Allow blanks(0) to return empty string. diff -r e08136623329 -r e6d14959bea9 scripts/general/tril.m --- a/scripts/general/tril.m Fri Sep 19 14:36:38 1997 +0000 +++ b/scripts/general/tril.m Fri Sep 19 22:08:32 1997 +0000 @@ -17,7 +17,7 @@ ## Software Foundation, 59 Temple Place - Suite 330, Boston, MA ## 02111-1307, USA. -## usage: triu (x, k) +## usage: tril (x, k) ## ## Return the lower triangular part of x above the k-th diagonal. If ## the second argument is omitted, k = 0 is assumed. diff -r e08136623329 -r e6d14959bea9 scripts/linear-algebra/cross.m --- a/scripts/linear-algebra/cross.m Fri Sep 19 14:36:38 1997 +0000 +++ b/scripts/linear-algebra/cross.m Fri Sep 19 22:08:32 1997 +0000 @@ -29,16 +29,20 @@ usage ("cross (x, y)"); endif - if (! (is_vector (x) && length (x) == 3 - && is_vector (y) && length (y) == 3)) + if (length (x) == 3 && length (y) == 3) + + z = [x(2)*y(3) - x(3)*y(2); x(3)*y(1) - x(1)*y(3); x(1)*y(2) - x(2)*y(1)]; + + x_nr = rows (x); + y_nr = rows (y); + + if ((x_nr == y_nr && x_nr == 1) + || (x_nr != y_nr && ! prefer_column_vectors)) + z = z'; + endif + + else error ("cross: both x and y must be 3-dimensional vectors"); endif - - x = reshape (x, 3, 1); - y = reshape (y, 3, 1); - e = eye (3, 3); - for k = 1 : 3 - z(k) = det ([x y e(:, k)]); - endfor endfunction diff -r e08136623329 -r e6d14959bea9 scripts/polynomial/polyderiv.m --- a/scripts/polynomial/polyderiv.m Fri Sep 19 14:36:38 1997 +0000 +++ b/scripts/polynomial/polyderiv.m Fri Sep 19 22:08:32 1997 +0000 @@ -36,7 +36,7 @@ endif if (! is_vector (p)) - error ("argument must be a vector"); + error ("polyderiv: argument must be a vector"); endif lp = length (p); diff -r e08136623329 -r e6d14959bea9 scripts/polynomial/polyval.m --- a/scripts/polynomial/polyval.m Fri Sep 19 14:36:38 1997 +0000 +++ b/scripts/polynomial/polyval.m Fri Sep 19 22:08:32 1997 +0000 @@ -46,7 +46,7 @@ endif if (! (is_vector (c) || isempty (c))) - error ("poly: first argument must be a vector."); + error ("polyval: first argument must be a vector."); endif if (isempty (x)) diff -r e08136623329 -r e6d14959bea9 scripts/polynomial/polyvalm.m --- a/scripts/polynomial/polyvalm.m Fri Sep 19 14:36:38 1997 +0000 +++ b/scripts/polynomial/polyvalm.m Fri Sep 19 22:08:32 1997 +0000 @@ -42,16 +42,16 @@ function y = polyvalm (c, x) - if(nargin != 2) + if (nargin != 2) usage ("polyvalm (c, x)"); endif if (! (is_vector (c) || isempty (c))) - error("poly: first argument must be a vector."); + error ("polyvalm: first argument must be a vector."); endif - if(! is_square (x)) - error("poly: second argument must be a square matrix."); + if (! is_square (x)) + error("polyvalm: second argument must be a square matrix."); endif if (isempty (c)) @@ -61,6 +61,10 @@ [v, d] = eig (x); - y = v * diag (polyval (c, diag (d))) * v'; + if (is_symmetric (x)) + y = v * diag (polyval (c, diag (d))) * v'; + else + y = v * (diag (polyval (c, diag (d))) / v); + endif endfunction