Today while reading LWN, I learned about the Flymake minor mode for Emacs. This software does on-the-fly compile checking, kind of like the on-the-fly spell checking that has become popular in many editors.
Whenever Emacs becomes idle, flymake shells out and runs "perl -c" on your code. It parses the output for errors. Back in Emacs, flymake highlights the offending code. Take a look at a screenshot I created, showing flymake responding to a missing semicolon.
Flymake appears to be pre-installed under Emacs 22
Has anyone else tried this?
It seems nice on trivial code I've tested, but it seems to disable itself a little too readily. It bases its decisions purely on the filename extension implied by the buffer name, instead of checking in with the major mode. It has trouble guessing @INC paths too, as can be expected. For example, I tried it on some Perl::Critic code, but because 'lib' wasn't in @INC, flymake turned itself off after one compile failure.
perlcritic-fly.el???? (Score:1)
I'm thinking that just autoadding lib/, t/, uh... t/lib would be spiffy. Perhaps with some dwimmery to notice if those directories can be found by navigating up the directory tree:
~jjore/src/Foo-Bar/t$
Maybe there oughta be som
Re: (Score:1)
I'm thinking that just autoadding lib/, t/, uh... t/lib would be spiffy.
That's a functionality that has been present in Perl for ages. It's called PERL5LIB.
Re: (Score:1)
Re: (Score:1)
Putting aside the argument about compiling untrusted code, you should be able to get the effect you want by putting "use criticism;" at the top of your script. In the latest release of criticism.pm, we changed the default output format to look exactly like the perl's native compiler warnings. So when you r
Re: (Score:1)
Re: (Score:1)
-Jeff
Re: (Score:1)
Re: (Score:1)
Perhaps we could repurpose the flymake code and just substitute "perlcritic" where it says "perl -c". But your lisp skills are far better than mine.
-Jeff
Re: (Score:1)
beware perl -c on unknown code (Score:2)
Re: (Score:1)
On my mental todo list is to check if flymake does a check right after load, or only after a first edit.
Re: (Score:1)
Re: (Score:1)
Re: (Score:1)
I continue to be amazed at how friendly you are in person.
Re: (Score:1)
I'd be amazed and pleasantly surprised by his not spitting on people in person. Who digs up a 3-year-old journal entry to take a cheap shot at someone related to something they did 15 years ago? I'm not sure that even greater internet fuckward theory can explain it.
Tried it (Score:1)
This invariably led to me typing something like:
my $my_long_varithen pausing to think, and it would just pop me over to the closing ; somewhere completely uninteresting to me.
Way too intrusive in other words.
It seems that kind of thing should be cu
Re: (Score:1)