[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Nmh-workers] nmh 1.6 -- proper comment char in .mh_profile?
From: |
Paul Fox |
Subject: |
Re: [Nmh-workers] nmh 1.6 -- proper comment char in .mh_profile? |
Date: |
Thu, 10 Jul 2014 13:46:57 -0400 |
ken wrote:
> >Forgive the comment from the peanut gallery, but if the code is
> >already handling ^# specially, why not go all the way and make it
> >a comment character? Is there a use for supporting #foo as a command?
>
> Sigh. First off, it's not handling #^ specially, it's handling #:
> specially. #foo, for example (really #foo:) receives no special handling.
>
> Secondly ... you may or may not have noticed that the profile has a
> format which looks suspiciously like an RFC-822 message, in that all of
> the fields have the form:
>
> foo: XXXX XXXX
>
> and you may not be aware that you're not permitted blank lines in a profile
> file either. Neither of these things are a coincidence.
>
> The same parser that reads email messages (m_getfld()) also reads the
> profile (also, it does sequence files). So to truely handle comments
> would require changes to m_getfld(), which nobody is itching to do.
m_getfld() takes a "FILE *". perhaps rather than handing it the config
file directly, we could do:
sprintf(cfgcmd, "sed -e 's/^[[:space:]]#/d' -e '/^$/d' %s", configfile);
f = popen(cfgcmd, "r");
paul
(only half kidding)
> In theory we could simply ignore fields which begin with a '#' and not
> put them in the profile structure; that might be worth doing. But that
> would still not permit '#' as a generic comment character; you'd still
> need to have a colon in there. It's one of those old MH things that
> isn't wonderful, but none of the fixes are easy.
>
> --Ken
>
> _______________________________________________
> Nmh-workers mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/nmh-workers
=----------------------
paul fox, address@hidden (arlington, ma, where it's 73.6 degrees)