Path: utzoo!utgpu!water!watmath!clyde!rutgers!rochester!udel!burdvax!bpa!cbmvax!vu-vlsi!cgh!manta!brant From: brant@manta.UUCP (Brant Cheikes) Newsgroups: comp.emacs Subject: Re: Swapping ()/[] in [Gnu Emacs] Lisp Mode Message-ID: <331@manta.UUCP> Date: 4 Jan 88 07:45:04 GMT References: <326@manta.UUCP> Reply-To: brant@manta.UUCP (Brant Cheikes) Organization: Soul of the Gnu Machine, Philadelphia Lines: 21 In article <326@manta.UUCP> I write: >I'd like to swap the meaning of the pair of keys "[" and "]" with that >of "(" and ")" when in Lisp Mode. The cleanest solution (due to weemba@garnet) is the following: (defun insert-lp () (interactive) (insert ?\()) (defun insert-rp () (interactive) (insert ?\)) (blink-matching-open)) (defun insert-lb () (interactive) (insert ?\[)) (defun insert-rb () (interactive) (insert ?\])) (define-key lisp-mode-map "(" 'insert-lb) (define-key lisp-mode-map ")" 'insert-rb) (define-key lisp-mode-map "[" 'insert-lp) (define-key lisp-mode-map "]" 'insert-rp) Thanks to all who replied. Happy Gnu Year! -b -- Brant Cheikes University of Pennsylvania Department of Computer and Information Science ARPA: brant@linc.cis.upenn.edu, UUCP: ...drexel!manta!brant