find matching paren for emacs lisp code
;; function to Match Parens
(defun find-matching-paren ()
"Locate the matching parenthtical" (interactive)
(cond ((looking-at "[[({]") (forward-sexp 1) (backward-char 1))
((looking-at "[])}]") (forward-char 1) (backward-sexp 1))
(t (ding))
)
)
;; set C-b find matching bracket
(global-set-key "\C-o" (quote find-matching-paren))
Posted by jamespo at April 24, 2003 03:21 PM