Xref: utzoo gnu.emacs:3765 comp.emacs:9013 Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!ucsd!rutgers!aramis.rutgers.edu!paul.rutgers.edu!sparky.rutgers.edu!gaynor From: gaynor@sparky.rutgers.edu (Silver) Newsgroups: gnu.emacs,comp.emacs Subject: Re: emacs-lisp-mode indentation Message-ID: Date: 5 Sep 90 07:08:57 GMT References: Distribution: comp Organization: Rutgers Univ., New Brunswick, N.J. Lines: 24 kpc00@JUTS.ccc.amdahl.com (kpc) requests support for having close parens line up under their match. Personally, I'm not real fond of this style for reasons better left to comp.lang groups. But in the spirit of bipartisanship, I offer the following. Warning. This is two-minute code, I spent as much time editing this message as I did writing and testing the function! ;; Bind me to keys which insert closing parens, like \), \], \}, ... (defun insert-close-paren-indent-under-match () "If on a white line, indent under match. Self-insert regardless. Returns nothing." (interactive) (if (save-excursion (beginning-of-line) (looking-at "^[\ \t]*$")) (progn (delete-region (match-beginning 0) (point)) (insert-char last-input-char 1) (let ((start (scan-sexps (point) -1))) (save-excursion (beginning-of-line) (indent-to (save-excursion (goto-char start) (current-column))))) (blink-matching-open)) (call-interactively 'self-insert-command)))) Regards, [Ag]