[Catalyst] Re: Patch for Catalyst::View::Mason

Aristotle Pagaltzis pagaltzis at gmx.de
Mon Mar 10 14:14:20 GMT 2008


* Andrew Rodland <arodland at comcast.net> [2008-03-09 21:40]:
> On Sunday 09 March 2008 07:43:04 am Aristotle Pagaltzis wrote:
> > I see your bid and raise this:
> >
> >     autocmd BufRead */templates/tt/*    set ft=tt2html
> >     autocmd BufRead */templates/mason/* set ft=mason
> >
> > Wheee.
> 
> This is the slightly more effective version:
> 
> au BufNewFile,BufRead */templates/tt/* setf tt2html
> au BufNewFile,BufRead */templates/mason/* setf mason
> 
> Main difference being the BufNewFile handling (which you'll
> really miss if it's not there). setf is also "more proper" but
> it probably makes no difference at all in this case :)

Yeah, I knew I needed BufNewFile also. I didn’t know you could
list more than one event in an autocommand though, and I couldn’t
be bothered to type the whole thing out twice. Turns out that I
didn’t need to – nifty!

Also, I hadn’t seen `setf` before. Yeah, it won’t matter here, in
all likelihood, but still, it *is* more correct.

Thanks for both pointers!

Regards,
-- 
Aristotle Pagaltzis // <http://plasmasturm.org/>



More information about the Catalyst mailing list