File: cperl-mode.el.html

You can either fine-tune the bells and whistles of this mode or bulk enable them by putting this in your Init file:

    (setq cperl-hairy t)

DO NOT FORGET to read micro-docs (available from Perl menu) <<<<<<
or as help on variables cperl-tips, cperl-praise, <<<<<<
cperl-speed. <<<<<<

Or search for "Short extra-docs" further down in this file for details on how to use cperl-mode instead of perl-mode and lots of other details.

The mode information (on C-h m) provides some customization help.

Faces used: three faces for first-class and second-class keywords and control flow words, one for each: comments, string, labels, functions definitions and packages, arrays, hashes, and variable definitions.

This mode supports imenu. You can use imenu from the keyboard
(M-g i), but you might prefer binding it like this:

    (define-key global-map [M-S-down-mouse-3] #'imenu)

This version supports the syntax added by the MooseX::Declare CPAN module, as well as Perl 5.10 keywords.

Defined variables (136)

cperl--attribute-list-rxA regular expression for an attribute list.
cperl--basic-array-rxRegular expression for an array variable (without package).
cperl--basic-hash-rxRegular expression for a hash variable (without package).
cperl--basic-identifier-rxA regular expression for the name of a "basic" Perl variable.
cperl--basic-scalar-rxRegular expression for a scalar (without package).
cperl--basic-variable-rxRegular expression for a Perl variable (scalar, array or hash).
cperl--block-declaration-rxA regular expression to find a declaration for a named block.
cperl--class-for-imenu-rxA regular expression to collect package names for ‘imenu’.
cperl--eol-comment-rxRegular expression for a single end-of-line comment in Perl
cperl--extra-paired-delimitersFull list of paired delimiters for quote-like constructs.
cperl--false-label-rxA regular expression which is similar to a label, but might as
cperl--field-declaration-rxA regular expression to find a declaration for a field.
cperl--imenu-entries-rxA regular expression to collect stuff that goes into the ‘imenu’ index.
cperl--label-rxA regular expression for a Perl label.
cperl--normal-identifier-rxA regular expression for a Perl variable name with optional namespace.
cperl--package-for-imenu-rxA regular expression to collect package names for ‘imenu’.
cperl--package-rxA regular expression for package|class NAME VERSION in Perl.
cperl--pod-heading-rxA regular expression to detect a POD heading.
cperl--prototype-rxA regular expression for a subroutine prototype. Not as strict
cperl--signature-rxA rx sequence subroutine signature without initializers.
cperl--single-attribute-rxA regular expression for a single attribute, without leading colon.
cperl--sloppy-signature-rxA rx sequence for the begin of a signature with initializers.
cperl--special-identifier-rxThe list of Perl "punctuation" variables, as listed in perlvar.
cperl--sub-name-for-imenu-rxA regular expression to detect a subroutine or method start.
cperl--sub-name-generated-rxA regular expression to capture autogenerated reader methods.
cperl--variable-list-rxRegular expression for a list of Perl variables for declarations.
cperl--version-regexpA sequence for recommended version number schemes in Perl.
cperl--ws*-rxRegular expression for optional whitespaces or comments in Perl
cperl--ws+-rxRegular expression for a sequence of whitespace and comments in Perl.
cperl--ws-or-comment-rxA regular expression for either whitespace or comment
cperl--ws-rxRegular expression for a single whitespace in Perl.
cperl-auto-newlineNon-nil means automatically newline before and after braces,
cperl-auto-newline-after-colonNon-nil means automatically newline even after colons.
cperl-autoindent-on-semiNon-nil means automatically indent after insertion of (semi)colon.
cperl-bad-style-regexpFinds places such that insertion of a whitespace may help a lot.
cperl-brace-imaginary-offsetImagined indentation of a Perl open brace that actually follows a statement.
cperl-brace-offsetExtra indentation for braces, compared with other text in same context.
cperl-break-one-line-blocks-when-indentNon-nil means that one-line if/unless/while/until/for/foreach BLOCKs
cperl-clobber-lisp-bindingsNot-nil (and non-null) means not overwrite C-h f.
cperl-close-paren-offsetExtra indent for substatements that start with close-parenthesis.
cperl-comment-columnColumn to put comments in CPerl (use M-x cperl-indent to lineup with code).
cperl-compilation-error-regexp-listList that specifies how to match errors in Perl output.
cperl-continued-brace-offsetExtra indent for substatements that start with open-braces.
cperl-continued-statement-offsetExtra indent for lines not starting new statements.
cperl-del-back-chCharacter generated by key bound to ‘delete-backward-char’.
cperl-do-not-fontifyText property which inhibits refontification.
cperl-doc-bufferWhere the documentation can be found.
cperl-electric-backspace-untabifyNot-nil means electric-backspace will untabify in CPerl.
cperl-electric-keywordsNot-nil (and non-null) means keywords are electric in CPerl.
cperl-electric-lbrace-spaceNon-nil (and non-null) means { after $ should be preceded by ‘ ’.
cperl-electric-linefeedIf true, LFD should be hairy in CPerl, otherwise C-c LFD is hairy.
cperl-electric-parensNon-nil (and non-null) means parentheses should be electric in CPerl.
cperl-electric-parens-markNot-nil means that electric parens look for active mark.
cperl-electric-parens-stringString of parentheses that should be electric in CPerl.
cperl-extra-newline-before-braceNon-nil means that if, elsif, while, until, else, for, foreach
cperl-extra-newline-before-brace-multilineNon-nil means the same as ‘cperl-extra-newline-before-brace’, but
cperl-extra-paired-delimiters-modeNon-nil if Cperl-Extra-Paired-Delimiters mode is enabled.
cperl-extra-paired-delimiters-mode-hookHook run after entering or leaving ‘cperl-extra-paired-delimiters-mode’.
cperl-file-styleIndentation style to use in ‘cperl-mode’.
cperl-fix-hanging-brace-when-indentNon-nil means that BLOCK-end ‘}’ may be put on a separate line
cperl-font-lockNon-nil (and non-null) means CPerl buffers will use ‘font-lock-mode’.
cperl-font-lock-keywordsAdditional expressions to highlight in Perl mode. Default set.
cperl-font-lock-keywords-1Additional expressions to highlight in Perl mode. Minimal set.
cperl-font-lock-keywords-2Additional expressions to highlight in Perl mode. Maximal set.
cperl-fontify-m-as-sNot-nil means highlight 1arg regular expressions operators same as 2arg.
cperl-fontify-trailerHow to fontify text after an "__END__" or "__DATA__" token.
cperl-hairyNot-nil means most of the bells and whistles are enabled in CPerl.
cperl-have-help-regexpMatches places in the buffer we can find help for.
cperl-help-shownNon-nil means that the help was already shown now.
cperl-here-doc-functionsList of keywords after which ‘$var <<bareword’ is a here-document.
cperl-here-faceFace for here-docs highlighting.
cperl-hierarchyGlobal hierarchy of classes.
cperl-highlight-variables-indiscriminatelyNon-nil means perform additional highlighting on variables.
cperl-hook-after-changeNot-nil means install hook to know which regions of buffer are changed.
cperl-indent-comment-at-column-0Non-nil means that comment started at column 0 should be indentable.
cperl-indent-left-aligned-commentsNon-nil means that the comment starting in leftmost column should indent.
cperl-indent-levelIndentation of CPerl statements with respect to containing block.
cperl-indent-parens-as-blockNon-nil means that non-block ()-, {}- and []-groups are indented as blocks,
cperl-indent-region-fix-constructsAmount of space to insert between ‘}’ and ‘else’ or ‘elsif’.
cperl-indent-rules-alistAlist of indentation rules for CPerl mode.
cperl-indent-subs-speciallyIf non-nil, indent subs inside other blocks relative to "sub" keyword.
cperl-indent-wrt-braceNon-nil means indent statements in if/etc block relative brace, not if/etc.
cperl-info-on-command-no-promptNot-nil (and non-null) means not to prompt on M-x cperl-info-on-command.
cperl-info-pageName of the Info manual containing perl docs.
cperl-invalid-faceFace for highlighting trailing whitespace.
cperl-label-offsetOffset of CPerl label lines relative to usual indentation.
cperl-lazy-help-timeNot-nil (and non-null) means to show lazy help after given idle time.
cperl-lazy-installedNon-nil means that the lazy-help handlers are installed now.
cperl-lineup-step‘cperl-lineup’ will always lineup at multiple of this number.
cperl-max-help-sizeNon-nil means shrink-wrapping of info-buffer allowed up to these percents.
cperl-maybe-white-and-comment-rexRegular expression to match optional whitespace with interspersed comments.
cperl-menuMenu for CPerl mode.
cperl-merge-trailing-elseNon-nil means that BLOCK-end ‘}’ followed by else/elsif/continue
cperl-message-electric-keywordNon-nil means that the ‘cperl-electric-keyword’ prints a help message.
cperl-min-label-indentMinimal offset of CPerl label lines.
cperl-mode-abbrev-tableAbbrev table in use in CPerl mode buffers.
cperl-mode-electric-keywords-abbrev-tableAbbrev table for electric keywords. Controlled by ‘cperl-electric-keywords’.
cperl-mode-hookHook run by CPerl mode.
cperl-mode-mapKeymap used in CPerl mode.
cperl-mode-syntax-tableSyntax table in use in CPerl mode buffers.
cperl-noscan-files-regexpRegexp to match files/dirs to skip when generating TAGS.
cperl-not-bad-style-regexpIf matches at the start of match found by ‘my-bad-c-style-regexp’,
cperl-outline-regexpThe regular expression used for ‘outline-minor-mode’.
cperl-pod-faceFace for POD highlighting.
cperl-pod-head-faceFace for POD highlighting.
cperl-pod-here-fontifyNot-nil after evaluation means to highlight POD and here-docs sections.
cperl-pod-here-scanNot-nil means look for POD and here-docs sections during startup.
cperl-pod2man-programFile name for ‘pod2man’.
cperl-praiseAdvantages of CPerl mode.
cperl-problemsDescription of problems in CPerl mode.
cperl-problems-old-emaxenThis used to contain a description of problems in CPerl mode
cperl-ps-print-face-propertiesList given as an argument to ‘ps-extend-face-list’ in ‘cperl-ps-print’.
cperl-regexp-indent-stepIndentation used when beautifying regexps.
cperl-regexp-scanNot-nil means make marking of regular expression more thorough.
cperl-scan-files-regexpRegexp to match files to scan when generating TAGS.
cperl-short-docs# based on '@(#)@ perl-descr.el 1.9 - describe-perl-symbol' [Perl 5]
cperl-shrink-wrap-info-frameNon-nil means shrink-wrapping of info-buffer-frame allowed.
cperl-speedThis is an incomplete compendium of what is available in other parts
cperl-string-syntax-tableSyntax table in use in CPerl mode string-like chunks.
cperl-style-alistList of variables to set to get a particular indentation style.
cperl-style-examplesExamples of if/else with different indent styles (with v4.23).
cperl-syntaxify-by-font-lockNon-nil means that CPerl uses the ‘font-lock’ routines for syntaxification.
cperl-syntaxify-for-menuNon-nil means that CPerl syntaxifies up to the point before showing menu.
cperl-syntaxify-unwindNon-nil means that CPerl unwinds to a start of a long construction
cperl-tab-always-indentNon-nil means TAB in CPerl mode should always reindent the current line,
cperl-tags-file-nameTAGS file name to use in ‘cperl-write-tags’.
cperl-tipsIf your Emacs does not default to ‘cperl-mode’ on Perl files, and you
cperl-tips-facesCPerl mode uses the following faces for highlighting:
cperl-under-as-charNon-nil means that the _ (underline) should be treated as word char.
cperl-use-syntax-table-text-propertyNon-nil means CPerl sets up and uses ‘syntax-table’ text property.
cperl-use-syntax-table-text-property-for-tagsNon-nil means: set up and use ‘syntax-table’ text property generating TAGS.
cperl-vc-rcs-headerSpecial version of ‘vc-rcs-header’ that is used in CPerl mode buffers.
cperl-vc-sccs-headerSpecial version of ‘vc-sccs-header’ that is used in CPerl mode buffers.
cperl-versionVersion of IZ-supported CPerl package this file is based on.
cperl-white-and-comment-rexRegular expression to match whitespace with interspersed comments.
pod2man-programFile name for ‘pod2man’.

Defined functions (135)

cperl--format-prompt(PROMPT DEFAULT &rest FORMAT-ARGS)
cperl--time-convert(TIME FORM)
cperl-1+(P)
cperl-1-(P)
cperl-add-tags-recurse()
cperl-add-tags-recurse-noxs()
cperl-add-tags-recurse-noxs-fullpath()
cperl-after-block-and-statement-beg(LIM)
cperl-after-block-p(LIM &optional PRE-BLOCK)
cperl-after-change-function(BEG END OLD-LEN)
cperl-after-expr-p(&optional LIM CHARS TEST)
cperl-after-sub-regexp(NAMED ATTR)
cperl-at-end-of-expr(&optional LIM)
cperl-backward-to-noncomment(LIM)
cperl-backward-to-start-of-continued-exp(LIM)
cperl-backward-to-start-of-expr(&optional LIM)
cperl-beautify-level(&optional DEEP)
cperl-beautify-regexp(&optional DEEP)
cperl-beautify-regexp-piece(B E EMBED LEVEL)
cperl-beginning-of-property(P PROP &optional LIM)
cperl-block-declaration-p()
cperl-block-p()
cperl-build-manpage()
cperl-cached-syntax-table(ST)
cperl-calculate-indent(&optional PARSE-DATA)
cperl-calculate-indent-within-comment()
cperl-char-ends-sub-keyword-p(CHAR)
cperl-choose-color(&rest LIST)
cperl-comment-region(B E ARG)
cperl-commentify(BEGIN END STRING)
cperl-contract-level()
cperl-contract-levels()
cperl-declaration-header-p(POS)
cperl-delay-update-hook(BEG END OLD-LEN)
cperl-describe-perl-symbol(VAL)
cperl-electric-backspace(ARG)
cperl-electric-brace(ARG &optional ONLY-BEFORE)
cperl-electric-else()
cperl-electric-keyword()
cperl-electric-lbrace(ARG &optional END)
cperl-electric-paren(ARG)
cperl-electric-pod()
cperl-electric-rparen(ARG)
cperl-electric-semi(ARG)
cperl-electric-terminator(ARG)
cperl-emulate-lazy-lock(&optional WINDOW-SIZE)
cperl-ensure-newlines(N &optional POS)
cperl-etags(&optional ADD ALL FILES)
cperl-extra-paired-delimiters-mode(&optional ARG)
cperl-facemenu-add-face-function(FACE END)
cperl-file-style(STYLE)
cperl-fill-paragraph(&optional JUSTIFY ITERATION)
cperl-find-bad-style()
cperl-find-pods-heres(&optional MIN MAX NON-INTER END IGNORE-MAX END-OF-HERE-DOC)
cperl-find-pods-heres-region(MIN MAX)
cperl-find-sub-attrs(&optional ST-L B-FNAME E-FNAME POS)
cperl-find-tags(IFILE XS TOPDIR)
cperl-fix-line-spacing(&optional END PARSE-DATA)
cperl-font-lock-fontify-region-function(BEG END LOUDLY)
cperl-font-lock-syntactic-face-function(STATE)
cperl-font-lock-unfontify-region-function(BEG END)
cperl-fontify-syntactically(END)
cperl-fontify-update(END)
cperl-fontify-update-bad(END)
cperl-forward-group-in-re(&optional ST-L)
cperl-forward-re(LIM END IS-2ARG ST-L ERR-L ARGUMENT &optional OSTART OEND)
cperl-forward-to-end-of-expr(&optional LIM)
cperl-get-help()
cperl-get-here-doc-region(&optional POS POD)
cperl-get-state(&optional PARSE-START START-STATE)
cperl-here-doc-spell()
cperl-highlight-charclass(ENDBRACKET DASHFACE BSFACE ONEC-SPACE)
cperl-imenu--create-perl-index()
cperl-imenu-name-and-position()
cperl-indent-command(&optional WHOLE-EXP)
cperl-indent-exp()
cperl-indent-for-comment()
cperl-indent-line(&optional PARSE-DATA)
cperl-indent-region(START END)
cperl-info-buffer(TYPE)
cperl-info-on-command(COMMAND)
cperl-invert-if-unless()
cperl-invert-if-unless-modifiers()
cperl-is-here-doc-p(START)
cperl-lazy-install()
cperl-lazy-unstall()
cperl-linefeed()
cperl-lineup(BEG END &optional STEP MINSHIFT)
cperl-list-fold(LIST NAME LIMIT)
cperl-look-at-leading-count(IS-X-REX E)
cperl-make-indent(COLUMN &optional MINIMUM KEEP)
cperl-map-pods-heres(FUNC &optional PROP S END)
cperl-menu(ARG1)
cperl-menu-to-keymap(MENU)
cperl-mode()
cperl-modify-syntax-type(AT HOW)
cperl-narrow-to-here-doc(&optional POS)
cperl-next-interpolated-REx(&optional SKIP BEG LIMIT)
cperl-next-interpolated-REx-0()
cperl-next-interpolated-REx-1()
cperl-perldoc(WORD)
cperl-perldoc-at-point()
cperl-pod-spell(&optional DO-HERES)
cperl-pod-to-manpage()
cperl-pod2man-build-command()
cperl-postpone-fontification(B E TYPE VAL &optional NOW)
cperl-process-here-doc(MIN MAX END OVERSHOOT STOP-POINT END-OF-HERE-DOC ERR-L INDENTED-HERE-DOC-P MATCHED-POS TODO-POS DELIM-BEGIN DELIM-END)
cperl-protect-defun-start(S E)
cperl-ps-print(&optional FILE)
cperl-ps-print-init()
cperl-put-do-not-fontify(FROM TO &optional POST)
cperl-putback-char(C)
cperl-regext-to-level-start()
cperl-select-this-pod-or-here-doc(&optional POS)
cperl-set-style(STYLE)
cperl-set-style-back()
cperl-sniff-for-indent(&optional PARSE-DATA)
cperl-switch-to-doc-buffer(&optional INTERACTIVE)
cperl-tags-hier-init(&optional UPDATE)
cperl-tags-treeify(TO LEVEL)
cperl-time-fontification(&optional L STEP LIM)
cperl-to-comment-or-eol()
cperl-toggle-abbrev()
cperl-toggle-auto-newline()
cperl-toggle-autohelp()
cperl-toggle-construct-fix()
cperl-toggle-electric()
cperl-toggle-set-debug-unwind(ARG &optional BACKTRACE)
cperl-uncomment-region(B E ARG)
cperl-unwind-to-safe(BEFORE &optional END)
cperl-update-syntaxification(TO)
cperl-val(SYMBOL &optional DEFAULT HAIRY)
cperl-windowed-init()
cperl-word-at-point(&optional P)
cperl-write-tags(&optional FILE ERASE RECURSE DIR INBUFFER NOXS TOPDIR)

Defined faces (4)

cperl-array-faceFont Lock mode face used to highlight array names.
cperl-hash-faceFont Lock mode face used to highlight hash names.
cperl-method-callFont Lock mode face for method calls. Usually, method calls are not fontified. We use this face to prevent calls to methods which look like builtin functions to be fontified like, well, builtin functions (which they are not). Inherits from ‘default’.
cperl-nonoverridable-faceFont Lock mode face used non-overridable keywords and modifiers of regexps.