diff src/input.cc @ 4526:8952973c6837

[project @ 2003-10-02 18:33:58 by jwe]
author jwe
date Thu, 02 Oct 2003 18:33:59 +0000
parents fd406afe8a10
children 1db951a4fcd5
line wrap: on
line diff
--- a/src/input.cc	Thu Oct 02 05:24:04 2003 +0000
+++ b/src/input.cc	Thu Oct 02 18:33:59 2003 +0000
@@ -941,10 +941,20 @@
 static void
 input_event_hook (void)
 {
-  if (user_data.is_defined ())
-    feval (hook_fcn, user_data, 0);
+  if (is_valid_function (hook_fcn))
+    {
+      if (user_data.is_defined ())
+	feval (hook_fcn, user_data, 0);
+      else
+	feval (hook_fcn, octave_value_list (), 0);
+    }
   else
-    feval (hook_fcn, octave_value_list (), 0);
+    {
+      hook_fcn = std::string ();
+      user_data = octave_value ();
+
+      command_editor::set_event_hook (0);
+    }      
 }
 
 DEFUN (input_event_hook, args, ,