jdf@mit-prep (07/20/85)
From: Jean-Daniel Fekete <jdf@mit-prep> I have added to the c mode the ability of handling "else" correctly. The code is in /u/jdf/emacs/c-mode. Load it before calling the c-mode, or else the key binding will not be correct. If someone wants to install it, it would be better. JDF
vijay@topaz.ARPA (P. Vijay) (07/21/85)
That was a much needed fix. I just tried it out and found that
it doesn't work in the case of a mis-indented 'else' followed by a
left brace '{'. So, here is the fix that you need to put in the
function electric-c-brace (the diff is a context diff of Jean-Daniel's
version and mine (which is his plus the fix).
*** c-mode.el.ORIG Sun Jul 21 00:19:52 1985
--- c-mode.el Sun Jul 21 01:02:27 1985
***************
*** 165,171
(skip-chars-backward " \t")
(bolp))
(progn
! (if c-auto-newline (newline))
c-auto-newline)))
(progn
(insert last-command-char)
--- 165,173 -----
(skip-chars-backward " \t")
(bolp))
(progn
! (if c-auto-newline (progn
! (c-indent-line)
! (newline)))
c-auto-newline)))
(progn
(insert last-command-char)
--Vijay--