[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: edit.m: use current working directory, remove HOME
From: |
Ben Abbott |
Subject: |
Re: edit.m: use current working directory, remove HOME |
Date: |
Fri, 27 Apr 2012 11:31:12 -0400 |
On Apr 27, 2012, at 9:01 AM, Mike Miller wrote:
> 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,
Regarding "HOME", I used ".", so I'm ok either way, but ...
One of my first changesets touched on edit.m. My recollection was that some
users (developers?) preferred that all octave's core m-files be opened in a
specific location. My guess is that if you remove HOME, you'll get some
complaints. I think changing the default to pwd() would be ok.
If we keep HOME, I think it makes sense to allow HOME to be set equal to a
function handle.
edit ("home", @pwd)
For that to work, I think the class type needs to be checked in edit.m so that
the function_handle is evaluated at FUNCTION.HOME()
Ben
- edit.m: use current working directory, remove HOME, Mike Miller, 2012/04/22
- Re: edit.m: use current working directory, remove HOME, Ben Abbott, 2012/04/24
- Re: edit.m: use current working directory, remove HOME, Mike Miller, 2012/04/24
- Re: edit.m: use current working directory, remove HOME, Mike Miller, 2012/04/27
- Re: edit.m: use current working directory, remove HOME,
Ben Abbott <=
- Re: edit.m: use current working directory, remove HOME, Mike Miller, 2012/04/27