Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!husc6!mit-eddie!YALE.ARPA!ram-ashwin From: ram-ashwin@YALE.ARPA (Ashwin Ram) Newsgroups: comp.emacs Subject: Paren balancing Message-ID: <8704220349.AA16270@yale-celray.arpa> Date: Tue, 21-Apr-87 22:49:58 EST Article-I.D.: yale-cel.8704220349.AA16270 Posted: Tue Apr 21 22:49:58 1987 Date-Received: Thu, 23-Apr-87 04:23:23 EST Sender: daemon@eddie.MIT.EDU Lines: 28 Here's a nice variation on the paren balancing feature. If the cursor is already sitting on a right paren, the cursor will just flash back to the matching open paren without inserting another paren, otherwise it'll insert a matching right paren and then flash back to the matching open paren. This is often nicer than the default, which always inserts another paren. (setq blink-paren-hook '(lambda () (if (and (not (eobp)) (char-equal (char-after (point)) last-input-char)) (delete-char 1)) (blink-matching-open))) Alternatively: (setq blink-paren-hook '(lambda () (if (looking-at (char-to-string last-input-char)) (delete-char 1)) (blink-matching-open))) I'm not sure which is more efficient; any clues? -- Ashwin Ram -- ARPA: Ram-Ashwin@yale UUCP: {decvax,linus,seismo}!yale!Ram-Ashwin BITNET: Ram@yalecs