This answer assumes that the function my-decaf-mode
does exactly what the original poster wants, and that the only thing needed is to associate *.dec
extension files with c-mode
and then call the function my-decaf-mode
when the major-mode c-mode
is activated in a buffer:
(add-to-list 'auto-mode-alist '("\\.dec\\'" . c-mode))
(add-hook 'c-mode-hook 'my-decaf-mode)