changeset 20054:002576bbba10

Fix edit() not opening an editor when cmdline arg --no-gui given (bug #44695). edit.m (do_edit): Use isguirunning() to decide whether to call __octave_link_edit_file__ or external system call.
author Rik <rik@octave.org>
date Thu, 02 Apr 2015 10:35:35 -0700
parents 9c26eee65266
children 1929d9218ac0
files scripts/miscellaneous/edit.m
diffstat 1 files changed, 3 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/miscellaneous/edit.m	Thu Apr 02 13:28:41 2015 -0400
+++ b/scripts/miscellaneous/edit.m	Thu Apr 02 10:35:35 2015 -0700
@@ -546,12 +546,9 @@
 
 function do_edit (editor, file, mode)
 
-  ## Give the hook function a chance.
-  ## If that fails, fall back on running an editor with the system function.
-
-  status = __octave_link_edit_file__ (file);
-
-  if (! status)
+  if (isguirunning ())
+    __octave_link_edit_file__ (file);
+  else
     system (sprintf (undo_string_escapes (editor), ['"' file '"']), [], mode);
   endif