octave-maintainers
[Top][All Lists]
Advanced

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

Re: edit.m: use current working directory, remove HOME


From: Mike Miller
Subject: Re: edit.m: use current working directory, remove HOME
Date: Fri, 27 Apr 2012 09:01:04 -0400

On Tue, Apr 24, 2012 at 10:32 AM, Ben Abbott <address@hidden> wrote:
>
> On Apr 24, 2012, at 9:47 AM, Mike Miller wrote:
>
>> On Tue, Apr 24, 2012 at 8:58 AM, Ben Abbott <address@hidden> wrote:
>>> On Apr 22, 2012, at 5:49 PM, Mike Miller wrote:
>>>
>>>> I have prepared a new patch to make the edit command consistent wrt
>>>> where files are edited, please take a look at the attached and tell me
>>>> what you think.  The HOME variable is now no longer needed, a warning is
>>>> issued if the user tries to get or set HOME.  The current directory is
>>>> now used wherever HOME was used before, primarily when editing a system
>>>> m-file with no write privileges.
>>>>
>>>> --
>>>> mike
>>>> <edit-home.patch>
>>>
>>> I had a thought. Would it be preferred to allow the HOME variable in edit.m 
>>> to be set to a function handle, or a string. That would accommodate both 
>>> those who prefer
>>>
>>>       address@hidden
>>>
>>> ... or ...
>>>
>>>        HOME="~/octave";
>>
>> Sure, I don't have a problem with supporting function handles in
>> principle, but isn't address@hidden effectively overkill for HOME="."?
>
> Ok.

Ben, so back to HOME, are you now in favor of keeping it around but
making the default be pwd?

I now see all the ways ~/octave is broken (see below), I'm in favor of
taking it out completely, if you agree I can push the above changeset
that I haven't heard any problems with yet.

If you want to keep HOME but default it to pwd, this can be done by
making the default HOME=".", merging in something like this change (to
make HOME work for editing new files)

http://octave.1599824.n4.nabble.com/attachment/4567672/0/edit-1.patch

and leaving the rest as is.  I think the help text should even talk
about "current working directory" everywhere and then mention in the
description of HOME that it can be overridden by setting this
variable.

After testing this all different ways, I'm a convert to pwd, and I
think it's more intuitive to a new user.  To make the default of
~/octave work, edit assumes a user has taken care of:

  * mkdir -p ~/octave
  * addpath(("~/octave") in .octaverc

If not, things don't work right and it's not very clear why not.
Neither of these needs to be done for pwd.

-- 
mike


reply via email to

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