octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: edit.m: patches to restore and fix old behavior for new files


From: Luke M
Subject: Re: edit.m: patches to restore and fix old behavior for new files
Date: Wed, 18 Apr 2012 10:34:23 -0700 (PDT)

Mike Miller-2 wrote
> 
> Hi, I have a series of patches for the edit function that restore some
> behavior that hasn't worked since 3.0.x, and fix some quirks, all having
> to do with editing new files.  Technically this is a regression against
> 3.0.x, but no one's reported it, maybe I'm the only one who has noticed.
> 
> (snip)
> 
> Current dev:
> 
>   octave:1> edit myfunc      | empty file          | ./myfunc
>   octave:2> edit myfunc.m    | function "myfunc"   | ./myfunc.m
>   octave:3> edit myfunc.cc   | C function "myfunc" | ./myfunc.cc
>   octave:4> edit notes.txt   | empty file          | ./notes.txt
>   octave:5> edit ./myfunc.m  | function "./myfunc" | ./myfunc.m
>   octave:6> edit /tmp/myfunc | empty file          | /tmp/myfunc
> 
> With my patches applied:
> 
>   octave:1> edit myfunc      | function "myfunc"   | HOME/myfunc.m
>   octave:2> edit myfunc.m    | function "myfunc"   | HOME/myfunc.m
>   octave:3> edit myfunc.cc   | C function "myfunc" | HOME/myfunc.cc
>   octave:4> edit notes.txt   | empty file          | HOME/notes.txt
>   octave:5> edit ./myfunc.m  | function "myfunc"   | ./myfunc.m
>   octave:6> edit /tmp/myfunc | empty file          | /tmp/myfunc
> 

Matlab 2010b (SP1) and 2011b both act mostly like current dev.  Slight
differences:

- Matlab automatically adds the .m extension in the first example (but
creates the file in '.')
- Matlab pops up a warning dialog asking if you want to create a new file

I don't have Octave handy, so I'm not sure if this is a difference or not:

- If you say yes to the dialog, Matlab creates the file first, then opens it
for editing (I assume Octave just calls the external editor, which probably
opens a temporary buffer and only creates the file on save)

Perhaps the changes in current dev are intentional, but the documentation
was not updated?

--
View this message in context: 
http://octave.1599824.n4.nabble.com/edit-m-patches-to-restore-and-fix-old-behavior-for-new-files-tp4567672p4568448.html
Sent from the Octave - Maintainers mailing list archive at Nabble.com.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]