Version 1 (modified by 13 years ago) (diff) | ,
---|
Editor Configuration Snippets
Emacs
Suppose your personal preferred indentation style is dissimilar from the Pidgin indentation style, but you're a team player and you want to use Pidgin indentation when working on Pidgin/libpurple/whatever. These snippets can help you with that.
(c-add-style "pidgin" '((c-tab-always-indent . t) (c-basic-offset . 8) (indent-tabs-mode . t))) (defun pidgin-c-mode-init () (if (or (posix-string-match "some/path/snippet" (buffer-file-name)) (posix-string-match "code/pidgin" (buffer-file-name))) (c-set-style "pidgin"))) (add-hook 'c-mode-hook 'pidgin-c-mode-init)
Make sure this hook runs after your normal setup hook, if your normal hook sets a style. The or is included just to show how to match multiple paths. You may perform the selection however you like, path snippets just happen to be useful given my filesystem organization. -- elb