From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.help Subject: Re: Emacs *-mode add-hook functions (not working>) Date: Fri, 07 Nov 2014 16:59:44 +0200 Message-ID: <83d28zrr8f.fsf@gnu.org> References: NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1415372436 30487 80.91.229.3 (7 Nov 2014 15:00:36 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 7 Nov 2014 15:00:36 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Nov 07 16:00:24 2014 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Xml1T-0001kL-4E for geh-help-gnu-emacs@m.gmane.org; Fri, 07 Nov 2014 16:00:23 +0100 Original-Received: from localhost ([::1]:60581 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xml1S-0007xv-Ic for geh-help-gnu-emacs@m.gmane.org; Fri, 07 Nov 2014 10:00:22 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52412) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xml19-0007rl-Sg for help-gnu-emacs@gnu.org; Fri, 07 Nov 2014 10:00:11 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xml12-00032U-Dn for help-gnu-emacs@gnu.org; Fri, 07 Nov 2014 10:00:03 -0500 Original-Received: from mtaout20.012.net.il ([80.179.55.166]:64077) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xml12-00032B-60 for help-gnu-emacs@gnu.org; Fri, 07 Nov 2014 09:59:56 -0500 Original-Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0NEO00C00C6WB400@a-mtaout20.012.net.il> for help-gnu-emacs@gnu.org; Fri, 07 Nov 2014 16:59:54 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NEO00CCTCBUB900@a-mtaout20.012.net.il> for help-gnu-emacs@gnu.org; Fri, 07 Nov 2014 16:59:54 +0200 (IST) In-reply-to: X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: Solaris 10 X-Received-From: 80.179.55.166 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:100827 Archived-At: > 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.