Re: Midnight Commander's invisibility / launching Cooledit

From: Alfie Costa (agcosta@gis.net)
Date: Thu Jun 22 2000 - 01:32:54 CEST


On 21 Jun 2000, at 10:00, Michele Andreoli <mulinux@sunsite.auc.dk> wrote:

> > 1) Edit=%var{EDITOR:mc -e} %f # this launches Cooledit
>
> Sorry, Alfie: there are a lot of line in mc.ext related to EDITOR.
> Please, explain me what I've to change.

Change the last line that says 'EDITOR'; this is in the last part of 'mc.ext',
at the end, the finish, the limit, where it was written:

<snip>

        # Default target for anything not described above
        default/*
                Open=
                View=%view{ascii}
                Edit=%var{EDITOR:vi} %f # <<< *** Change here ****
                Drop=
                Icon=plain.xpm
                Title=%p

<snip>

In my 'mc.ext', (which may be different), that is line #366 out of a total of
369 lines. Once changed, it looks like:

<snip>

        # Default target for anything not described above
        default/*
                Open=
                View=%view{ascii}
                Edit=%var{EDITOR:mc -e} %f # <<< *** Presto ****
                Drop=
                Icon=plain.xpm
                Title=%p

<snip>

...thus, if there is no variable named $EDITOR, this new code will start
Cooledit when the user hits F4.

-----
Note for scripting buffs: the syntax for 'mc.ext' is similar to that of
'/bin/ash' -- similar, but not exactly the same. In 'ash' you'd do:

        ${EDITOR:-"mc -e"} # note the first hyphen or '-'...

...but in 'mc.ext' it is:

        %var{EDITOR:mc -e} # no hyphen after the colon or ':' ...

Why they're different, or rather why 'mc.ext' doesn't conform to the standard
Bourne Shell syntax, is hard to say. It would be simpler if both were the
same. Maybe the author forgot, or just wanted to save a byte.

---------------------------------------------------------------------
To unsubscribe, e-mail: mulinux-unsubscribe@sunsite.auc.dk
For additional commands, e-mail: mulinux-help@sunsite.auc.dk



This archive was generated by hypermail 2.1.6 : Sat Feb 08 2003 - 15:27:15 CET