summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ravi-init-cpp.el12
1 files changed, 3 insertions, 9 deletions
diff --git a/ravi-init-cpp.el b/ravi-init-cpp.el
index 2a41ec8..2d47008 100644
--- a/ravi-init-cpp.el
+++ b/ravi-init-cpp.el
@@ -324,11 +324,8 @@ this to 3 makes header-protection define KIG_MISC_NEWTYPE_H for a file named
(save-excursion
(re-search-backward "([[:space:]]*")
(unless (looking-at "(") (message "Logic error; opening paren not found"))
- (unless (or (c-on-identifier)
- (looking-back "[[:space:]]+"))
- (insert-char ?\s)
- )
- )
+ (when (looking-back "\\b\\(for\\|while\\|if\\|switch\\|catch\\)")
+ (insert-char ?\s)))
(if (looking-at " ") (forward-char) (insert-char ?\s))
)
)
@@ -358,10 +355,7 @@ this to 3 makes header-protection define KIG_MISC_NEWTYPE_H for a file named
;; FIXME: do-while loops are not handled correctly
(setq need-to-add-newline (looking-back "\\b\\(for\\|while\\|if\\|switch\\|catch\\)"))
)
- (if need-to-add-newline
- (c-newline-and-indent)
- ;; Add space after paren if necessary
- (if (looking-at " ") (forward-char) (insert-char ?\s))))
+ (when need-to-add-newline (c-newline-and-indent)))
)
)
))