Function: cperl-contract-level
cperl-contract-level is an interactive and byte-compiled function
defined in cperl-mode.el.gz.
Signature
(cperl-contract-level)
Documentation
Find an enclosing group in regexp and contract it.
(Experimental, may change semantics, recheck the result.)
We suppose that the regexp is scanned already.
Key Bindings
Source Code
;; Defined in /usr/src/emacs/lisp/progmodes/cperl-mode.el.gz
(defun cperl-contract-level ()
"Find an enclosing group in regexp and contract it.
\(Experimental, may change semantics, recheck the result.)
We suppose that the regexp is scanned already."
(interactive)
;; (save-excursion ; Can't, breaks `cperl-contract-levels'
(cperl-regext-to-level-start)
(let ((b (point)) (e (make-marker)) c)
(forward-sexp 1)
(set-marker e (1- (point)))
(goto-char b)
(while (re-search-forward "\\(#\\)\\|\n" e 'to-end)
(cond
((match-beginning 1) ; #-comment
(or c (setq c (current-indentation)))
(beginning-of-line 2) ; Skip
(cperl-make-indent c))
(t
(delete-char -1)
(just-one-space))))))