Berkeley CSUA MOTD:Entry 14249
Berkeley CSUA MOTD
 
WIKI | FAQ | Tech FAQ
http://csua.com/feed/
2025/05/25 [General] UID:1000 Activity:popular
5/25    

1998/6/25-27 [Computer/SW/Languages/Perl] UID:14249 Activity:moderate
6/25    how do you make emacs auto-indent after pressing "ENTER" in
        perl/cc-mode?  What do I need to add in my .emacs file? TIA
                                                - clueless emacs user
        \_ M-X vi-mode; set ai
        \_ In your .emacs, add:  (add-hook 'c-mode-common-hook
             (function (lambda ()
                (define-key c-mode-map "\C-m" 'newline-and-indent) ) ) )
           ... And a similar thing for your perl mode.  --sowings
           \_ I assume it's: (add-hook 'perl-mode-common-hook
                (function (lambda ()
                (define-key perl-mode-map "\C-m" 'newline-and-indent) ) ))
                for perl?  it didnt work for me.  - still clueless
                \_ It would probably be 'perl-mode-hook, without "common".
        \_ Use vi.