Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!hellgate.utah.edu!caen!sol.ctr.columbia.edu!ira.uka.de!fuchs From: fuchs@it.uka.de (Harald Fuchs) Newsgroups: comp.emacs Subject: C++-mode and abbrevs Message-ID: Date: 29 Nov 90 17:21:32 GMT Sender: news@ira.uka.de (USENET News System) Organization: University of Karlsruhe, FRG Lines: 43 I have a problem with the version of c++-mode.el beginning like that: ;; C++ code editing commands for Emacs ;; 1987 Dave Detlefs (dld@cs.cmu.edu) ;; and Stewart Clamen (clamen@cs.cmu.edu). ;; Done by fairly faithful modification of: ;; c-mode.el, Copyright (C) 1985 Richard M. Stallman. ;; ;; Feb, 1990 (Dave Detlefs, dld@cs.cmu.edu) ;; Fixed electric-c++-terminator to handle double colons, at the ;; request of John Hagerman. I'm a lazy typist (seems that C++ is too verbose for me), so I defined mode-abbrevs like "reg" for "register", "pub" for "public" etc. This works fine except in one case: class Foo { pub ^ cursor is here When I hit the ":" key, "pub" is correctly expanded to "public:", but it is not moved to the beginning of the line: class Foo { public: What I would like to see is: class Foo { public: Being no LISPer, I can't fix this. Any help? My ~/.emacs file contains (among other things): (setq c-argdecl-indent 2) (setq c-tab-always-indent nil) (setq c++-friend-offset 0) (quietly-read-abbrev-file (expand-file-name "~/.emacs_abbrevs")) (setq c-mode-hook '(lambda () (abbrev-mode 1))) (setq c++-mode-hook '(lambda () (abbrev-mode 1))) -- Harald Fuchs ... *gulp*