1 ;;; perlcritic.el --- minor mode for Perl::Critic integration
3 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
4 ;;; $URL: http://perlcritic.tigris.org/svn/perlcritic/trunk/distributions/Perl-Critic/extras/perlcritic.el $
5 ;;; $Date: 2009/04/23 15:46:13 $
8 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
13 ;; This is a minor mode for emacs intended to allow you to
14 ;; automatically incorporate perlcritic into your daily code
15 ;; writing. When enabled it can optionally prevent you from saving
16 ;; code that doesn't pass your enabled perlcritic policies.
18 ;; Even if you don't enable the automatic code checking you can still
19 ;; use the automatic checking or the `perlcritic' function.
22 ;;; Installation instructions:
24 ;; Copy perlcritic.el to your ~/.site-lib directory. If you don't
25 ;; have a .site-lib directory create it and add the following line
26 ;; to your .emacs file. This location isn't special, you could use
27 ;; a different location if you wished.
29 ;; (add-to-list 'load-path "/home/your-name/.site-lisp")
31 ;; Add the following lines to your .emacs file. This allows Emacs
32 ;; to load your perlcritic library only when needed.
34 ;; (autoload 'perlcritic "perlcritic" "" t)
35 ;; (autoload 'perlcritic-region "perlcritic" "" t)
36 ;; (autoload 'perlcritic-mode "perlcritic" "" t)
38 ;; Add the following to your .emacs file to get perlcritic-mode to
39 ;; run automatically for the `cperl-mode' and `perl-mode'.
41 ;; (eval-after-load "cperl-mode"
42 ;; '(add-hook 'cperl-mode-hook 'perlcritic-mode))
43 ;; (eval-after-load "perl-mode"
44 ;; '(add-hook 'perl-mode-hook 'perlcritic-mode))
47 ;; If you think you need perlcritic loaded all the time you can
48 ;; make this unconditional by using the following command instead
49 ;; of the above autoloading.
51 ;; (require 'perlcritic)
53 ;; Compile the file for extra performance. This is optional. You
54 ;; will have to redo this everytime you modify or upgrade your
55 ;; perlcritic.el file.
57 ;; M-x byte-compile-file ~/.site-lib/perlcritic.el
59 ;; Additional customization can be found in the Perl::Critic group
60 ;; in the Tools section in the Programming section of your Emacs'
61 ;; customization menus.
66 ;; Find out how to get perlcritic customization stuff into the
67 ;; customization menus without having to load perlcritic.el
70 ;; This needs an installer. Is there anything I can use in
71 ;; ExtUtils::MakeMaker, Module::Build, or Module::Install?
74 ;; XEmacs compatibility. I use GNU Emacs and don't test in
75 ;; XEmacs. I'm happy to do what it takes to be compatible but
76 ;; someone will have to point things out to me.
78 ;; Make all documentation strings start with a sentence that fits
79 ;; on one line. See "Tips for Documentation Strings" in the Emacs
82 ;; Any FIXME, TODO, or XXX tags below.
87 ;; * Synched up regexp alist with Perl::Critic::Utils and accounted for all
90 ;; * Added documentation for perlcritic-top, perlcritic-include,
91 ;; perlcritic-exclude, perlcritic-force, perlcritic-verbose.
92 ;; * Added emacs/vim editor hints to the bottom.
93 ;; * Corrected indentation.
95 ;; * Fixed perlcritic-compilation-error-regexp-alist for all
97 ;; * Added documentation strings for functions.
99 ;; * Moved perlcritic-compilation-error-regexp-alist so it is in the
100 ;; source before it's used. This only seems to matter when
101 ;; perlcritic.el is compiled to bytecode.
102 ;; * Added perlcritic-exclude, perlcritic-include
105 ;; * Code cleanliness.
106 ;; * Comment cleanliness.
107 ;; * Nice error message when perlcritic warns.
108 ;; * Documented perlcritic-top, perlcritic-verbose.
109 ;; * Regular expressions for the other standard -verbose levels.
110 ;; * Reversed Changes list so the most recent is first.
111 ;; * Standard emacs library declarations.
112 ;; * Added autoloading metadata.
114 ;; * perlcritic-bin invocation now shown in output.
115 ;; * Fixed indentation.
116 ;; * perlcritic-region is now interactive.
118 ;; * Removed a roque file-level (setq perlcritic-top 1)
119 ;; * Moved cl library to compile-time.
121 ;; * compile.el integration. This makes for hotlink happiness.
122 ;; * Better sanity when starting the *perlcritic* buffer.
124 ;; * perlcritic-severity-level added.
125 ;; * Touched up the installation documentation.
126 ;; * perlcritic-pass-required is now buffer local.
128 ;; * It's new. I copied much of this from perl-lint-mode.
130 ;;; Copyright and license
132 ;; 2006 Joshua ben Jore <jjore@cpan.org>
134 ;; This program is free software; you can redistribute it and/or
135 ;; modify it under the same terms as Perl itself
142 ;;; Customization and variables.
143 (defgroup perlcritic nil "Perl::Critic"
144 :prefix "perlcritic-"
147 (defcustom perlcritic-bin "perlcritic"
148 "The perlcritic program used by `perlcritic'."
152 (defcustom perlcritic-pass-required nil
153 "When \\[perlcritic-mode] is enabled then this boolean controls
154 whether your file can be saved when there are perlcritic warnings.
156 This variable is automatically buffer-local and may be overridden on a
157 per-file basis with File Variables."
159 (const :tag "Require no warnings from perlcritic to save" t)
160 (const :tag "Allow warnings from perlcritic when saving" nil))
162 (make-variable-buffer-local 'perlcritic-pass-required)
164 (defcustom perlcritic-profile nil
165 "Specify an alternate .perlcriticrc file. This is only used if
169 (make-variable-buffer-local 'perlcritic-profile)
171 (defcustom perlcritic-noprofile nil
172 "Disables the use of any .perlcriticrc file."
175 (make-variable-buffer-local 'perlcritic-noprofile)
177 (defcustom perlcritic-severity nil
178 "Directs perlcritic to only report violations of Policies with a
179 severity greater than N. Severity values are integers ranging from
180 1 (least severe) to 5 (most severe). The default is 5. For a given
181 -profile, decreasing the -severity will usually produce more
182 violations. Users can redefine the severity for any Policy in their
185 This variable is automatically buffer-local and may be overridden on a
186 per-file basis with File Variables."
187 ;; FIXME: My GNU Emacs doesn't show a radio widget or a menu here.
189 (const :tag "Show only the most severe: 5" 5)
193 (const :tag "Show everything including the least severe: 1" 1))
195 (make-variable-buffer-local 'perlcritic-severity)
197 (defcustom perlcritic-top nil
198 "Directs \"perlcritic\" to report only the top N Policy violations in
199 each file, ranked by their severity. If the -severity option is not
200 explicitly given, the -top option implies that the minimum severity
201 level is 1. Users can redefine the severity for any Policy in their
204 This variable is automatically buffer-local and may be overridden on a
205 per-file basis with File Variables."
208 (make-variable-buffer-local 'perlcritic-top)
210 (defcustom perlcritic-include nil
211 "Directs \"perlcritic\" to apply additional Policies that match the regex \"/PATTERN/imx\".
212 Use this option to override your profile and/or the severity settings.
218 This would cause \"perlcritic\" to apply all the \"CodeLayout::*\" policies
219 even if they have a severity level that is less than the default level of 5,
220 or have been disabled in your .perlcriticrc file. You can specify multiple
221 `perlcritic-include' options and you can use it in conjunction with the
222 `perlcritic-exclude' option. Note that `perlcritic-exclude' takes precedence
223 over `perlcritic-include' when a Policy matches both patterns. You can set
224 the default value for this option in your .perlcriticrc file."
227 (make-variable-buffer-local 'perlcritic-include)
229 (defcustom perlcritic-exclude nil
230 "Directs \"perlcritic\" to not apply any Policy that matches the regex
231 \"/PATTERN/imx\". Use this option to temporarily override your profile and/or
232 the severity settings at the command-line. For example:
236 This would cause \"perlcritic\" to not apply the \"RequireUseStrict\" and
237 \"ProhibitNoStrict\" Policies even though they have the highest severity
238 level. You can specify multiple `perlcritic-exclude' options and you can use
239 it in conjunction with the `perlcritic-include' option. Note that
240 `perlcritic-exclude' takes precedence over `perlcritic-include' when a Policy
241 matches both patterns. You can set the default value for this option in your
245 (make-variable-buffer-local 'perlcritic-exclude)
248 (defcustom perlcritic-force nil
249 "Directs \"perlcritic\" to ignore the magical \"## no critic\"
250 pseudo-pragmas in the source code. You can set the default value for this
251 option in your .perlcriticrc file."
254 (make-variable-buffer-local 'perlcritic-force)
256 (defcustom perlcritic-verbose nil
257 "Sets the numeric verbosity level or format for reporting violations. If
258 given a number (\"N\"), \"perlcritic\" reports violations using one of the
259 predefined formats described below. If the `perlcritic-verbose' option is not
260 specified, it defaults to either 4 or 5, depending on whether multiple files
261 were given as arguments to \"perlcritic\". You can set the default value for
262 this option in your .perlcriticrc file.
264 Verbosity Format Specification
265 ----------- -------------------------------------------------------------
267 2 \"%f: (%l:%c) %m\n\",
268 3 \"%m at %f line %l\n\",
269 4 \"%m at line %l, column %c. %e. (Severity: %s)\n\",
270 5 \"%f: %m at line %l, column %c. %e. (Severity: %s)\n\",
271 6 \"%m at line %l, near ’%r’. (Severity: %s)\n\",
272 7 \"%f: %m at line %l near ’%r’. (Severity: %s)\n\",
273 8 \"[%p] %m at line %l, column %c. (Severity: %s)\n\",
274 9 \"[%p] %m at line %l, near ’%r’. (Severity: %s)\n\",
275 10 \"%m at line %l, column %c.\n %p (Severity: %s)\n%d\n\",
276 11 \"%m at line %l, near ’%r’.\n %p (Severity: %s)\n%d\n\"
278 Formats are a combination of literal and escape characters similar to the way
279 \"sprintf\" works. See String::Format for a full explanation of the
280 formatting capabilities. Valid escape characters are:
283 ------- ----------------------------------------------------------------
284 %c Column number where the violation occurred
285 %d Full diagnostic discussion of the violation
286 %e Explanation of violation or page numbers in PBP
287 %F Just the name of the file where the violation occurred.
288 %f Path to the file where the violation occurred.
289 %l Line number where the violation occurred
290 %m Brief description of the violation
291 %P Full name of the Policy module that created the violation
292 %p Name of the Policy without the Perl::Critic::Policy:: prefix
293 %r The string of source code that caused the violation
294 %s The severity level of the violation
296 The purpose of these formats is to provide some compatibility with text
297 editors that have an interface for parsing certain kinds of input.
300 This variable is automatically buffer-local and may be overridden on a
301 per-file basis with File Variables."
304 (make-variable-buffer-local 'perlcritic-verbose)
306 ;; TODO: Enable strings in perlcritic-verbose.
307 ;; (defcustom perlcritic-verbose-regexp nil
308 ;; "An optional regexp to match the warning output.
310 ;; This is used when `perlcritic-verbose' has a regexp instead of one of
311 ;; the standard verbose levels.")
312 ;; (make-local-variable 'perlcritic-verbose-regexp)
315 ;; compile.el requires that something be the "filename." I've tagged
316 ;; the severity with that. It happens to make it get highlighted in
317 ;; red. The following advice on COMPILATION-FIND-FILE makes sure that
318 ;; the "filename" is getting ignored when perlcritic is using it.
320 ;; These patterns are defined in Perl::Critic::Utils
322 (defvar perlcritic-compilation-error-regexp-alist
325 ("^\\([^\n]+\\):\\([0-9]+\\):\\([0-9]+\\)" 1 2 3)
328 ;; "%f: (%l:%c) %m\n"
329 ("^\\([^\n]+\\): (\\([0-9]+\\):\\([0-9]+\\))" 1 2 3)
332 ;; "%m at %f line %l\n"
333 ("^[^\n]+ at \\([^\n]+\\) line \\([0-9]+\\)" 1 2)
334 ;; "%m at line %l, column %c. %e. (Severity: %s)\n"
335 ("^[^\n]+ at line\\( \\)\\([0-9]+\\), column \\([0-9]+\\)." 1 2 3)
338 ;; "%m at line %l, column %c. %e. (Severity: %s)\n"
339 ("^[^\n]+ at line\\( \\)\\([0-9]+\\), column \\([0-9]+\\)." 1 2 3)
340 ;; "%f: %m at line %l, column %c. %e. (Severity: %s)\n"
341 ("^\\([^\n]+\\): [^\n]+ at line \\([0-9]+\\), column \\([0-9]+\\)" 1 2 3)
344 ;; "%m at line %l, near '%r'. (Severity: %s)\n"
345 ("^[^\n]+ at line\\( \\)\\([0-9]+\\)," 1 2)
346 ;; "%f: %m at line %l, column %c. %e. (Severity: %s)\n"
347 ("^\\([^\n]+\\): [^\n]+ at line \\([0-9]+\\), column \\([0-9]+\\)" 1 2 3)
350 ;; "%m at line %l, near '%r'. (Severity: %s)\\n"
351 ("^[^\n]+ at line\\( \\)\\([0-9]+\\)" 1 2)
352 ;; "%f: %m at line %l near '%r'. (Severity: %s)\n"
353 ("^\\([^\n]+\\): [^\n]+ at line \\([0-9]+\\)" 1 2)
356 ;; "%f: %m at line %l near '%r'. (Severity: %s)\n"
357 ("^\\([^\n]+\\): [^\n]+ at line \\([0-9]+\\)" 1 2)
358 ;; "[%p] %m at line %l, column %c. (Severity: %s)\n"
359 ("^\\[[^\n]+\\] [^\n]+ at line\\( \\)\\([0-9]+\\), column \\([0-9]+\\)" 1 2 3)
362 ;; "[%p] %m at line %l, column %c. (Severity: %s)\n"
363 ("^\\[[^\n]+\\] [^\n]+ at line\\( \\)\\([0-9]+\\), column \\([0-9]+\\)" 1 2 3)
364 ;; "[%p] %m at line %l, near '%r'. (Severity: %s)\n"
365 ("^\\[[^\n]+\\] [^\n]+ at line\\( \\)\\([0-9]+\\)" 1 2)
368 ;; "%m at line %l, column %c.\n %p (Severity: %s)\n%d\n"
369 ("^[^\n]+ at line\\( \\)\\([0-9]+\\), column \\([0-9]+\\)" 1 2 3)
370 ;; "[%p] %m at line %l, near '%r'. (Severity: %s)\n"
371 ("^\\[[^\n]+\\] [^\n]+ at line\\( \\)\\([0-9]+\\)" 1 2)
374 ;; "%m at line %l, near '%r'.\n %p (Severity: %s)\n%d\n"
375 ("^[^\n]+ at line\\( \\)\\([0-9]+\\)" 1 2)
376 ;; "%m at line %l, column %c.\n %p (Severity: %s)\n%d\n"
377 ("^[^\n]+ at line\\( \\)\\([0-9]+\\), column \\([0-9]+\\)" 1 2 3)
380 ;; "%m at line %l, near '%r'.\n %p (Severity: %s)\n%d\n"
381 ("^[^\n]+ at line\\( \\)\\([0-9]+\\)" 1 2)
383 "Alist that specified how to match errors in perlcritic output.")
387 ;; The Emacs Lisp manual says to do this with the cl library.
388 (eval-when-compile (require 'cl))
392 "\\[perlcritic]] returns a either nil or t depending on whether the
393 current buffer passes perlcritic's check. If there are any warnings
394 those are displayed in a separate buffer."
396 (print "in perlcritic")
399 (perlcritic-region (point-min) (point-max))))
402 (defun perlcritic-region (start end)
403 "\\[perlcritic-region] returns a either nil or t depending on
404 whether the region passes perlcritic's check. If there are any
405 warnings those are displayed in a separate buffer."
409 (message "In perlcritic-region")
411 ;; Kill the perlcritic buffer so I can make a new one.
412 (if (get-buffer "*perlcritic*")
413 (kill-buffer "*perlcritic*"))
415 ;; In the following lines I'll be switching between buffers
416 ;; freely. This upper save-excursion will keep things sane.
418 (let ((src-buf (current-buffer))
419 (err-buf (get-buffer-create "*perlcritic*")))
422 (let ((perlcritic-args (loop for p in (list
423 ;; Add new bin/perlcritic
425 (perlcritic--param-profile)
426 (perlcritic--param-noprofile)
427 (perlcritic--param-severity)
428 (perlcritic--param-top)
429 (perlcritic--param-include)
430 (perlcritic--param-exclude)
431 (perlcritic--param-force)
432 (perlcritic--param-verbose))
436 (message "Perl critic...running")
437 ;; Seriously. Is this the nicest way to call
438 ;; CALL-PROCESS-REGION with variadic arguments? This blows!
439 ;; (apply FUNCTION (append STATIC-PART DYNAMIC-PART))
440 (message "perlcritic1")
441 (message (concat "Starting " perlcritic-bin))
442 (let ((rc (apply 'call-process-region
443 (nconc (list start end
448 (message "perlcritic2")
450 ;; Figure out whether we're ok or not. perlcritic has to
451 ;; return zero and the output buffer has to be empty except
452 ;; for that "... source OK" line. Different versions of the
453 ;; perlcritic script will print different things when
454 ;; they're ok. I expect to see things like "some-file source
455 ;; OK", "SCALAR=(0x123457) source OK", "STDIN source OK",
457 (let ((perlcritic-ok (and (numberp rc)
461 (goto-char (point-min))
462 (delete-matching-lines "source OK$")
463 (zerop (buffer-size))))))
464 ;; Either clean up or finish setting up my output.
468 (kill-buffer err-buf)
469 (message "Perl critic...ok"))
473 (message "Perl critic...not ok")
475 ;; Set up the output buffer now I know it'll be used. I
476 ;; scooped the guts out of compile-internal. It is
477 ;; CRITICAL that the errors start at least two lines
478 ;; from the top. compile.el normally assumes the first
479 ;; line is an informational `cd somedirectory' command
480 ;; and the second line shows the program's invocation.
482 ;; Since I have the space available I've put the
483 ;; program's invocation here. Maybe it'd make sense to
484 ;; put the buffer's directory here somewhere too.
486 (goto-char (point-min))
487 (insert (reduce (lambda (a b) (concat a " " b))
488 (nconc (list perlcritic-bin)
491 ;; TODO: instead of a blank line, print the
492 ;; buffer's directory+file.
494 (goto-char (point-min))
495 ;; TODO: get `recompile' to work.
497 ;; just an fyi. compilation-mode will delete my local
498 ;; variables so be sure to call it *first*.
499 (compilation-mode "perlcritic")
500 (set (make-local-variable 'perlcritic-buffer) src-buf)
501 (set (make-local-variable 'compilation-error-regexp-alist)
502 perlcritic-compilation-error-regexp-alist)
503 (ad-activate #'compilation-find-file)
504 ; (ad-deactivate #'compilation-find-file)
505 (display-buffer err-buf))
507 ;; Return our success or failure.
513 ;;; Parameters for use by perlcritic-region.
514 (defun perlcritic--param-profile ()
515 "A private method that supplies the -profile FILENAME parameter for
516 \\[perlcritic-region]"
517 (if perlcritic-profile (list "-profile" perlcritic-profile)))
519 (defun perlcritic--param-noprofile ()
520 "A private method that supplies the -noprofile parameter for
521 \\[perlcritic-region]"
522 (if perlcritic-noprofile (list "-noprofile")))
524 (defun perlcritic--param-force ()
525 "A private method that supplies the -force parameter for
526 \\[perlcritic-region]"
527 (if perlcritic-force (list "-force")))
529 (defun perlcritic--param-severity ()
530 "A private method that supplies the -severity NUMBER parameter for
531 \\[perlcritic-region]"
532 (cond ((stringp perlcritic-severity)
533 (list "-severity" perlcritic-severity))
534 ((numberp perlcritic-severity)
535 (list "-severity" (number-to-string perlcritic-severity)))
538 (defun perlcritic--param-top ()
539 "A private method that supplies the -top NUMBER parameter for
540 \\[perlcritic-region]"
541 (cond ((stringp perlcritic-top)
542 (list "-top" perlcritic-top))
543 ((numberp perlcritic-top)
544 (list "-top" (number-to-string perlcritic-top)))
547 (defun perlcritic--param-include ()
548 "A private method that supplies the -include REGEXP parameter for
549 \\[perlcritic-region]"
550 (if perlcritic-include
551 (list "-include" perlcritic-include)
554 (defun perlcritic--param-exclude ()
555 "A private method that supplies the -exclude REGEXP parameter for
556 \\[perlcritic-region]"
557 (if perlcritic-exclude
558 (list "-exclude" perlcritic-exclude)
561 (defun perlcritic--param-verbose ()
562 "A private method that supplies the -verbose NUMBER parameter for
563 \\[perlcritic-region]"
564 (cond ((stringp perlcritic-verbose)
565 (list "-verbose" perlcritic-verbose))
566 ((numberp perlcritic-verbose)
567 (list "-verbose" (number-to-string perlcritic-verbose)))
571 ;; Interactive functions for use by the user to modify parameters on
572 ;; an adhoc basis. I'm sure there's room for significant niceness
573 ;; here. Suggest something. Please.
574 (defun perlcritic-profile (profile)
575 "Sets perlcritic's -profile FILENAME parameter."
576 (interactive "sperlcritic -profile: ")
577 (setq perlcritic-profile (if (string= profile "") nil profile)))
579 (defun perlcritic-noprofile (noprofile)
580 "Toggles perlcritic's -noprofile parameter."
581 (interactive (list (yes-or-no-p "Enable perlcritic -noprofile? ")))
582 (setq perlcritic-noprofile noprofile))
584 (defun perlcritic-force (force)
585 "Toggles perlcritic's -force parameter."
586 (interactive (list (yes-or-no-p "Enable perlcritic -force? ")))
587 (setq perlcritic-force force))
589 (defun perlcritic-severity (severity)
590 "Sets perlcritic's -severity NUMBER parameter."
591 (interactive "nperlcritic -severity: ")
592 (setq perlcritic-severity severity))
594 (defun perlcritic-top (top)
595 "Sets perlcritic's -top NUMBER parameter."
596 (interactive "nperlcritic -top: ")
597 (setq perlcritic-top top))
599 (defun perlcritic-include (include)
600 "Sets perlcritic's -include REGEXP parameter."
601 (interactive "sperlcritic -include: ")
602 (setq perlcritic-include include))
604 (defun perlcritic-exclude (exclude)
605 "Sets perlcritic's -exclude REGEXP parameter."
606 (interactive "sperlcritic -exclude: ")
607 (setq perlcritic-exclude exclude))
609 (defun perlcritic-verbose (verbose)
610 "Sets perlcritic's -verbose NUMBER parameter."
611 (interactive "nperlcritic -verbose: ")
612 (setq perlcritic-verbose verbose))
618 ;; Hooks compile.el's compilation-find-file to enable our file-less
619 ;; operation. We feed `perlcritic-bin' from STDIN, not from a file.
620 (defadvice compilation-find-file (around perlcritic-find-file)
621 "Lets perlcritic lookup into the buffer we just came from and don't
622 require that the perl document exist in a file anywhere."
623 (let ((debug-buffer (marker-buffer marker)))
624 (if (local-variable-p 'perlcritic-buffer debug-buffer)
625 (setq ad-return-value perlcritic-buffer)
632 ;; All the scaffolding of having a minor mode.
633 (defvar perlcritic-mode nil
634 "Toggle `perlcritic-mode'")
635 (make-variable-buffer-local 'perlcritic-mode)
637 (defun perlcritic-write-hook ()
638 "Check perlcritic during `write-file-hooks' for `perlcritic-mode'"
643 (let ((perlcritic-ok (perlcritic)))
644 (if perlcritic-pass-required
645 ;; Impede saving if we're not ok.
647 ;; Don't impede saving. We might not be ok but that
648 ;; doesn't matter now.
650 ;; Don't impede saving. We're not in perlcritic-mode.
654 (defun perlcritic-mode (&optional arg)
655 "Perl::Critic checking minor mode."
658 ;; Enable/disable perlcritic-mode
659 (setq perlcritic-mode (if (null arg)
660 ;; Nothing! Just toggle it.
661 (not perlcritic-mode)
663 (> (prefix-numeric-value arg) 0)))
665 (make-local-hook 'write-file-hooks)
667 (add-hook 'write-file-hooks 'perlcritic-write-hook)
668 (remove-hook 'write-file-hooks 'perlcritic-write-hook)))
670 ;; Make a nice name for perl critic mode. This string will appear at
671 ;; the bottom of the screen.
672 (if (not (assq 'perlcritic-mode minor-mode-alist))
673 (setq minor-mode-alist
674 (cons '(perlcritic-mode " Critic")
677 (provide 'perlcritic)
683 ;; indent-tabs-mode: nil
685 ;; ex: set ts=8 sts=4 sw=4 tw=78 ft=perl expandtab shiftround :
687 ;;; perlcritic.el ends here