help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

a bit help with elisp bit


From: Eli Segal
Subject: a bit help with elisp bit
Date: Mon, 23 Jan 2006 13:18:15 +0200

hey all, I found this really great tip, where the cursor on a paren, you press "%" and it goes to the matching one.
but I want to change it, that when my point is one place
after the closing bracket % will work
how do I change it ?
still trying to grasp this lisp thanx
------ the code --------------
(global-set-key "%" 'match-paren)
(defun match-paren (arg)
 "Go to the matching paren if on a paren; otherwise insert %."
 (interactive "p")
 (cond ((looking-at "\\s\(") (forward-list 1) (backward-char 1))
((looking-at "\\s\)") (forward-char 1) (backward-list 1))
(t (self-insert-command (or arg 1)))))





reply via email to

[Prev in Thread] Current Thread [Next in Thread]