From 772d3e4e6970a2f0c227d499c313e91556d1d43d Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Tue, 21 Apr 2020 23:01:10 +0200 Subject: [PATCH] Make sure c-basic-indent sticks The previous solution worked but it would sometimes reset to its default value of 4, surely because of another mode loading and resetting it. This should fix it for good. --- config.org | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/config.org b/config.org index c7c498f..8ea35da 100644 --- a/config.org +++ b/config.org @@ -105,8 +105,9 @@ nice. Setup the default format for C/C++ editing. #+BEGIN_SRC emacs-lisp -(setq c-default-style "gnu") -(setq c-basic-offset 2) +(add-hook! (c-mode c++-mode) + (setq c-default-style "gnu") + (setq c-basic-offset 2)) #+END_SRC Flycheck never works well for C / C++ without configuration or a CMake build