From 4234803243d0671c15668d4749ce8546a77e35ef Mon Sep 17 00:00:00 2001 From: Bozhidar Batsov Date: Sun, 9 Oct 2011 22:41:07 +0300 Subject: [PATCH] Perl joins the Prelude family :-) --- init.el | 1 + prelude-perl.el | 63 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 64 insertions(+) create mode 100644 prelude-perl.el diff --git a/init.el b/init.el index aae24c0..bfcc4d8 100644 --- a/init.el +++ b/init.el @@ -58,6 +58,7 @@ (require 'prelude-emacs-lisp) (require 'prelude-haskell) (require 'prelude-markdown) +(require 'prelude-perl) (require 'prelude-ruby) ;;; init.el ends here diff --git a/prelude-perl.el b/prelude-perl.el new file mode 100644 index 0000000..18a98ff --- /dev/null +++ b/prelude-perl.el @@ -0,0 +1,63 @@ +;;; prelude-perl.el --- Emacs Prelude: decent Perl coding settings. +;; +;; Copyright (c) 2011 Bozhidar Batsov +;; +;; Author: Bozhidar Batsov +;; URL: http://www.emacswiki.org/cgi-bin/wiki/Prelude +;; Version: 1.0.0 +;; Keywords: convenience + +;; This file is not part of GNU Emacs. + +;;; Commentary: + +;; cperl-mode is the best Perl mode for Emacs out there. + +;;; License: + +;; This program is free software; you can redistribute it and/or +;; modify it under the terms of the GNU General Public License +;; as published by the Free Software Foundation; either version 3 +;; of the License, or (at your option) any later version. +;; +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. +;; +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. + +;;; Code: + +;; use cperl-mode instead of perl-mode +(defalias 'perl-mode 'cperl-mode) + +(defun prelude-cperl-mode-hook () + (setq cperl-indent-level 4) + (setq cperl-continued-statement-offset 8) + ;; cperl-hairy affects all those variables, but I prefer + ;; a more fine-grained approach as far as they are concerned + (setq cperl-font-lock t) + (setq cperl-electric-lbrace-space t) + (setq cperl-electric-parens nil) + (setq cperl-electric-linefeed nil) + (setq cperl-electric-keywords nil) + (setq cperl-info-on-command-no-prompt t) + (setq cperl-clobber-lisp-bindings t) + (setq cperl-lazy-help-time 3) + + ;; if you want all the bells and whistles + ;; (setq cperl-hairy) + + (set-face-background 'cperl-array-face nil) + (set-face-background 'cperl-hash-face nil) + (setq cperl-invalid-face nil)) + +(add-hook 'cperl-mode-hook 'prelude-cperl-mode-hook t) + +(provide 'prelude-perl) + +;;; prelude-perl.el ends here