bugGNU Octave - Bugs: bug #44695, edit() doesn't open editor when...

 
 

bug #44695: edit() doesn't open editor when --no-gui used

Submitted by:  Rik <rik5>
Submitted on:  Wed 01 Apr 2015 11:27:42 PM UTC  
 
Category: Octave FunctionSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Regression
Status: FixedAssigned to: None
Originator Name: Open/Closed: Closed
Release: devOperating System: Any

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

(Jump to the original submission Jump to the original submission)

Thu 02 Apr 2015 05:36:26 PM UTC, comment #6:

Pushed the cset here (http://hg.savannah.gnu.org/hgweb/octave/rev/002576bbba10). Closing report.

Rik <rik5>
Project Administrator
Thu 02 Apr 2015 04:51:17 PM UTC, comment #5:

I think this is OK for now. Longer term I will try to look at a better way to handle communication between the GUI and the interpreter, or at least do the right thing in the octave_link functions.

John W. Eaton <jwe>
Project Administrator
Thu 02 Apr 2015 03:50:40 PM UTC, comment #4:

Attached is a cset that works for me. I did use isguirunning() because it was the smallest quantum change necessary to fix the bug. Recoding _octave_link_edit_file_ seems okay, but I didn't feel like tackling it and finding the other instances where we have used this construct.

Just as second example, in doc.m

(file #33511)

Rik <rik5>
Project Administrator
Thu 02 Apr 2015 01:52:30 PM UTC, comment #3:

Instead of checking isguirunning, I think it should be the responsibility of the _octave_link_edit_file_ function to return false if it can't do the job.

John W. Eaton <jwe>
Project Administrator
Thu 02 Apr 2015 01:48:44 PM UTC, comment #2:

The code in question is the do_edit function

It seems that somewhere in this function isguirunning() should be checked before invoking _octave_link_edit_file_.

Rik <rik5>
Project Administrator
Thu 02 Apr 2015 07:23:31 AM UTC, comment #1:

If you'd like to change the meaning of the return value (i.e., zero for success), go ahead.

Specific to this bug report, the _octave_link_edit_file_() script shouldn't even be run. In my version of the code is:

Has something changed regarding this code? Or perhaps in isguirunning()? Here is the isguirunning() definition as I have:

Dan Sebald <sebald>
Wed 01 Apr 2015 11:27:42 PM UTC, original submission:

I have the environment variable EDITOR set to 'gvim -f'. When running the Octave CLI it used to be that "edit filename" would open the file in the external editor. Now this only works if I run octave with the '--no-gui-libs' option rather than just '--no-gui'.

The problem seems to be this line in edit.m:

This returns 1 and so the next lines are not executed

First, shouldn't Octave be using the C/UNIX convention that 0 means OK and any non-zero value indicates an error code?

Second, _octave_link_edit_file_ returns 1 both when running the GUI and when running the CLI, but there is no editor to switch to in the CLI.

Rik <rik5>
Project Administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #33511:  edit_ext.cset added by rik5 (1KiB - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by jwe (Posted a comment)
  • -unavailable- added by sebald (Posted a comment)
  • -unavailable- added by rik5 (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 02 Apr 2015 05:36:26 PM UTCrik5StatusNone=>Fixed
      Open/ClosedOpen=>Closed
    Thu 02 Apr 2015 03:50:40 PM UTCrik5Attached File-=>Added edit_ext.cset, #33511

    Back to the top


    Powered by Savane 3.1-cleanup1