Update cc-mode
This commit is contained in:
parent
c4028a0ffa
commit
62652068de
1 changed files with 11 additions and 9 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue