I used to launch yasnippet just with c-mode with a hook in my .emacs but after adding some code to use CEDET and ECB yasnippet doesn't run automatically. I guess some modes may have been overwritten by CEDET, so how do I launch yasnippet mode automatically on c-mode now ?

(add-hook 'c-mode-hook (lambda ()
(global-ede-mode 1)  ; Enable the Project   management system                                        
(semantic-mode 1)
(require 'semantic/bovine/gcc)
(require 'semantic/sb)

I haven't understood the full CEDET configuration process so I may have done something wrong.

Thank you

  • Your add-hook looks wrong, shoud be just (add-hook 'c-mode-hook #'yas-minor-mode)
    – npostavs
    Nov 28 '15 at 15:30
  • It works ! I've read that proper way to do hooks was to give them a lamba function. But that doesn't make sense. I still don't understand what the # is for... Thank you ! Nov 28 '15 at 19:17
  • Only if you needed to pass arguments to the function then you would need to wrap it in a lambda (although I would prefer using defun). Regarding #', see emacs.stackexchange.com/q/10938/5296
    – npostavs
    Nov 28 '15 at 22:10

Browse other questions tagged or ask your own question.