Created
July 29, 2013 05:54
-
-
Save snogglethorpe/6102371 to your computer and use it in GitHub Desktop.
custom Emacs c-mode indentation hook
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; custom Emacs c-mode indentation hook | |
(defvar c-basic-offset) ; standard variable in c-mode | |
(defun miles-c-lineup-arglist-intro-indented-after-function (langelem) | |
"Works with: defun-block-intro, brace-list-intro, | |
statement-block-intro, statement-case-intro, arglist-intro." | |
(save-excursion | |
(beginning-of-line) | |
(backward-up-list 1) | |
(backward-sexp) | |
(vector (+ (current-column) c-basic-offset)))) | |
(defun miles-c-mode-common-hook () | |
(c-set-offset 'arglist-intro | |
'miles-c-lineup-arglist-intro-indented-after-function)) | |
(add-hook 'c-mode-common-hook 'miles-c-mode-common-hook) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment