changeset 3081:8c779ed7979b

[project @ 1997-08-25 15:51:20 by jwe]
author jwe
date Mon, 25 Aug 1997 15:52:58 +0000
parents 4a324ba3f1eb
children 7fa66715abc1
files ChangeLog PROJECTS emacs/octave-mod.el scripts/ChangeLog scripts/strings/blanks.m src/ChangeLog src/DLD-FUNCTIONS/lsode.cc src/input.cc
diffstat 8 files changed, 38 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Fri Aug 22 20:53:39 1997 +0000
+++ b/ChangeLog	Mon Aug 25 15:52:58 1997 +0000
@@ -1,3 +1,8 @@
+Wed Aug 13 20:34:14 1997  John W. Eaton  <jwe@bevo.che.wisc.edu>
+
+	* emacs/octave-mod.el (octave-before-magic-comment-p): New function.
+	(calculate-octave-indent, octave-comment-indent): Use it.
+
 Sun Aug  3 15:33:18 1997  John W. Eaton  <jwe@bevo.che.wisc.edu>
 
 	* info: Delete subdirectory.
--- a/PROJECTS	Fri Aug 22 20:53:39 1997 +0000
+++ b/PROJECTS	Mon Aug 25 15:52:58 1997 +0000
@@ -248,6 +248,12 @@
     succeeds, even when implicit_str_to_num_ok is 0 at the time the
     function is parsed.
 
+  * Fix the parser so that
+
+      if (expr) 'this is a string' end
+
+    is parsed as IF expr STRING END.
+
   * Consider making x(:) work no matter what the value of
     do_fortran_indexing.
 
--- a/emacs/octave-mod.el	Fri Aug 22 20:53:39 1997 +0000
+++ b/emacs/octave-mod.el	Mon Aug 25 15:52:58 1997 +0000
@@ -655,7 +655,8 @@
        ((and (looking-at octave-block-end-regexp)
 	     (octave-not-in-string-or-comment-p))
 	(setq icol (- icol (octave-block-end-offset))))
-       ((looking-at "\\s<\\s<\\s<\\S<")
+       ((or (looking-at "\\s<\\s<\\s<\\S<")
+	    (octave-before-magic-comment-p))
 	(setq icol (list 0 icol)))
        ((looking-at "\\s<\\S<")
 	(setq icol (list comment-column icol)))))
@@ -667,8 +668,14 @@
     (* octave-block-offset
        (if (string-match (match-string 0) "switch") 2 1))))
 
+(defun octave-before-magic-comment-p ()
+  (save-excursion
+    (beginning-of-line)
+    (and (bobp) (looking-at "\\s-*#!"))))
+
 (defun octave-comment-indent ()
-  (if (looking-at "\\s<\\s<\\s<")
+  (if (or (looking-at "\\s<\\s<\\s<")
+	  (octave-before-magic-comment-p))
       0
     (if (looking-at "\\s<\\s<")
 	(calculate-octave-indent)
--- a/scripts/ChangeLog	Fri Aug 22 20:53:39 1997 +0000
+++ b/scripts/ChangeLog	Mon Aug 25 15:52:58 1997 +0000
@@ -1,3 +1,8 @@
+Wed Aug 13 14:14:16 1997  John W. Eaton  <jwe@bevo.che.wisc.edu>
+
+	* strings/blanks.m: Allow blanks(0) to return empty string.
+	Allow negative arguments if treat_neg_dim_as_zero is true.
+
 Wed Jun 25 21:26:24 1997  John W. Eaton  <jwe@bevo.che.wisc.edu>
 
 	* plot/mesh.m: Set noparametric plot mode after plotting.
--- a/scripts/strings/blanks.m	Fri Aug 22 20:53:39 1997 +0000
+++ b/scripts/strings/blanks.m	Mon Aug 25 15:52:58 1997 +0000
@@ -30,10 +30,10 @@
     usage ("blanks (n)");
   endif
 
-  if (is_scalar (n) && n > 0 && n == round (n))
+  if (is_scalar (n) && n == round (n) && (treat_neg_dim_as_zero || n >= 0))
     s = setstr (ones (1, n) * toascii (" "));
   else
-    error ("blanks: n must be a positive integer");
+    error ("blanks: n must be a non-negative integer");
   endif
 
 endfunction
--- a/src/ChangeLog	Fri Aug 22 20:53:39 1997 +0000
+++ b/src/ChangeLog	Mon Aug 25 15:52:58 1997 +0000
@@ -1,3 +1,8 @@
+Mon Aug 25 10:42:07 1997  John W. Eaton  <jwe@bevo.che.wisc.edu>
+
+	* input.cc (get_user_input): Return an empty string if the user
+	just types RET.
+
 Thu Jul 31 22:59:04 1997  John W. Eaton  <jwe@bevo.che.wisc.edu>
 
 	* lex.l <TEXT_FCN>: Ensure that we handle words that begin with
--- a/src/DLD-FUNCTIONS/lsode.cc	Fri Aug 22 20:53:39 1997 +0000
+++ b/src/DLD-FUNCTIONS/lsode.cc	Mon Aug 25 15:52:58 1997 +0000
@@ -185,7 +185,7 @@
       break;
 
     default:
-      error ("lsode: second arg should be a string or 2-element string array");
+      error ("lsode: first arg should be a string or 2-element string array");
       break;
     }
 
--- a/src/input.cc	Fri Aug 22 20:53:39 1997 +0000
+++ b/src/input.cc	Mon Aug 25 15:52:58 1997 +0000
@@ -531,7 +531,11 @@
 	}
       else if (read_as_string)
 	{
-	  retval = input_buf;
+	  // XXX FIXME XXX -- fix gnu_readline and octave_gets instead!
+	  if (input_buf.length () == 1 && input_buf[0] == '\n')
+	    retval = "";
+	  else
+	    retval = input_buf;
 	}
       else
 	{