Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Favorite Hacks in Emacs

by shem (Initiate)
on May 13, 2009 at 11:37 UTC ( #763739=note: print w/ replies, xml ) Need Help??


in reply to Favorite Hacks in Emacs

(defun cw_save_check () "Run the Perl syntax checker on this buffer after saving." (cond ((equal mode-name "CPerl") (progn (save-current-buffer (set-buffer (get-buffer-create "*Perl cw output*")) (erase-buffer)) (call-process-region (point-min) (point-max) "/usr/bin/perl" nil + "*Perl cw output*" n il "-c -I.") (save-current-buffer (set-buffer "*Perl cw output*") (cond ((equal (buffer-string) "- syntax OK\n") (message "%s" "Synta +x OK")) (t (message "%s" "The program has errors.")))))) (t nil))) (add-hook 'after-save-hook 'cw_save_check)


Comment on Re: Favorite Hacks in Emacs
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://763739]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (14)
As of 2015-07-28 11:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (254 votes), past polls