Next: , Previous: pde-load, Up: Top

4 Integrate other libraries

pde.el try to integrate other libraies to cperl-mode.

First it rearrange key bindings. Some cperl-mode default key bindings are remap to pde-cperl-map, so more key bindings can be add to cperl-mode-map.

— User Option: pde-cperl-prefix

Prefix key for cperl commands. Default is C-c C-c.

— Variable: pde-cperl-map

Keymap for cperl commands

cperl-toggle-electric - Toggle the state of parentheses doubling in CPerl mode.
cperl-linefeed - Go to end of line, open a new line and indent appropriately.
cperl-narrow-to-here-doc - Narrows editing region to the HERE-DOC at pos.
cperl-pod-spell - Spell-check POD documentation.
cperl-invert-if-unless - Change `if (A) {B}' into `B if A;' etc (or visa versa) if possible.
cperl-next-interpolated-REx - Move point to next REx which has interpolated parts.
cperl-next-interpolated-REx-0 - Move point to next REx which has interpolated parts without //o.
cperl-next-interpolated-REx-1 - Move point to next REx which has interpolated parts without //o.
— User Option: pde-view-prefix

Prefix key for view commands. Default is C-c C-v

— Variable: pde-view-map

Keymap for view commands.

pde-imenu-tree - Display tree view of imenu.
pde-pod-to-manpage - View pod in current buffer using woman.
pde-perldoc-tree - Display pod tree.
— User Option: pde-perltidy-prefix

Prefix key for perltidy commands. Default is C-c C-t.

— Variable: pde-perltidy-map

Keymap for perltidy commands.

perltidy-buffer - Call perltidy for whole buffer.
perltidy-region - Tidy perl code in the region.
perltidy-subroutine - Call perltidy for subroutine at point.
perltidy-dwim - Perltidy Do What I Mean. If with prefix argument, just show the result of perltidy. You can use C-x C-s to save the tidy result. If region is active call perltidy on the region. If inside subroutine, call perltidy on the subroutine, otherwise call perltidy for whole buffer.
— User Option: pde-inf-perl-prefix

Prefix key for inf-perl commands. Default is C-c C-e.

— Variable: pde-inf-perl-map

Keymap for inf-perl commands.

inf-perl-send - If mark active, send region, otherwise send current line
inf-perl-send-line - Send current line to the perl process.
inf-perl-load-file - Send whole buffer to process
inf-perl-send-region - Send region to process.
inf-perl-set-cwd - Set working directory of interpreter to current default-directory
inf-perl-send-region-and-go - Send region and switch to process buffer
inf-perl-switch-to-perl - Switch to perl process buffer.
inf-perl-switch-to-end-perl - Switch to end of perl process buffer.

tabbar-mode can make a tabbar for all buffers. I prefer using ido-mode to switch between buffers. But here I want add a tabbar for a few buffers to group them and make emacs looks like IDE. So that why tabbar-x. See tabbar-x.

— Function: pde-tabbar-register

Add tabbar and register current buffer to group Perl.

ffap is a good command. To use it in cperl-mode to find perl module, need some hack.

— Function: pde-ffap-locate

Return cperl module for ffap.

indent-region need to mark a region. Not very convenient. So I write a dwim command.

— Function: pde-indent-dwim

Indent the region between paren. If region selected, indent the region. If character before is a parenthesis(such as "]})>"), indent the region between the parentheses. Useful when you finish a subroutine or a block. Otherwise indent current subroutine. Selected by beginning-of-defun and end-of-defun.

Settings after cperl-mode is loaded or only for buffer that major-mode is cperl-mode are defined in pde-perl-mode-hook

— Function: pde-perl-mode-hook

Hooks to run when enter cperl-mode. It define a new style “PDE”, turn on display information of function on echo area, turn abbrev-mode on, activate perldoc, auto chmod when save perl script but not module or pod, and bind keys.

This key bindings are added:

C-c C-f
flymake-mode - Minor mode to do on-the-fly syntax checking.
C-c C-d
perldb-ui - Debugger with perldb-ui.
C-c C-k
perlcritic - Call perlcritic with current file
C-c C-z
run-perl - Start or switch to interactive perl shell.

The old C-c C-h commands are removed, and make describe-prefix-bindings work. If you realy need them, define them in pde-cperl-map.