From 4931aec084996c78616d4bc25aba40da1cb95337 Mon Sep 17 00:00:00 2001 From: Ravi R Kiran Date: Tue, 15 Apr 2014 21:22:53 -0700 Subject: Too many spaces for normal use 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))) ) ) )) -- cgit v0.10.1