el-get/recipes/ppindent.rcp

15 lines
659 B
Plaintext
Raw Normal View History

2011-07-20 18:24:39 +08:00
(:name ppindent :type emacswiki
:description "Indents C preprocessor directives"
2011-07-20 18:24:39 +08:00
:features ppindent
:post-init (progn
2011-07-20 18:24:39 +08:00
(setq ppindent-increment 4)
(message (format "%s" (current-buffer)))
(add-hook
'c-mode-common-hook
(lambda()
(add-hook
'before-save-hook
(lambda()
(if (string-match-p "\\.[Hh][a-z]*$" buffer-file-name) (ppindent-h)
(when (string-match-p "\\.[Cc][a-z]*$" buffer-file-name) (ppindent-c)))))))))