Bug#672182: libperl-critic-perl: conf-mode for .perlcriticrc

intrigeri intrigeri at boum.org
Thu Oct 25 15:43:43 UTC 2012


Kevin Ryde wrote (08 May 2012 23:57:13 GMT) :
> As an idea for a feature, 50libperl-critic-perl.el could set up to
> use conf-mode on the .perlcriticrc file.

I confirm it's a bit nicer in conf-mode than in fundamental-mode.

>   (if (fboundp 'conf-mode) ;; new in emacs22
>       (add-to-list 'auto-mode-alist '("/\\.perlcriticrc\\'" . conf-mode)))

> In 50libperl-critic-perl.el this could be outside the `file-exists-p'
> conditional since this setup doesn't use perlcritic.el as such, just the
> conf-mode.el which comes with emacs (22 and up).

Agreed. This works for me:

diff --git a/emacs/site-start.d/50libperl-critic-perl.el b/emacs/site-start.d/50libperl-critic-perl.el
index 74aa008..f840fab 100644
--- a/emacs/site-start.d/50libperl-critic-perl.el
+++ b/emacs/site-start.d/50libperl-critic-perl.el
@@ -12,3 +12,7 @@
   ;; just offered as options
   (custom-add-option 'perl-mode-hook  'perlcritic-mode)
   (custom-add-option 'cperl-mode-hook 'perlcritic-mode))
+
+(if (fboundp 'conf-mode) ;; new in emacs22
+  (add-to-list 'auto-mode-alist '("/\\.perlcriticrc\\'" . conf-mode)))



More information about the pkg-perl-maintainers mailing list