Blockblock fairly odd parents bttv3/21/2023 ![]() But even if you fail in getting emacs to do sane formatting, not everything is lost: use "indent". This will make emacs go better with the kernel coding style for C files below ~/src/linux-trees. emacs file if you want to have linux-c-mode switched on -automagically when you edit source files under /usr/src/linux. linux-c-mode) - auto-mode-alist)) -to your. Also, you may want -to add (add-hook 'c-mode-hook (lambda () (let ((filename (buffer-file-name))) Enable kernel mode for the appropriate files (when (and filename (string-match "~/src/linux-trees" filename)) (setq indent-tabs-mode t) (c-set-style "linux") (c-set-offset 'arglist-cont-nonempty '(c-lineup-gcc-asm-reg c-lineup-arglist-tabs-only)))))) -(setq auto-mode-alist (cons '("/usr/src/linux.*/.*\\.$". When hacking on a -module, if you put the string -*- linux-c -*- somewhere on the first -two lines, this mode will be automatically invoked. emacs file: -(defun linux-c-mode () - "C mode with adjusted defaults for use with the Linux kernel." - (interactive) - (c-mode) - (c-set-style "K
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |