From bd580c768b7a7eaf9cf5ad2da7a3d7d58ba11834 Mon Sep 17 00:00:00 2001 From: Ravi R Kiran Date: Tue, 27 May 2014 07:56:10 -0700 Subject: Handle nested parantheses diff --git a/ravi-init-cpp.el b/ravi-init-cpp.el index 2d47008..1690a91 100644 --- a/ravi-init-cpp.el +++ b/ravi-init-cpp.el @@ -326,7 +326,9 @@ this to 3 makes header-protection define KIG_MISC_NEWTYPE_H for a file named (unless (looking-at "(") (message "Logic error; opening paren not found")) (when (looking-back "\\b\\(for\\|while\\|if\\|switch\\|catch\\)") (insert-char ?\s))) - (if (looking-at " ") (forward-char) (insert-char ?\s)) + (if (and (looking-at " ") (not (looking-at " )"))) + (forward-char) + (insert-char ?\s)) ) ) ((looking-back ")[[:space:]]*") -- cgit v0.10.1