# HG changeset patch # User Torsten # Date 1376160714 -7200 # Node ID 3d1205d5771ef7d99c39b508d86908ae16ddf813 # Parent 4407606d093967c91169a01a1359635aa576245d make history widget respect history_control settings * input.cc(octave_gets): don't call octave_link::append_history because it is now called via command_history::add * oct-hist.cc(edit_history_add_hist,octave_history_write_timestamp): don't call octave_link::append_history because it is now called via command_history::add * cmd-hist.cc: include octave-link.h, (gnu_history::do_add): call octave_link::append_history only if octave_add_history really has added something * liboctave/Makefile.am: add libinterp/corefcn as include path as cmd-hist.cc needs to include octave-link.h diff --git a/libinterp/corefcn/input.cc b/libinterp/corefcn/input.cc --- a/libinterp/corefcn/input.cc +++ b/libinterp/corefcn/input.cc @@ -271,12 +271,7 @@ if (retval != "\n") { if (! history_skip_auto_repeated_debugging_command) - { - command_history::add (retval); - - if (! command_history::ignoring_entries ()) - octave_link::append_history (retval); - } + command_history::add (retval); octave_diary << retval; diff --git a/libinterp/corefcn/oct-hist.cc b/libinterp/corefcn/oct-hist.cc --- a/libinterp/corefcn/oct-hist.cc +++ b/libinterp/corefcn/oct-hist.cc @@ -328,10 +328,7 @@ tmp.resize (len - 1); if (! tmp.empty ()) - { - command_history::add (tmp); - octave_link::append_history (tmp); - } + command_history::add (tmp); } } @@ -580,10 +577,7 @@ std::string timestamp = now.strftime (Vhistory_timestamp_format_string); if (! timestamp.empty ()) - { - command_history::add (timestamp); - octave_link::append_history (timestamp); - } + command_history::add (timestamp); } DEFUN (edit_history, args, , diff --git a/liboctave/Makefile.am b/liboctave/Makefile.am --- a/liboctave/Makefile.am +++ b/liboctave/Makefile.am @@ -34,7 +34,8 @@ -Ioperators -I$(srcdir)/operators \ -I$(srcdir)/system \ -I$(srcdir)/util \ - -I$(top_builddir)/libgnu -I$(top_srcdir)/libgnu + -I$(top_builddir)/libgnu -I$(top_srcdir)/libgnu \ + -I$(top_srcdir)/libinterp/corefcn AM_CFLAGS += $(WARN_CFLAGS) diff --git a/liboctave/util/cmd-hist.cc b/liboctave/util/cmd-hist.cc --- a/liboctave/util/cmd-hist.cc +++ b/liboctave/util/cmd-hist.cc @@ -48,6 +48,7 @@ #include #include "oct-rl-hist.h" +#include "octave-link.h" #include "file-stat.h" @@ -199,7 +200,12 @@ if (stmp[stmp_len - 1] == '\n') stmp.resize (stmp_len - 1); - lines_this_session += ::octave_add_history (stmp.c_str (), history_control); + int added = ::octave_add_history (stmp.c_str (), history_control); + if (added > 0) + { + lines_this_session += added; + octave_link::append_history (stmp.c_str ()); + } } }