From 55b718191df97db9d27510fb2d291cfe3dcb6180 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Tue, 23 May 2017 21:25:24 +0200 Subject: [PATCH] Fix double indentation in java --- modules/lang/cc/config.el | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/modules/lang/cc/config.el b/modules/lang/cc/config.el index 2892d3abe..f628b4c8f 100644 --- a/modules/lang/cc/config.el +++ b/modules/lang/cc/config.el @@ -68,13 +68,15 @@ (c-set-offset 'arglist-close '0) (defun +cc--c-lineup-inclass (langelem) - (let ((inclass (assoc 'inclass c-syntactic-context))) - (save-excursion - (goto-char (c-langelem-pos inclass)) - (if (or (looking-at "struct") - (looking-at "typedef struct")) - '+ - '++)))) + (if (memq major-mode '(c-mode c++-mode)) + (let ((inclass (assq 'inclass c-syntactic-context))) + (save-excursion + (goto-char (c-langelem-pos inclass)) + (if (or (looking-at "struct") + (looking-at "typedef struct")) + '+ + '++))) + '+)) (c-set-offset 'inclass #'+cc--c-lineup-inclass)