From 114be4af5734c6bbb698d8816c7f060b8c7280ac Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sun, 16 Feb 2020 00:43:11 -0500 Subject: [PATCH] Don't use c-toggle-{electric-state,auto-newline} globally Fixes an odd error where: 1. You open an elixir-mode buffer 2. elixir-mode sets `mode-name` to a non-string value 3. cc-mode is pulled in by one of its dependencies 4. `c-toggle-electric-state` is called from the config/default module 5. Which calls `c-update-modeline` 6. Which operates on `mode-name` and assumes it is a string 7. And a wrong-type-argument: stringp error is thrown --- modules/config/default/config.el | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/modules/config/default/config.el b/modules/config/default/config.el index bca8cf43c..f852d20f9 100644 --- a/modules/config/default/config.el +++ b/modules/config/default/config.el @@ -123,9 +123,7 @@ ;; Disable electric keys in C modes because it interferes with smartparens ;; and custom bindings. We'll do it ourselves (mostly). (after! cc-mode - (c-toggle-electric-state -1) - (c-toggle-auto-newline -1) - (setq c-electric-flag nil) + (setq-default c-electric-flag nil) (dolist (key '("#" "{" "}" "/" "*" ";" "," ":" "(" ")" "\177")) (define-key c-mode-base-map key nil))