Perl Development Environment

Table of Contents


Next: , Previous: (dir), Up: (dir)

PDE

This is manual for PDE version 0.01

© 2004, 2005, 2006, 2007 Free Software Foundation, Inc.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License".

Indices


Next: , Previous: Top, Up: Top

1 A introduction to PDE

PDE is a collection of emacs lisp extensions to facilitate perl programming. cperl-mode has provided a excellent environment for coding, here PDE provides other common tools, such as creating file using template, smart compiling, perldoc, perltidy, debugger, tags tree view and so on. PDE also provides an easy configuration for perl programing, and a tutorial for novice to start using emacs.

This manual tries to describe the feature of each emacs lisp file provided and to be the guide for those who want to use them.


Next: , Previous: Introduction, Up: Top

2 Installation

Installing PDE is quit easy. When you download the archive of the PDE distribution, uncompress the archive to a folder, for example, ~/elisp/pde, then put this to your ~/.emacs:

     (add-to-list 'load-path "~/elisp/pde/lisp")
     (load "pde-load")

That is all what you need to do for a typical installation.

You can also use perl style installation:

     ./Build.PL
     ./Build test
     ./Build
     ./Build install

Note that test before build, so perl can test whether have emacs in PATH. The default place to install lisp files is “$ENV{HOME}/.emacs.d/pde”. You can use option —elispdir tell perl where to put the lisp files. Note that using this way to install, you should put ~/elisp/pde to load-path. So you should add following to .emacs:

     (add-to-list 'load-path "~/elisp/pde")
     (load "pde-load")


Next: , Previous: Installation, Up: Top

3 Default configuration for PDE

pde-load.el try to provide a default configuration for all extension included in PDE. The configuration can be sorted by PDE core features and some recommend personal setting. To disable addtional features if you don't like, you can set pde-extra-setting to nil.

— User Option: pde-extra-setting

When set to nil, don't load something you don't like

The minimal enable features after load `pde-load' are:

The extra feature including:

The configuration is optimized so that most libraries are loaded when needed.


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

C-e
cperl-toggle-electric - Toggle the state of parentheses doubling in CPerl mode.
C-j
cperl-linefeed - Go to end of line, open a new line and indent appropriately.
C-n
cperl-narrow-to-here-doc - Narrows editing region to the HERE-DOC at pos.
C-p
cperl-pod-spell - Spell-check POD documentation.
C-t
cperl-invert-if-unless - Change `if (A) {B}' into `B if A;' etc (or visa versa) if possible.
C-v
cperl-next-interpolated-REx - Move point to next REx which has interpolated parts.
C-x
cperl-next-interpolated-REx-0 - Move point to next REx which has interpolated parts without //o.
C-y
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.

C-i
pde-imenu-tree - Display tree view of imenu.
C-m
pde-pod-to-manpage - View pod in current buffer using woman.
C-p
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.

C-b
perltidy-buffer - Call perltidy for whole buffer.
C-r
perltidy-region - Tidy perl code in the region.
C-s
perltidy-subroutine - Call perltidy for subroutine at point.
C-t
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.

C-e
inf-perl-send - If mark active, send region, otherwise send current line
C-j
inf-perl-send-line - Send current line to the perl process.
C-l
inf-perl-load-file - Send whole buffer to process
C-r
inf-perl-send-region - Send region to process.
C-s
inf-perl-set-cwd - Set working directory of interpreter to current default-directory
M-r
inf-perl-send-region-and-go - Send region and switch to process buffer
C-y
inf-perl-switch-to-perl - Switch to perl process buffer.
C-z
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.


Next: , Previous: pde, Up: Top

5 Global variables shared

pde-vars.el defined some global constant variables. Library related to perl can require it without load other PDE libaries, and user can define one variable for all libaries that use it.


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

6 Projects in perl

pde-project.el provide several functions relate to project in perl.

— Function: pde-detect-project-root

Detech root directory of current file. The root directory is that has Makefile.PL or Build.PL or @INC.

— User Option: pde-project-mark-files

The directory contain one of these file will consider as project root. Default is (“Makefile.PL” “Build.PL”)

— Function: pde-set-project-root

set project root to local variable pde-project-root.

— Function: pde-file-package

Derive the package name of current buffer. The buffer should be a pm file.

— Function: pde-directory-all-files dir &optional full match predicate limit

Recursive read file name in DIR. Like `directory-files', this function can return a list of files in the directory and the subdirectories, but often there are too many files in the directory, so need a parament to limit the number of files to search and a flag to indicate whether all files are read. So instead of return a list of files, this function return a cons cell which car indicate whether all files read and cdr part is the real file list.

if FULL is non-nil, return absolute file names, if match is non-nil, mention only file names match the regexp MATCH. If PREDICATE is non-nil and is a function with one argument, the file name relative to DIR, mention only file when PREDICATE function return non-nil value. If LIMIT is non-nil, when the files execeed the number will stop. The function is search in wide-first manner.

— Command: pde-project-find-file

Find file in the project. This command is will read all file in current project recursively. With prefix argument, to rebuild the cache. I suggest bind this command to C-x C-p, which original command is mark-page seldom used by me.

— User Option: pde-file-list-regexp

Filenames matching this regexp will not be read when `pde-project-find-file'.

— User Option: pde-file-list-predicate-function

Predicate function to filter file to be read when `pde-project-find-file'

— User Option: pde-file-list-limit

Maximum number of files for read from project directory recursively.


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

7 Abbrev for perl

pde-abbv.el contains a few abbrevs that I think helpful. You can send me your abbrev if you think it is handy. I appreciate for that.


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

8 Misc commands

pde-util provides several commands that might be useful.

— User Option: pde-module-location

The commands above call perl module PDE::Util to generate the module lists. If the module can found in @INC or pde-load-path parent directory, set this variable to let perl found the module.

— Command: pde-list-module-shadows

Display a list of modules that shadow other modules.

— Command: pde-list-core-modules

Display a list of core modules. Push the text button to show Pod.

— Command: pde-search-cpan

Search module or other things in search.cpan.org.


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

9 New file with template

template.el is exists, why template-simple? First of all, it is simple, the there is only one core function template-compile.

— Function: template-compile

Parse current buffer to parsed template.

The parsed template contains a list of strings, symbols or lisp forms. The strings is inserted directly. The symbol can be a predefined value in template-default-alist, or can be translate by template-expand-function. The lisp forms is handled by template-expand-function.

— User Option: template-expand-function

Functions to expand parsed template. There are two candicate functions available in template-simple: template-skeleton-expand and template-tempo-expand. Default function is template-tempo-expand, because I think tempo provide more fetures and flexibility than skeleton.

— Function: define-template-expander name alist &rest body

Define a new type of template-expand-function. NAME is used to create a function template-<NAME>-expand. ALIST can be a symbol or a form to return a list of symbol table add to template-default-alist. BODY is the code to expand and insert the template. the value of variable TEMPLATE is the translated template. The element of parsed template is translated by template-expansion

— Function: template-simple-expand-template file

Expand template in file. Parse the template to parsed templates with template-compile. Use template-expand-function to expand the parsed template.

— Function: template-simple-expand template

Expand string template. template can be a string or a parsed template. If it is string, parse the template to parsed templates with template-compile. Use template-expand-function to expand the parsed template.

template-simple is designed to compatible to template.el, so the default open and close parentheses is “(>>>” and “<<<)”. Note that global value of template-expand-function is saved in template-simple-expand. The same case happened to template-parens in template-compile. So If you need change them temporary for certain template, you can set template-parens and template-expand-function like file variable, for example:

   (template-simple-expand
    ";; -*- template-parens: (\"{\" . \"}\"); template-expand-function: template-tempo-expand -*-
     (defun {p} ({p})
       \"{p}\"
       {p}
       )")

This will expand by template-tempo-expand but not default expand function. Luckily in most case, template of tempo and skeleton can be the same, so you don't have to set template-expand-function. If your template uses element that only exists in tempo or skeleton, you'd better set it in template to make sure the template-simple-expand select the correct one.

The major purpose of template-simple is used for fill empty file using predefined template.

— User Option: template-directory-list

A list of directories for lookup template files. Default is “~/.templates/” and auto-insert-directory.

— Function: template-derive-template

Find proper template for current file. The template file is a file with name “TEMPLATE” and the same extension of current file under template-directory. You can add a suffix “.tpl” to the template file name too, just for compatible with templates provide by template.el. If the file didn't have extension, the template file's extension is current file name, for example, “TEMPLATE.Makefile” is template file for “Makefile”.

— User Option: template-default-alist

Predefined symbol for template file. Symbols to lookup in this table is case insensitive.

Here is a list of predefined symbol:

A neat function provided by template.el is the file name in the header can automatic update when the file is renamed. template-simple also provide this feature.

— Function: template-simple-update-header

update file header when needed. The file header is a line match template-header-regexp at first 3 lines in current file.

A typical file header is like:

   ;;; file-name --- short description

or

   /* @(#)file-name   short description
    */


Next: , Previous: template-simple, Up: Top

10 Tabbar for particular buffers

Sometimes, make tabbar for particular buffers maybe cool. For example, I add tabbar for only perl related buffers, *Perldoc*, *PDE Imenu*, and I am planning to group perldb-ui buffers as the same way. tabbar-x exists for this purpose.

— Function: tabbar-x-register buffer group

Register the buffer to the one group.


Next: , Previous: tabbar-x, Up: Top

11 Additional elements for tempo

tempo.el is a extensible library for abbrevs. It provide more features than skeleton.el, such as move between marks, names for prompt, user elements and so on. tempo-x.el provides some commands and additional elements that may helpful.

— Command: tempo-x-space

A simple command to enable expand tempo like abbrev. The command tempo-space given by the author of tempo.el is not compatiable for abbrev-mode.

— Command: tempo-x-rebuild

Reinstall new tempo template for all buffer. If you defined a new tempo-template in certain tag-list, you can't use it intermediately. Call the commands to force build connections for all buffer again.

— Function: tempo-x-test-template

A macro to test tempo template before define it.

Here is a list of new elements:


Next: , Previous: tempo-x, Up: Top

12 Regexp building and testing tool

If you have not use re-builder, please try it. The tool is quite simple and useful, you just input regexp in the *RE-Builder* buffer, the matched part in the buffer where the command is called will be highlighted.

re-builder-x.el extend the regexp syntax to perl or any other languages. To enable perl regexp syntax, you have to change the syntax to perl first. The command is reb-change-syntax, which is bound to C-c TAB.

In consideration of efficiency, if you make some changes in the buffer, the regexp will not apply in the new text unless you send current buffer to perl process again. You can do that by using command reb-perl-send-buffer which bound to C-c C-a.

All commands for re-builder are available for perl syntax.


Next: , Previous: re-builder-x, Up: Top

13 Smart compile commands

cperl-mode recommend using mode-compile, but I don't like mode-compile. Instead, smart-compile+.el does a good job. But I found it is not easy to customize smart-compile+, because the user variables are separated for a language. So I rewrite it to compile-dwim(again, I like dwim).

— User Option: compile-dwim-alist

Settings for certain file type. A list like which has form (TYPE CONDITION COMPILE-COMMAND RUN-COMMAND EXE-FILE).

TYPE is the language type to distinguish from others.

CONDITION is a list of predicates constituted by operator “or”. The predicates can be (name . REGEXP) or (mode . MAJOR-MODE) to test the file name match REGEXP or major-mode eq MAJOR-MODE.

In COMPILE-COMMAND and RUN-COMMAND, these format specifications are available:

     
       %i  interpreter name
       %F  absolute pathname
       %f  file name without directory
       %n  file name without extention
       %e  extention of file name

The interpreter is the program in the shebang line. If the program is valid(test with `executable-find'), then use this program, otherwise, use interpreter in `interpreter-mode-alist' according to the major mode.

EXE-FILE control whether should run compile command before actual run or should recompile again because EXE-FILE is older than source file. Usually, script language don't need to set EXE-FILE.

— User Option: compile-dwim-check-tools

Whether checking makefile or ant or else. Default is turn on. You can also change the value locally by make-local-variable in mode-hook for certain files.


Next: , Previous: compile-dwim, Up: Top

14 Find documents using help-dwim

A big obstacle for novice to used to emacs is that there are so many keys to remember. I like dwim commands. help-dwim.el provide a single command as interface for several kinds of document commands, such as describe-function, describe-variable, woman. And you can add more if you follow the rules.

A type of help-dwim commands should provide:

— Function: help-dwim-register type activate &optional body

Register a new type of help command. An new type has a form (TYPE . [FINDER OBARRAY PREDICATE HANDLER]). If ACTIVATE is non-nil, the type will add to help-dwim-active-type, and BODY will eval intermediately. BODY is the code to eval when the type is activated. If the type is register without activated, the BODY will add to help-dwim-autoloads. When you use help-dwim-active-type or help-dwim-customize-type add the type, the code will also eval then.

— Command: help-dwim-customize-type

Customize which type of help command should activate.

— Function: help-dwim-active-type type &optional append

Active a type for current buffer *ONLY*. The TYPE will gain a highest prority unless APPEND is non-nil.


Next: , Previous: help-dwim, Up: Top

15 Run perldoc using woman

I like “woman”(that is WithOut MAN). perldoc.el make it possible to view perl document without man. To use it with help-dwim, a list of modules is build automatic using a perl script perldoc-cache.pl. The cache can be update automaticly. It is configured in pde-load. See pde-load.

— Function: perldoc-recache-everyday &optional days

If the cache file is expired DAYS, force caches update.

With the perldoc-obarray, a lot of things can be done. perldoc-tree use this obarray to build a tree view.

— Function: perldoc-read-module prompt &optional require-match init

Read a perl module name. When a module name at point, the module become the default input. Don't add ": " in PROMPT.

— Command: perldoc-find-module &optional module other-window

Find the file of perl module. With prefix argument open the file in other window.

— Command: perldoc-find-module-ap &optional other-window

Find the module under point without prompt. With prefix argument open the file in other window.

— Command: perldoc-find-module-other-window

Find the module under point in other window without prompt.


Next: , Previous: perldoc, Up: Top

16 Find document in perlapi

This is orignal a demo for help-dwim. Useful if you are writing XS.

— User Option: perlapi-src-directory

Directory where the Perl source files can be found. If setted, the definition of the symbol can be found when put the button in the document.


Next: , Previous: perlapi, Up: Top

17 Window configuration to list

Emacs can save window configuration when it is running. The configuration can be persisted between different sessions. windata provide a way to save window configuration.

— Function: windata-current-winconf

Convert window configurate to a list. The CAR part of the list describe how to restore the window, the CDR part of the list determine which window is selected.

— Function: windata-restore-winconf &optional inside-p

Restore window configuration from `windata-current-winconf'. When INSIDE-P is non-nil, that mean the window configuration is restore in current window, that is to say don't delete other windows before restore the configuration.

— User Option: windata-data-function

A function to extract data for future restore window. Default is save the window buffer name. Accept one parameter, the window, and should return a lisp object that has print syntax.

— User Option: windata-data-restore-function

A function to restore window buffer from saved data. Default is set window buffer to the buffer with saved name. Accept two parameters, the window and a saved lisp object by windata-data-function.

— Command: windata-name-winconf name

Save window configuration with NAME.

— Command: windata-restore-named-winconf name

Restore saved window configuration by NAME.

— Function: windata-display-buffer buf frame-p dir size &optional delete-p

Display buffer more precisely. FRAME-P is non-nil and not window, the displayed buffer affect the whole frame, that is to say, if DIR is right or left, the displayed buffer will show on the right or left in the frame. If it is nil, the buf will share space with current window.

DIR can be one of member of (right left top bottom).

SIZE is the displayed windowed size in width(if DIR is left or right) or height(DIR is top or bottom). It can be a decimal which will stand for percentage of window(frame) width(heigth)

DELETE-P is non-nil, the other window will be deleted before display the BUF.

The behavior of windata-display-buffer is better show as following pictures:

     (setq buf (get-buffer "*Messages*"))
     (windata-display-buffer buf 'window 'top 0.3 nil)    ; 2
     (windata-display-buffer buf 'window 'bottom 0.3 nil) ; 3
     (windata-display-buffer buf 'window 'left 0.3 nil)   ; 4
     (windata-display-buffer buf 'window 'right 0.3 nil)  ; 5
     
     (windata-display-buffer buf 'frame 'top 0.3 nil)     ; 6
     (windata-display-buffer buf 'frame 'bottom 0.3 nil)  ; 7
     (windata-display-buffer buf 'frame 'left 0.3 nil)    ; 8
     (windata-display-buffer buf 'frame 'right 0.3 nil)   ; 9
     
     ;; when delete-p is presented, FRAME-P make no sense.
     (windata-display-buffer buf 'frame 'top 0.3 t)       ; 10
     (windata-display-buffer buf 'frame 'bottom 0.3 t)    ; 11
     (windata-display-buffer buf 'frame 'left 0.3 t)      ; 12
     (windata-display-buffer buf 'frame 'right 0.3 t)     ; 13
     (windata-display-buffer buf 'window 'top 0.3 t)      ; 10
     (windata-display-buffer buf 'window 'bottom 0.3 t)   ; 11
     (windata-display-buffer buf 'window 'left 0.3 t)     ; 12
     (windata-display-buffer buf 'window 'right 0.3 t)    ; 13
   +------+-------+    +------+-------+    +------+-------+
   |      |       |    |      | N     |    |      |       |
   |      | P     |    |      |-------+    |      | P     |
   |      |       |    |      | P     |    |      |       |
   |      |       |    |      |       |    |      +-------+
   |      |       |    |      |       |    |      | N     |
   +------+-------+    +------+-------+    +------+-------+
         (1)                 (2)                 (3)
   +------+--+----+    +------+----+--+    +--------------+
   |      |  |    |    |      |    |  |    |      N       |
   |      |N | P  |    |      | P  |N |    +------+-------+
   |      |  |    |    |      |    |  |    |      |       |
   |      |  |    |    |      |    |  |    |      | P     |
   |      |  |    |    |      |    |  |    |      |       |
   +------+--+----+    +------+----+--+    +------+-------+
        (4)                  (5)                 (6)
   +------+-------+    +---+-----+----+    +----+----+----+
   |      |       |    |   |     |    |    |    |    |    |
   |      | P     |    | N |     |    |    |    |    |    |
   |      |       |    |   |     | P  |    |    | P  | N  |
   +------+-------+    |   |     |    |    |    |    |    |
   |      N       |    |   |     |    |    |    |    |    |
   +--------------+    +---+-----+----+    +----+----+----+
        (7)                  (8)                 (9)
   +--------------+    +--------------+    +----+---------+
   |    N         |    |              |    |    |         |
   +--------------+    |     P        |    | N  | P       |
   |    P         |    |              |    |    |         |
   |              |    +--------------+    |    |         |
   |              |    |     N        |    |    |         |
   +--------------+    +--------------+    +----+---------+
        (10)                 (11)                (12)
   +----------+---+
   |          |   |
   |   P      | N |
   |          |   |
   |          |   |
   |          |   |
   +----------+---+
        (13)

The start window is as picture 1, the selected window is indicated by “P”, and new appear window indicated by “N”. The simplest sitiation is when DELETE-P is non-nil, after calling the function, there are only two window left. When FRAME-P is 'window or nil, the new window will only take the space from the selected window. When FRAME-P is non-nil except 'window, the original window still has the same configuration.


Next: , Previous: windata, Up: Top

18 More commands on tree-widget

tree-mode.el provide more commands to tree-widget.

n
tree-mode-next-node - Move to next node.
p
tree-mode-previous-node - Move to previous node
j
tree-mode-next-sib - Move to next sibling node.
k
tree-mode-previous-sib - Move to previous sibling node.
u
tree-mode-goto-parent - Move to parent node.
r
tree-mode-goto-root - Move to root node
g
tree-mode-reflesh - Reflesh parent tree. useful restore after sort or delete node
e
tree-mode-toggle-expand - Expand or contract tree at point. With prefix argument, expand the tree.
E
tree-mode-expand-level - Expand tree to LEVEL. With prefix argument 0 or negative, will expand all leaves of the tree.
s
tree-mode-sort-by-tag - Sort children node by tag.
/
tree-mode-keep-match - Keep node which tag match REGEXP
!
tree-mode-collapse-other-except - Collapse other trees. If the tree at point is contract, expand it.
D
tree-mode-delete-tree - Delete a tree from buffer.

The icon for push-button in tree-widget is limited 4 types: open, close, empty and leaf. tree-mode provide a method to settup icon of push-button by put an addition attribute :button-icon in tree-widget node.


Next: , Previous: tree-mode, Up: Top

19 Tree view for imenu

imenu provide an excellent code navigating method. imenu-tree.el make the tags visualized using tree-widget.

— User Option: imenu-tree-auto-update

If Non-nil, the imenu-tree will update automaticly. Also, if the imenu-tree is not visible in the window, it will automaticly scroll to make it visible.

— User Option: imenu-tree-update-interval

Seconds between update imenu tree.

— Command: imenu-tree-toggle-auto-update

Toggle imenu-tree auto update. With prefix argument, turn on auto update.

— User Option: imenu-tree-create-buffer-function

A function to group imenu-tree to various buffer. Default is nil, means using only one buffer.

— User Option: imenu-tree-name

The name for the root node. Default is the “mode-name: buffer-name”.

— User Option: imenu-tree-windata

Arguments to set the window buffer display. See windata-display-buffer for setup the arguments.


Next: , Previous: imenu-tree, Up: Top

20 Tree view of TAGS

tags-tree.el read TAGS file and display them using tree-widget.

— User Option: tags-tree-create-buffer-function

A function to group tags-tree to various buffer. Default is nil, means using only one buffer.

— User Option: tags-tree-group-file-function

A function to group files. Accept one parameter, a file list in TAGS file. Return a tree like:

     
        ("Root name"
         ("Group1"
          ("file1" . "full name of file1"))
         ("Group2"
          ("subgroup"
           ("file2" . "full name of file2"))))

Default is tags-tree-group-file-by-name, Which group all files according to file path.

— User Option: tags-tree-group-tags-function

A function to group tags. Accept one parameter, a list of tags info, return a tree like:

     
       ((("group1")
         (("subgroup1")
          ("tag1" . tag-info))
         ("tag2" . tag-info))
        (("group2")
         ("tag3" . tag-info)))

Default is tags-tree-group-tags which group by tags-tree-group-tags-expression which much like imenu-generic-expression.

The TAGS file can be update by extern file when in tags-tree.

G
tags-tree-update-file - update TAGS of current file under point or file of tag under point.
— User Option: tags-tree-tags-update-program

Program to update TAGS for a file. Default is myetags which is written using perl.


Next: , Previous: tags-tree, Up: Top

21 Calling perltidy

A collection of commands to call perltidy on buffer or region. See pde.


Next: , Previous: perltidy, Up: Top

22 Calling perlcritic

“perlcritic” is a Perl source code analyzer. See perldoc perlcritic for detail document of the program. perlcritic.el provide an interface to use “perlcritic” in Emacs. It invoke the program using compile, highlight severity and add hyperlink to the error.

— Command: perlcritic

Call perlcritic interactive. You can give your argments in the minibuffer. Default perform analyzing current visited file.

— Command: perlcritic-region

perlcritic is known run a little slow. You can use this command to analyze only a part of file.

perlcritic provide a lot of options in command line. perlcritic.el only support a few of options. Additional options can be input in the minibuffer or write your profile, default is .perlcriticrc.

— User Option: perlcritic-profile

Specify an alternate .perlcriticrc file. If value is nil, use -noprofile, If value is t, use the default profile .perlcriticrc, If non-nil, and the profile exists, use the profile.

— User Option: perlcritic-severity

Default severity level is 5 and perlcritic-severity value is nil.

— User Option: perlcritic-top

Report only the top N Policy violations in each file. If the -severity option is not explicitly given, the -top option implies that the minimum severity level is 1. Users can redefine the severity for any Policy in their .perlcriticrc file.

— User Option: perlcritic-include

Directs “perlcritic” to apply additional Policies that match the regex “/PATTERN/imx”.

— User Option: perlcritic-exclude

Directs “perlcritic” to not apply any Policy that matches the regex “/PATTERN/imx”.


Next: , Previous: perlcritic, Up: Top

23 Perl Debugger

perldb provide the minimal debugger interface in emacs. perldb-ui.el try to extend it more like gdb-ui. Not finished yet. But all interface will not change too much in future.

The main idea to communicate with perldb process is using .perldb to add a batch of subroutines to call in emacs. With those subroutines, it is easier to get information from the process.

— User Option: perldb-many-windows

If non-nil, display layout in `perldb-window-configuration'.

— User Option: perldb-use-separate-io-buffer

Non-nil means display output from the debugged program in a separate buffer.

— Command: perldb-many-windows

Toggle the number of windows in the basic arrangement. With arg, display additional buffers iff arg is positive.

— Command: perldb-restore-windows

Restore the basic arrangement of windows used by perldb-ui. This arrangement depends on the value of `perldb-many-windows'.

— Command: perldb-save-window-configuration

Save current window configuration as default. With prefix argument, just setup for current session.

perl5db provides a convenient command line interface. Most case, it is more quick using command than calling an emacs command. If you want control debugger in source buffer, maybe turn on perldb-gud-mode is a good choice.

n
gud-next - Step one line (skip functions).
SPC
gud-next - Step one line (skip functions).
s
gud-step - Step one source line with display.
u
gud-until - Continue to current line.
r
gud-return - Return from current subroutine.
c
gud-cont - Continue with display.
b
gud-break - Set breakpoint at current line.
d
gud-remove - Remove breakpoint at current line
p
gud-print - Evaluate perl expression at point.
x
gud-dump - Dumper data
l
gud-refresh - Fix up a possibly garbled display, and redraw the arrow.
q
perldb-gud-mode - quit perldb-gud-mode.

Know Bugs


Next: , Previous: perldb-ui, Up: Top

24 Interactive perl shell

An interactive shell is easier to prove some simple idea or check a piece of code. Also it is easier to debug or learn certain module without write, save, run.

Actually, a perl -de 1 is a good interactive shell. But I'd rather use a simple, but easier to customize and extend, shell.

— User Option: inf-perl-shell-program

The location of interactive shell program. Default is psh.pl. You can change it to “-de 1” if you want it be a debugger or gtksh.pl if you want develop with Gtk2-Perl.

— User Option: inf-perl-start-file

The code to load when start up.

— User Option: inf-perl-options

extra command line options.

— User Option: inf-perl-remove-my

lexcial variable can not live after eval. So when this option turn on, when send one line code to process, the my declaration at beginning of line will be removed. The variable(s) will become global.

For key bindings in cperl-mode, See pde.


Next: , Previous: inf-perl, Up: Top

Function Index


Next: , Previous: Function Index, Up: Top

Variable Index


Previous: Variable Index, Up: Top

Keybinding Index