mhonarc-users

Re: Color mode in mhonarc?

2005-07-16 14:19:10
On July 15, 2005 at 11:28, saf wrote:

I have a new question (I know I have so many questions!):
Is it possible to activate a kind of filter to show a different display 
mode
for some different content?

You'll need to create a custom MIMEFILTERS filter for this.

Having a general purpose one would be too complex and riddled with
false positives.

I think the idea is nice, but such capabilities would have more
success on a per-list/archive basis.  For example, if the list
is known to be about Perl, with code examples being common, you
can register the "perl" filter for that archive, and that archive
alone.

(With Perl, you can just tell everyone to post messages in POD, and
 then just use a POD filter :-)

Another example is when another user recently posted about
auto-detecting python code.  However, python examples can conflict
with quoted-text rendering.  Therefore, something that would
highlight python code should only be applied to archives where
python code is common.

Side Comment: Now, if such code was tagged with its own media-type,
then something more general can be done.  I.e.  Messages are
authored using a multipart type, intermixing text/plain with
the code snippets.  For example:

  Subject: Perl code example
  Content-Type: multipart/mixed; boundary="XXX

  --XXX
  Content-Type: text/plain

  Check out the following code snippet:

  --XXX
  Content-Type: text/x-perl

  if ($x) {
    print "HELLO\n";
  } else {
    print "GOODBYE\n";
  }

  --XXX
  Content-Type: text/plain

  Blah blah blah.

  --XXX--


Of course, do not hold your breath for people actually doing this.
Most popular MUAs do not allow building such constructs easily,
if not at all.  It seems common practice nowadays for multipart
messages to be only for attachments versus a sequence of differing
(inline) media-types.

--ewh

<Prev in Thread] Current Thread [Next in Thread>