help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Emacs *-mode add-hook functions (not working>)


From: Eli Zaretskii
Subject: Re: Emacs *-mode add-hook functions (not working>)
Date: Fri, 07 Nov 2014 16:59:44 +0200

> Date: Fri, 7 Nov 2014 06:18:40 -0800 (PST)
> From: 3246251196ryan@gmail.com
> 
> In order to use CEDET with Windows I need to tell semantic to append include 
> files to search through to "the" list. In order to do this, I run a function 
> on C++ mode. For example:
> 
> ===
> (add-hook 'c++-mode-hook 'rjd-my-semantic-load-includes)
> ===
> 
> ^^^^^ This is fine. When I load up a .cpp file the function is called and all 
> the necessary headers are included and CEDET parses them.
> 
> However, a few lines down I have this line:
> 
> ===
> (add-hook 'c-mode-hook 'rjd-my-semantic-load-includes)
> ===
> 
> At work we do not adhere to calling C++ include files with the .hpp file 
> extension. Our header files are .h - thus, emacs considers this to be a C 
> style.

You could use c-mode-common-hook, then you wouldn't need 2 hooks.

> When I open a .h file however I know the hook function has not been called 
> (and I can prove it if  you wish unless you are just happy to accept this).
> 
> What am I doing wrong with these hook functions?

I don't know.  It works for me: visiting a .h file invokes a
c-mode-hook function.  I think the answer is in your other
customizations.  IOW, try this in "emacs -Q", and if it works then,
bisect your ~/.emacs to find the culprit.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]