changeset 17215:7c06875c2dcc

Backed out changeset 3d1205d5771e Nothing from liboctave can ever depend on something from liboctinterp.
author John W. Eaton <jwe@octave.org>
date Sat, 10 Aug 2013 21:30:49 -0400
parents 3d1205d5771e
children 283422a219a2
files libinterp/corefcn/input.cc libinterp/corefcn/oct-hist.cc liboctave/Makefile.am liboctave/util/cmd-hist.cc
diffstat 4 files changed, 16 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/corefcn/input.cc	Sat Aug 10 20:51:54 2013 +0200
+++ b/libinterp/corefcn/input.cc	Sat Aug 10 21:30:49 2013 -0400
@@ -271,7 +271,12 @@
   if (retval != "\n")
     {
       if (! history_skip_auto_repeated_debugging_command)
-        command_history::add (retval);
+        {
+          command_history::add (retval);
+
+          if (! command_history::ignoring_entries ())
+            octave_link::append_history (retval);
+        }
 
       octave_diary << retval;
 
--- a/libinterp/corefcn/oct-hist.cc	Sat Aug 10 20:51:54 2013 +0200
+++ b/libinterp/corefcn/oct-hist.cc	Sat Aug 10 21:30:49 2013 -0400
@@ -328,7 +328,10 @@
         tmp.resize (len - 1);
 
       if (! tmp.empty ())
-        command_history::add (tmp);
+        {
+          command_history::add (tmp);
+          octave_link::append_history (tmp);
+        }
     }
 }
 
@@ -577,7 +580,10 @@
   std::string timestamp = now.strftime (Vhistory_timestamp_format_string);
 
   if (! timestamp.empty ())
-    command_history::add (timestamp);
+    {
+      command_history::add (timestamp); 
+      octave_link::append_history (timestamp);
+   }
 }
 
 DEFUN (edit_history, args, ,
--- a/liboctave/Makefile.am	Sat Aug 10 20:51:54 2013 +0200
+++ b/liboctave/Makefile.am	Sat Aug 10 21:30:49 2013 -0400
@@ -34,8 +34,7 @@
   -Ioperators -I$(srcdir)/operators \
   -I$(srcdir)/system \
   -I$(srcdir)/util \
-  -I$(top_builddir)/libgnu -I$(top_srcdir)/libgnu \
-  -I$(top_srcdir)/libinterp/corefcn
+  -I$(top_builddir)/libgnu -I$(top_srcdir)/libgnu
 
 AM_CFLAGS += $(WARN_CFLAGS)
 
--- a/liboctave/util/cmd-hist.cc	Sat Aug 10 20:51:54 2013 +0200
+++ b/liboctave/util/cmd-hist.cc	Sat Aug 10 21:30:49 2013 -0400
@@ -48,7 +48,6 @@
 #include <fcntl.h>
 
 #include "oct-rl-hist.h"
-#include "octave-link.h"
 
 #include "file-stat.h"
 
@@ -200,12 +199,7 @@
       if (stmp[stmp_len - 1] == '\n')
         stmp.resize (stmp_len - 1);
 
-      int added = ::octave_add_history (stmp.c_str (), history_control);
-      if (added > 0)
-        {
-          lines_this_session += added;
-          octave_link::append_history (stmp.c_str ());
-        }
+      lines_this_session += ::octave_add_history (stmp.c_str (), history_control);
     }
 }