From 62652068de5965cb39b4c527e0d9b78ac1440de9 Mon Sep 17 00:00:00 2001 From: Marcus Kammer Date: Sat, 24 Feb 2024 17:13:36 +0100 Subject: [PATCH] Update cc-mode --- bundle/bundle--package.el | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/bundle/bundle--package.el b/bundle/bundle--package.el index dd6a4f0b..eef7c0ce 100644 --- a/bundle/bundle--package.el +++ b/bundle/bundle--package.el @@ -55,14 +55,6 @@ (setq sql-mariadb-options '("-C" "-t" "-f" "-n")) (setq sql-mysql-options '("-C" "-t" "-f" "-n")))) -(use-package cc-mode - :defer t - :ensure nil - :hook (c-mode-common . c-toggle-auto-newline) - :custom - (fill-column 79) - (c-basic-offset 2)) - (defun me/c-mode-style-hook () ;; https://www.gnu.org/prep/standards/html_node/Writing-C.html ;; if linux kernel source use linux style, else use gnu style @@ -72,7 +64,17 @@ "linux" "gnu"))) -(add-hook 'c-mode-common-hook 'me/c-mode-style-hook) +(use-package cc-mode + :defer t + :ensure nil + :hook ((c-mode-common . c-toggle-auto-newline) + (c-mode-common . me/c-mode-style-hook)) + :custom + (fill-column 79) + (c-basic-offset 2) + (indent-tabs-mode nil) + :config + (define-key c-mode-base-map (kbd "RET") 'newline-and-indent)) ;; (defun me/c-mode-compile-command-hook () ;; ;; if no makefile use gcc for compile command