Perl Hacks on Emacs

Perl Casual #2

April 21th, 2010

自己紹介

Agenda

Agenda

Agenda

EmacsでPerlコーディング

anything.el

perl-completion.el

auto-complete.el

anything-project.el

(ap:add-project :name 'perl
                :look-for '("Makefile.PL" "Build.PL")
                :exclude-regexp '("/blib"))

flymake

perl-tidy

設定方法のとっかかり

emacs設定ファイル

分割設定ファイルのすすめ

(require 'init-loader)
(init-loader-load "~/.emacs.d/conf")

簡単elispインストール

(require 'auto-install)
(setq auto-install-directory "~/.emacs.d/elisp/")

簡単elispインストール

M-x auto-install-from-url http://.../something.el
M-x auto-install-batch anything

anything.el

M-x auto-install-batch anything

perl-completion.el

M-x auto-install-batch perl-completion

auto-complete.el

M-x auto-install-batch auto-complete

anything-project.el

M-x auto-install http://github.com/imakado/anything-project/raw/master/anything-project.el

elisp のインストールが終わったら

とかにそれに設定を書く(XXは数字)

(require 'anything-config)
(require 'anything)

(global-set-key "\C-xb" 'anything)

僕の ~/.emacs.el

;; load-path
(add-to-list 'load-path "~/.emacs.d/elisp")

(require 'init-loader)
(init-loader-load "~/.emacs.d/conf")

設定全体

http://github.com/typester/emacs-config

flymake

(defun flymake-perl-init ()
  (let* ((temp-file (flymake-init-create-temp-buffer-copy
                     'flymake-create-temp-inplace))
         (local-file (file-relative-name
                      temp-file
                      (file-name-directory buffer-file-name))))
    (list "perl" (list "-wc" local-file))))

(defun flymake-perl-load ()
  (interactive)
  (set-perl5lib)
  (defadvice flymake-post-syntax-check (before flymake-force-check-was-interrupted)
    (setq flymake-check-was-interrupted t))
  (ad-activate 'flymake-post-syntax-check)
  (setq flymake-allowed-file-name-masks (append flymake-allowed-file-name-masks flymake-allowed-perl-file-name-masks))
  (setq flymake-err-line-patterns flymake-perl-err-line-patterns)
  (flymake-mode t))

(add-hook 'cperl-mode-hook '(lambda () (flymake-perl-load)))

perl-tidy

(defun perltidy-region ()
  "Run perltidy on the current region."
  (interactive)
  (save-excursion
    (shell-command-on-region (point) (mark) "perltidy -q" nil t)))

まとめ

...

まとめ

...

まとめ

...

まとめ

ありがとうございました。