From 6fc7b8c1c434b78e7827357cd848c72b2c6f10e8 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Wed, 27 Feb 2019 15:21:04 -0500 Subject: [PATCH] Better electric-indent uninhibiter Will now work in C modes as well as Csharp, Java and Python; possibly others that forcibly set electric-indent-inhibit. --- modules/emacs/electric/autoload.el | 1 + modules/lang/cc/config.el | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/modules/emacs/electric/autoload.el b/modules/emacs/electric/autoload.el index 3dbe4ec2f..2a457a0da 100644 --- a/modules/emacs/electric/autoload.el +++ b/modules/emacs/electric/autoload.el @@ -17,6 +17,7 @@ Enables `electric-indent-local-mode' in MODES. (unintern fn nil)) ((fset fn (lambda () + (setq-local electric-indent-inhibit nil) (cl-destructuring-bind (&key chars words) plist (electric-indent-local-mode +1) (if chars (setq electric-indent-chars chars)) diff --git a/modules/lang/cc/config.el b/modules/lang/cc/config.el index d377d4502..035dea19a 100644 --- a/modules/lang/cc/config.el +++ b/modules/lang/cc/config.el @@ -71,8 +71,6 @@ compilation database is present in the project.") (add-hook 'c-mode-common-hook #'rainbow-delimiters-mode) (add-hook! '(c-mode-hook c++-mode-hook) #'+cc|fontify-constants) - (setq-hook! 'c-mode-common-hook electric-indent-inhibit nil) - ;; Custom style, based off of linux (unless (assoc "doom" c-style-alist) (push '("doom"