summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRavi R Kiran <aine.marina@gmail.com>2014-05-27 14:56:10 (GMT)
committerRavikiran Rajagopal <aine.marina@gmail.com>2014-05-27 14:56:10 (GMT)
commitbd580c768b7a7eaf9cf5ad2da7a3d7d58ba11834 (patch)
treeabae81c31abf262801d99c91ef8ca5f56427eb17
parent6f892cb95981d78d72cbecbc4b2b794afbde65af (diff)
downloaddotemacs-bd580c768b7a7eaf9cf5ad2da7a3d7d58ba11834.zip
dotemacs-bd580c768b7a7eaf9cf5ad2da7a3d7d58ba11834.tar.gz
dotemacs-bd580c768b7a7eaf9cf5ad2da7a3d7d58ba11834.tar.bz2
Handle nested parantheses
-rw-r--r--ravi-init-cpp.el4
1 files changed, 3 insertions, 1 deletions
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:]]*")