Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!mit-eddie!ll-xn!ames!ptsfa!ihnp4!cbosgd!osu-cis!tut!karl From: karl@tut.cis.ohio-state.edu (Karl Kleinpaste) Newsgroups: comp.emacs Subject: Re: Electric c/c++/Pascal mode for GNU emacs? Message-ID: <211@tut.cis.ohio-state.edu> Date: Fri, 25-Sep-87 08:03:39 EDT Article-I.D.: tut.211 Posted: Fri Sep 25 08:03:39 1987 Date-Received: Sun, 27-Sep-87 01:56:20 EDT References: <202@bernina.UUCP> Organization: Ohio State Computer & Info Science Lines: 50 heiser@ethz.UUCP writes: >UNIPRESS Emacs comes with what is called Electric C Mode, which does much more >than what GNU Emacs c mode does (mainly indenting). (Emphatically *not* an entry in "my editor is better than yours...") If you're concerned primarily with auto-indentation, is it possible that you haven't looked into all the c-* variables in GNU Emacs C mode? In particular, c-auto-newline does some fairly impressive things with figuring your indentations out for you on the fly without even having to ask for indentation. (And, of course, LF in C mode does a newline-and-indent.) Consider the following set of c-* vars: (setq c-argdecl-indent 0 c-auto-newline t c-brace-imaginary-offset 0 c-brace-offset 0 c-continued-statement-offset 0 c-indent-level 8 c-label-offset -8 comment-column 40) In the office where I last worked, this set of vars was used to give a rigid style of the form func(arg1, arg2) int arg1; char arg2; { register foo; extern FILE *fp; if ((char)arg1 == arg2) { func2(&foo); fprintf(fp, "foo is %d\n", foo); } else { exit(1); } } I only had to type a single LF during the preparation of that fragment, after the closing paren in the first line. The rest auto-indented on its own following any occurrences of {, }, or ;. Give these a try; they may do what you want without having to hack up Unipress' C stuff. -- Karl