bug in edit.m
Ben Abbott
bpabbott at mac.com
Tue Jan 15 05:58:46 CST 2008
On Jan 15, 2008, at 2:07 AM, John W. Eaton wrote:
> On 14-Jan-2008, Ben Abbott wrote:
>
> |
> | On Jan 14, 2008, at 10:10 PM, Ben Abbott wrote:
> |
> | > I tried this sequence
> | >
> | > octave:3 >which savepath
> | > which: `savepath' is the function from the file /sw/share/octave/
> | > 3.0.0+/m/path/savepath.m
> | > octave:4> edit savepath
> | > cp: cannot create regular file `/Users/bpabbott/octave/
> savepath.m': No
> | > such file or directory
> | > path = /Users/bpabbott/octave/savepath.m
> | >
> | > My editor showed up empty and pointing at "/Users/bpabbott/octave/
> | > savepath.m", my pwd was " /Users/bpabbott/octave".
> | >
> | > I may have time to look at edit.m at a latter time, but
> certainly not
> | > today.
> | >
> | > Ben
> |
> | The problem is that when I try to edit a "readonly" file edit.m
> | attempts to open the file in ~/octave.
> |
> | I have no "octave" directory in that location. Would it not be
> better
> | to open the file in the pwd?
> |
> | Please consider the attached patch and ChangeLog
>
> If we are going to make this change, then I think the doc string needs
> to change to match.
>
> Maybe it would be better to only use the current directory if
> FUNCTION.HOME does not exist or is not writable, and then only with a
> warning.
Should we consider the manner that Matlab handles this?.
On my system, Matlab will open the file in place even if it is *read-
only*. I like that feature since I use source control. If I make
changes, I only have to check it out before trying to save it.
In the event, you "edit <somefile>" and <somefile> does not exist in
the path, then Matlab opens the file in the pwd.
Thoughts?
Ben
More information about the Bug-octave
mailing list