sourcecode
clemburg
<code>
(defun perl-outline-mode ()
"set customized outline minor mode for Perl"
(interactive)
(setq outline-regexp "sub")
(outline-minor-mode))
</code>
<p>
<b>Update</b>: This works even better:
<code>
(defun perl-outline-mode ()
"set customized outline minor mode for Perl"
(interactive)
(setq outline-regexp
"#!.\\|\\(pac\\)kage\\|sub\\|\\(=he\\)ad\\|\\(=po\\)d")
(outline-minor-mode))
</code>
Ever tried outline-mode in an emacs?
It works with Perl, too. Just put this code into your
.emacs, or execute it from buffer *scratch*. Then
do M-x perl-outline-mode after you opened
the Perl code file. You can then expand and
contract subroutines (with C-c @ C-t to contract all,
C-c @ C-a to expand all,
C-c @ C-d to contract a function, C-c @ C-s to expand it).
Miscellaneous
[clemburg]