Patches for mc-4.5.51

Sean King stking at bway.net
Sun Oct 12 22:35:08 UTC 2003


On Sun, Oct 12, 2003 at 02:39:13PM +0200, Oskar Liljeblad wrote:
> On Saturday, September 20, 2003 at 18:30, Sean King wrote:
[...]
> > ...In key.c, we have 'xterm_key_defines' -- one group there is actually
> > commented as '/* rxvt keys with modifiers */'....
> >
> > AFAICS, those sequences are defined (in init_key()) _only_ if
> > TERM=xterm* or TERM=iris-ansi* .
> >
> > I suggested that
> >
> >    || (!strncmp (term, "rxvt", 4))
> >
> > be added (takes care of rxvt _and_ derivatives)
[...]
>
> Well, that code is broken anyway. In my opinion, you should never use
> hardcoded features based on the value of $TERM.
>

I agree in principle. The defense, I suppose, would be: "[nearly]
everyone does it" (based on the "is_xterm"-type functions I was able to
inspect, anyway.) It must be "good enough for government work", so to
speak, if it's so widely used.

But no need to follow the crowd if there's a better way....

WRT the specific issue of the xterm_key_defines, the things that can
gain some functionality when they are defined (rxvt-and-derivatives, GNU
screen in an xterm _or_ in rxvt-and-derivatives....[and others? That's
just what I tested...]) should come under the umbrella _somehow_.

Is there anything that _breaks_ when they're defined? One could go the
other way around and test for _that_ -- if there _is_ a "that"....

best,

S.



More information about the mc-devel mailing list