-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmy-cperl-mode.el
65 lines (61 loc) · 2.56 KB
/
my-cperl-mode.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
;;; my-cperl-mode --- Perl related bindings
;;
;; Copyright (C) 2014 Alex Bennée
;;
;; Author: Alex Bennée <[email protected]>
;;
;; This file is not part of GNU Emacs.
;;
;; This file 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, or (at your option)
;; any later version.
;;
;;; Commentary:
;;
;; Currently an ill thought out dumping ground
;;
;;; Code:
(require 'use-package)
;; CPerl-mode
(use-package cperl-mode
:mode ((cons "\\.\\([pP][Llm]\\|al\\)\\'" 'cperl-mode)
(cons "\\.plx\\'" 'cperl-mode)
(cons "\\.cgi\\'" 'cperl-mode)
(cons "\\.pod\\'" 'cperl-mode)
(cons ".*/perl/.*" 'cperl-mode))
:interpreter (("perl" . cperl-mode)
("perl5" . cperl-mode)
("miniperl" . cperl-mode))
:config
(progn
;; settings
(setq cperl-info-on-command-no-prompt nil
cperl-clobber-lisp-bindings nil
cperl-electric-parens nil
cperl-electric-keywords nil)
;; cperl-mode tries to load abrev before running the hook
(add-hook 'cperl-mode-hook
'(lambda ()
(cperl-set-style "BSD")
(setq cperl-hairy nil
cperl-merge-trailing-else nil
cperl-tab-always-indent nil
cperl-auto-newline nil
cperl-electric-lbrace-space nil
cperl-electric-linefeed t
cperl-electric-parens nil
cperl-electric-keywords nil
cperl-lazy-help-time 1
cperl-extra-newline-before-brace t
cperl-extra-newline-before-brace-multiline t
cperl-max-help-size 50)
(if (not cperl-lazy-installed) ; Only toggle if it's
(cperl-toggle-autohelp)) ; not already set
(if (locate-library "mode-compile")
(define-key cperl-mode-map "\C-cr" 'mode-compile))
(define-key cperl-mode-map "\C-cc" 'cperl-check-syntax)
(define-key cperl-mode-map "\C-j" 'cperl-linefeed)
(message "Ran cperl-mode hook")))))
(provide 'my-cperl-mode)
;;; my-cperl-mode.el ends here