[Top][All Lists]

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

Re: [Nmh-workers] colorized/highlighted scan output?

From: Ken Hornstein
Subject: Re: [Nmh-workers] colorized/highlighted scan output?
Date: Fri, 02 Nov 2012 13:47:39 -0400

>I was envisioning just one function, that takes the terminfo symbolic
>name of a capability and gives back the actual string.

Well ... it's not that simple.  As I read it you need to parameterize
it with tparm(), which means you need to take multiple arguments.
This isn't so hard from the mh-format side of things, but there is
no version of tparm which takes a stdarg, so you're stuck giving
it a bunch of arguments.  I don't know what happens if you don't
give tparm enough arguments (or the wrong one) but I can imagine
it wouldn't be hard to crash a program, and being able to crash a
nmh program from a bug in a format string seems wrong.  It seems like
you're going to have to put some terminfo knowledge into the format
lanaguage to make the implementation reasonable.

Also, I can envision you might want to get some knowledge up from the
terminfo layer; for example, if the terminal doesn't support color, maybe
you want to use bold instead?  If you have a format function that makes
this available you can use it in a branch statement.

>Good point.  I'm inclined to think that it's a good idea to provide this
>even if we also provide the terminfo-accessing function, since there is
>always going to be somebody who wants to do something that doesn't fit
>into what (his) terminfo knows.

Seems reasonable to me as well.


reply via email to

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