Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
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 perusing the Monastery: (7)
As of 2014-09-20 21:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (163 votes), past polls