changeset 6098:70158d7ab8ef

[project @ 2006-10-26 14:51:36 by jwe]
author jwe
date Thu, 26 Oct 2006 14:51:37 +0000
parents d65b53711bb8
children 2b065bbbd1c2
files ChangeLog configure.in emacs/octave-inf.el src/ChangeLog src/oct-prcstrm.cc src/oct-procbuf.cc src/sighandlers.cc
diffstat 7 files changed, 49 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Thu Oct 26 02:01:42 2006 +0000
+++ b/ChangeLog	Thu Oct 26 14:51:37 2006 +0000
@@ -1,5 +1,21 @@
+2006-10-26  John W. Eaton  <jwe@octave.org>
+
+	* emacs/octave-inf.el (inferior-octave-has-built-in-variables):
+	New defvar.
+	(inferior-octave-resync-dirs): Check to see whether Octave has
+	built-in variables and set inferior-octave-has-built-in-variables.
+	Check inferior-octave-has-built-in-variables to decide whether to
+	send commands that set built-in variables or call functions to
+	change Octave's behavior.
+	Send "disp (pwd ())" to Octave instead of just "pwd".
+	(inferior-octave-startup): Send "more off" to Octave instead of
+	"page_screen_output = 0".
+
 2006-10-25  John W. Eaton  <jwe@octave.org>
 
+	* configure.in (RETSIGTYPE_IS_VOID): Define if
+	"$ac_cv_type_signal" = "void".
+
 	* configure.in (*-*-msdosmsvc): Don't check for strftime.
 
 	* configure.in (INCLUDE_DEPS): Set and substitute.
--- a/configure.in	Thu Oct 26 02:01:42 2006 +0000
+++ b/configure.in	Thu Oct 26 14:51:37 2006 +0000
@@ -29,7 +29,7 @@
 EXTERN_CXXFLAGS="$CXXFLAGS"
 
 AC_INIT
-AC_REVISION($Revision: 1.534 $)
+AC_REVISION($Revision: 1.535 $)
 AC_PREREQ(2.57)
 AC_CONFIG_SRCDIR([src/octave.cc])
 AC_CONFIG_HEADER(config.h)
@@ -1572,6 +1572,9 @@
 ])
 OCTAVE_SIGNAL_CHECK
 OCTAVE_REINSTALL_SIGHANDLERS
+if test "$ac_cv_type_signal" = "void"; then
+  AC_DEFINE(RETSIGTYPE_IS_VOID, 1, [Define if this if RETSIGTYPE is defined to be void.  Needed because preprocessor comparisons to void fail on some systems.])
+fi
 
 ### A system dependent kluge or two.
 
--- a/emacs/octave-inf.el	Thu Oct 26 02:01:42 2006 +0000
+++ b/emacs/octave-inf.el	Thu Oct 26 14:51:37 2006 +0000
@@ -115,6 +115,9 @@
 (defvar inferior-octave-complete-impossible nil
   "Non-nil means that `inferior-octave-complete' is impossible.")
 
+(defvar inferior-octave-has-built-in-variables nil
+  "Non-nil means that Octave has built-in variables.")
+
 (defvar inferior-octave-dynamic-complete-functions
   '(inferior-octave-complete comint-dynamic-complete-filename)
   "List of functions called to perform completion for inferior Octave.
@@ -220,12 +223,20 @@
 		   'identity inferior-octave-output-list "\n")
 		  "\n"))))
 
+    ;; Find out whether Octave has built-in variables.
+    (inferior-octave-send-list-and-digest
+     (list "exist \"LOADPATH\"\n"))
+    (setq inferior-octave-has-built-in-variables
+	  (string-match "101$" (car inferior-octave-output-list)))
+
     ;; An empty secondary prompt, as e.g. obtained by '--braindead',
     ;; means trouble.
     (inferior-octave-send-list-and-digest (list "PS2\n"))
-    (if (string-match "^PS2 = *$" (car inferior-octave-output-list))
-       (inferior-octave-send-list-and-digest
-        (list "PS2 = \"> \"\n")))
+    (if (string-match "\\(PS2\\|ans\\) = *$" (car inferior-octave-output-list))
+	(inferior-octave-send-list-and-digest
+	 (list (if inferior-octave-has-built-in-variables
+		   "PS2 = \"> \"\n"
+		 "PS2 (\"> \");\n"))))
     
     ;; O.k., now we are ready for the Inferior Octave startup commands.
     (let* (commands
@@ -233,10 +244,12 @@
 	   (file (or inferior-octave-startup-file
 			  (concat "~/.emacs-" program))))
       (setq commands
-	    (list "page_screen_output = 0;\n"
+	    (list "more off;\n"
 		  (if (not (string-equal
 			    inferior-octave-output-string ">> "))
-		      "PS1=\"\\\\s> \";\n")
+		      (if inferior-octave-has-built-in-variables
+			  "PS1=\"\\\\s> \";\n"
+			"PS1 (\"\\\\s> \");\n"))
 		  (if (file-exists-p file)
 		      (format "source (\"%s\");\n" file))))
       (inferior-octave-send-list-and-digest commands))
@@ -386,7 +399,7 @@
 This command queries the inferior Octave process about its current
 directory and makes this the current buffer's default directory."
   (interactive)
-  (inferior-octave-send-list-and-digest '("pwd\n"))
+  (inferior-octave-send-list-and-digest '("disp (pwd ())\n"))
   (cd (car inferior-octave-output-list)))
 
 ;;; provide ourself
--- a/src/ChangeLog	Thu Oct 26 02:01:42 2006 +0000
+++ b/src/ChangeLog	Thu Oct 26 14:51:37 2006 +0000
@@ -1,5 +1,8 @@
 2006-10-25  John W. Eaton  <jwe@octave.org>
 
+	* sighandlers.cc: Check defined (RETSIGTYPE_IS_VOID) instead of
+	RETSIGTYPE == void.
+
 	* oct-procbuf.cc (BUFSIZ): Define if not already defined.
 	(octave_procbuf::open): Pass BUFSIZ as size argument to setvbuf.
 
--- a/src/oct-prcstrm.cc	Thu Oct 26 02:01:42 2006 +0000
+++ b/src/oct-prcstrm.cc	Thu Oct 26 14:51:37 2006 +0000
@@ -29,6 +29,9 @@
 
 #include "oct-prcstrm.h"
 
+// FIXME -- perhaps this should be handled more globally.  See also
+// oct-procbuf.cc.
+
 #if defined (_MSC_VER)
 #define popen _popen
 #define pclose _pclose
--- a/src/oct-procbuf.cc	Thu Oct 26 02:01:42 2006 +0000
+++ b/src/oct-procbuf.cc	Thu Oct 26 14:51:37 2006 +0000
@@ -51,6 +51,9 @@
 
 static octave_procbuf *octave_procbuf_list = 0;
 
+// FIXME -- perhaps this should be handled more globally.  See also
+// oct-prcstrm.cc.
+
 #if defined (__CYGWIN__)
 #define W32POPEN popen
 #define W32PCLOSE pclose
--- a/src/sighandlers.cc	Thu Oct 26 02:01:42 2006 +0000
+++ b/src/sighandlers.cc	Thu Oct 26 14:51:37 2006 +0000
@@ -72,7 +72,7 @@
 // Similar to Vsighup_dumps_octave_core, but for SIGTERM signal.
 static bool Vsigterm_dumps_octave_core = true;
 
-#if RETSIGTYPE == void
+#if defined (RETSIGTYPE_IS_VOID)
 #define SIGHANDLER_RETURN(status) return
 #else
 #define SIGHANDLER_RETURN(status) return status