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
This commit is contained in:
Henrik Lissner 2020-02-16 00:43:11 -05:00
parent 176be128ef
commit 114be4af57
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -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))