Re: syntax highlighting in mutt

2002-04-08 Thread darren chamberlain

* Jim MacBaine [EMAIL PROTECTED] [2002-04-05 16:52]:
 Hello everybody, 
 
 I'm regularly recieving perl and java programs 
 and I have to sort out the good from the bad.

Perl - good.
Java - bad.

Done. :)

 Right now I'm using mutt and use a mailcap entry
 to open the attachments in NEdit to have the
 syntax highlighted and help my brain sorting 
 the code. 

Why are you attempting to do this in your MUA?

 But it would be great to have a auto_view filter
 that shows the mail coloured. Something like lynx 
 -dump with the right escape sequences. 

Have you considered using vim as your pager?

 I've not digged deeper into vi/vim than the basic
 editing functions, but perhaps it can be misused
 for this...

vim already does syntax highlighting, if you have it configured for it,
so that should be a good way to go.

(darren)

-- 
A computer lets you make more mistakes faster than any other
invention, with the possible exceptions of handguns and Tequila.
-- Mitch Ratcliffe



Re: syntax highlighting in mutt

2002-04-08 Thread darren chamberlain

* Thomas Dickey [EMAIL PROTECTED] [2002-04-05 17:57]:
 On Fri, Apr 05, 2002 at 06:01:44PM -0500, David T-G wrote:
  ...and then Jim MacBaine said...
   I'm regularly recieving perl and java programs 
   and I have to sort out the good from the bad.
  
  The perl sounds fun, but I feel for you for the java junk ;-)
 
 At least java has a well-defined grammar which makes it easy to parse.
 (perl, otoh...)

Perl parser?  Sure, look at perly.c and toke.c in the perl source...

 I haven't seen a syntax highlighter for perl that handles all of perl
 (counting vim, vile, emacs).  

As a professional perl programmer, I have to say that I've found vim to
be the least deficient in parsing perl syntax.  Better than Emacs'
cperl-mode (not a flame, and observation!) and light year's better than
anything else (have you how atrocious enscript's syntax highlighting for
perl is?).  The things most highlighter seem to have a problem with
(inculding emacs) is POD, regexes, and the alternative quoting mechanisms.

 Perhaps that should be a feature of perl 6.

Actually, it is.

(darren)

-- 
We must respect the other fellow's religion, but only in the sense and
to the extent that we respect his theory that his wife is beautiful
and his children smart.
-- H.L.Mencken



Re: syntax highlighting in mutt

2002-04-08 Thread Thomas E. Dickey

On Mon, 8 Apr 2002, darren chamberlain wrote:

 As a professional perl programmer, I have to say that I've found vim to
 be the least deficient in parsing perl syntax.  Better than Emacs'
 cperl-mode (not a flame, and observation!) and light year's better than
 anything else (have you how atrocious enscript's syntax highlighting for
 perl is?).  The things most highlighter seem to have a problem with
 (inculding emacs) is POD, regexes, and the alternative quoting mechanisms.

not at all - I see (whenever I work on that one) that vim has about as
many defects in its parser as vile.

ymmv.

-- 
T.E.Dickey [EMAIL PROTECTED]
http://invisible-island.net
ftp://invisible-island.net




Re: syntax highlighting in mutt

2002-04-06 Thread David T-G

Thomas --

...and then Thomas Dickey said...
% 
...
% you could make a shell-script wrapper to customize the keys.  I do something
% like that for vile (not for keys, but to format a manpage on-the-fly and
% view it with vile).

Yeah, I thought of that too late.  Thanks, though.  I love that this is
already done for me, as also noted in this thread :-)


% 
% -- 
% Thomas E. Dickey [EMAIL PROTECTED]
% http://invisible-island.net
% ftp://invisible-island.net


:-D
-- 
David T-G  * It's easier to fight for one's principles
(play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie
(work) [EMAIL PROTECTED]
http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg26828/pgp0.pgp
Description: PGP signature


syntax highlighting in mutt

2002-04-05 Thread Jim MacBaine


Hello everybody, 

I'm regularly recieving perl and java programs 
and I have to sort out the good from the bad.

Right now I'm using mutt and use a mailcap entry
to open the attachments in NEdit to have the
syntax highlighted and help my brain sorting 
the code. 

But it would be great to have a auto_view filter
that shows the mail coloured. Something like lynx 
-dump with the right escape sequences. 

Sure, I could define regexps in mutt for this, but
I doubt whether this is worth the work and whether
this means reinventing the wheel.

I've not digged deeper into vi/vim than the basic
editing functions, but perhaps it can be misused
for this...

Does anyone of you have an idea?

Regards, 
Jim

__

Gesendet von Yahoo! Mail - http://mail.yahoo.de
Sie brauchen mehr Speicher für Ihre E-Mails? - http://premiummail.yahoo.de




Re: syntax highlighting in mutt

2002-04-05 Thread David T-G

Jim --

...and then Jim MacBaine said...
% 
% Hello everybody, 

Hi!


% 
% I'm regularly recieving perl and java programs 
% and I have to sort out the good from the bad.

The perl sounds fun, but I feel for you for the java junk ;-)


% 
% Right now I'm using mutt and use a mailcap entry
% to open the attachments in NEdit to have the
...
% But it would be great to have a auto_view filter
...
% 
% Sure, I could define regexps in mutt for this, but
% I doubt whether this is worth the work and whether
% this means reinventing the wheel.

Yeah; that sounds ugly.


% 
% I've not digged deeper into vi/vim than the basic
% editing functions, but perhaps it can be misused
% for this...

Oh, it certainly could :-)


% 
% Does anyone of you have an idea?

Do they show up as part of the message text, or is their type not
recognized and so they're not displayed?

I don't know of any pagers (ie, not meant to be an editor but instead
just a file viewer) that do syntax highlighting, though that doesn't at
all mean that they aren't out there.

If you see them with the pager now, then you might whip up a message-hook
that sets your pager to vim (or maybe vim -R) so that you can take
advantage of vim's *extensive* syntax highlighting -- and, new in 6.1
or so, folding, too.


% 
% Regards, 
% Jim


:-D
-- 
David T-G  * It's easier to fight for one's principles
(play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie
(work) [EMAIL PROTECTED]
http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg26809/pgp0.pgp
Description: PGP signature


Re: syntax highlighting in mutt

2002-04-05 Thread Rocco Rutte

Hi,

* Jim MacBaine [04/05/02 23:52:27 CEST] wrote:
 I'm regularly recieving perl and java programs 
 and I have to sort out the good from the bad.

Your boss doesn't seem to like you? ,-)

 Right now I'm using mutt and use a mailcap entry
 to open the attachments in NEdit to have the
 syntax highlighted and help my brain sorting 
 the code. 

Good.

 But it would be great to have a auto_view filter
 that shows the mail coloured. Something like lynx 
 -dump with the right escape sequences. 

Colored dumps? Not that I know...

 Sure, I could define regexps in mutt for this, but
 I doubt whether this is worth the work and whether
 this means reinventing the wheel.

Yeah, you could also write a short display_filter which performs syntax
checking or even some sort of compiling to pre-select and kill the
really bad ones.

But vim is also abled to detect some primitive syntax errors and color
it. This is not possible with color patterns for mutt. No matter how
hard you try.

 I've not digged deeper into vi/vim than the basic
 editing functions, but perhaps it can be misused
 for this...

Why do call this 'misuse'? It should work so why not try it?

Cheers, Rocco.



msg26812/pgp0.pgp
Description: PGP signature


Re: syntax highlighting in mutt

2002-04-05 Thread David T-G

Thomas, et al --

...and then Thomas Dickey said...
% 
% On Fri, Apr 05, 2002 at 06:01:44PM -0500, David T-G wrote:
%  
%  The perl sounds fun, but I feel for you for the java junk ;-)
% 
% At least java has a well-defined grammar which makes it easy to parse.
% (perl, otoh...)

*grin*


% 
% I haven't seen a syntax highlighter for perl that handles all of perl
% (counting vim, vile, emacs).  Perhaps that should be a feature of perl 6.

Fair enough.  It was pure flame bait :-)


% 
% -- 
% Thomas E. Dickey [EMAIL PROTECTED]
% http://invisible-island.net
% ftp://invisible-island.net


:-D
-- 
David T-G  * It's easier to fight for one's principles
(play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie
(work) [EMAIL PROTECTED]
http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg26814/pgp0.pgp
Description: PGP signature


Re: syntax highlighting in mutt

2002-04-05 Thread David T-G

Shawn --

...and then Shawn McMahon said...
% 
% begin  quoting what David T-G said on Fri, Apr 05, 2002 at 06:01:44PM -0500:
%  
%  I don't know of any pagers (ie, not meant to be an editor but instead
%  just a file viewer) that do syntax highlighting, though that doesn't at
%  all mean that they aren't out there.
% 
% vim, if called as view, is a pager.

Well, yeah; the same as if you use -R.  But it's an editor that's simply
in read-only mode, not a pager, and so it is a little clunkier to jump
forward by whole pages (you can't just hit the space bar like you do with
the rest of your mail messages).


:-D
-- 
David T-G  * It's easier to fight for one's principles
(play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie
(work) [EMAIL PROTECTED]
http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg26815/pgp0.pgp
Description: PGP signature


Re: syntax highlighting in mutt

2002-04-05 Thread Thomas Dickey

On Fri, Apr 05, 2002 at 07:56:14PM -0500, David T-G wrote:
 Shawn --
 
 ...and then Shawn McMahon said...
 % 
 % begin  quoting what David T-G said on Fri, Apr 05, 2002 at 06:01:44PM -0500:
 %  
 %  I don't know of any pagers (ie, not meant to be an editor but instead
 %  just a file viewer) that do syntax highlighting, though that doesn't at
 %  all mean that they aren't out there.
 % 
 % vim, if called as view, is a pager.
 
 Well, yeah; the same as if you use -R.  But it's an editor that's simply
 in read-only mode, not a pager, and so it is a little clunkier to jump
 forward by whole pages (you can't just hit the space bar like you do with
 the rest of your mail messages).

you could make a shell-script wrapper to customize the keys.  I do something
like that for vile (not for keys, but to format a manpage on-the-fly and
view it with vile).

-- 
Thomas E. Dickey [EMAIL PROTECTED]
http://invisible-island.net
ftp://invisible-island.net



Re: syntax highlighting in mutt

2002-04-05 Thread Shawn McMahon

begin  quoting what David T-G said on Fri, Apr 05, 2002 at 07:56:14PM -0500:
 
 Well, yeah; the same as if you use -R.  But it's an editor that's simply
 in read-only mode, not a pager, and so it is a little clunkier to jump
 forward by whole pages (you can't just hit the space bar like you do with
 the rest of your mail messages).

Oh ye of little faith:

http://vim.sourceforge.net/tips/tip.php?tip_id=121




msg26817/pgp0.pgp
Description: PGP signature