octave-maintainers
[Top][All Lists]
Advanced

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

Re: edit.m and EDITOR


From: Michael Goffioul
Subject: Re: edit.m and EDITOR
Date: Tue, 10 Apr 2012 22:10:37 +0100

On Tue, Apr 10, 2012 at 10:04 PM, Jordi Gutiérrez Hermoso
<address@hidden> wrote:
> 2012/4/10 Ben Abbott <address@hidden>:
>> On Apr 10, 2012, at 4:26 PM, Jordi Gutiérrez Hermoso wrote:
>
>>> The problem I'm trying to solve is that EDITOR and edit shouldn't be
>>> storing separate variables for the EDITOR command. How do you
>>> recommend to solve this instead?
>>
>>
>> I'd forgotten about this conflict.
>>
>> Should we be using preferences instead ?
>>
>> i.e. addpref, ispref, setpref, getpref, rmpref
>
> I don't see how those solve this problem... we already have a way to
> set the preference, the EDITOR function-variable does this. The
> problem is that I don't know how to fix the two copies of the EDITOR
> variable in EDITOR and edit.m without breaking part of edit.m's
> interface.

What about leaving FUNCTION.EDITOR empty and computing it dynamically
(as cstrcat(EDITOR, " %s")) when needed? If it's not empty, it means
it has been set through "edit('editor', ...)", and you use it instead
of the dynamic version. So the EDITOR variable will still continue to
be used, unless it has been overridden at the edit.m level. OTOH,
changing the editor through edit.m will not change the actual EDITOR
value.

Michael.


reply via email to

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