bugGNU Octave - Bugs: bug #31388, Improvement for edit() which makes...

 
 

bug #31388: Improvement for edit() which makes it work together with console vim

Submitted by:  None
Submitted on:  Wed 20 Oct 2010 10:25:57 PM UTC  
 
Category: InterpreterSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Performance
Status: NoneAssigned to: None
Originator Name: Originator Email: -unavailable-
Open/Closed: ClosedRelease: 3.2.4
Operating System: GNU/Linux

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Thu 21 Oct 2010 02:22:16 AM UTC, comment #1:

After giving your original message to the help list some more thought, I checked in the following changeset:

http://hg.savannah.gnu.org/hgweb/octave/rev/fbec4b3be59f

With this change, I don't think any change is needed in the edit function for it to work with vim running synchronously in a terminal. Maybe the second argument should be changed from [] to false, but either will work.

John W. Eaton <jwe>
Project Administrator
Wed 20 Oct 2010 10:25:57 PM UTC, original submission:

I struggled accross the fact that console vim can't be used as editor.
Apparently, this is due to the fact, that edit() uses system() and system() redirect stdout "sometimes".

The code in edit() which fails is
system (sprintf (FUNCTION.EDITOR, strcat ("\"", path, "\"")), [], FUNCTION.MODE);

Having

edit editor "vim %s";
edit mode sync;

The message I get is: "Vim: Warning: Output is not to a terminal"

I suggest the attached patch which does a simple system() call with simply one argument, if the mode is 'sync'.

The patch applies to edit() as of octave 3.2.4

Anonymous

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #21734:  edit.m.diff added by None (2KiB - text/x-patch)

 

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)
  •  

    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 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 21 Oct 2010 02:22:16 AM UTCjweOpen/ClosedOpen=>Closed
    Wed 20 Oct 2010 10:25:57 PM UTCNoneAttached File-=>Added edit.m.diff, #21734

    Back to the top


    Powered by Savane 3.1-cleanup1