Skip to content

Instantly share code, notes, and snippets.

@foxiepaws
Created August 16, 2015 05:11
Show Gist options
  • Select an option

  • Save foxiepaws/ed0d5f7bb52b6ee6688e to your computer and use it in GitHub Desktop.

Select an option

Save foxiepaws/ed0d5f7bb52b6ee6688e to your computer and use it in GitHub Desktop.
(defun perlcritic ()
""
(interactive)
(let ((buffer-mode (symbol-name (buffer-local-value 'major-mode (current-buffer)))))
(if
(or (string= "perl-mode" buffer-mode) (string= "cperl-mode" buffer-mode))
(compile (concat "perlc --critic " (buffer-file-name)))
(error "not a perl file. (or an unrecognised perl mode)")
)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment