From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: 3246251196ryan@gmail.com Newsgroups: gmane.emacs.help Subject: Emacs *-mode add-hook functions (not working>) Date: Fri, 7 Nov 2014 06:18:40 -0800 (PST) Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1415371566 15523 80.91.229.3 (7 Nov 2014 14:46:06 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 7 Nov 2014 14:46:06 +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 15:45:59 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 1XmknX-0004ZS-2r for geh-help-gnu-emacs@m.gmane.org; Fri, 07 Nov 2014 15:45:59 +0100 Original-Received: from localhost ([::1]:60516 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XmknW-0000ck-Nu for geh-help-gnu-emacs@m.gmane.org; Fri, 07 Nov 2014 09:45:58 -0500 X-Received: by 10.66.66.202 with SMTP id h10mr8863908pat.34.1415369920659; Fri, 07 Nov 2014 06:18:40 -0800 (PST) X-Received: by 10.140.84.21 with SMTP id k21mr184920qgd.6.1415369920606; Fri, 07 Nov 2014 06:18:40 -0800 (PST) Original-Path: usenet.stanford.edu!r10no5106055igi.0!news-out.google.com!u5ni26qab.1!nntp.google.com!u7no3105271qaz.1!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=194.39.218.10; posting-account=yK8oPQoAAAA1qIT_h_OI91dtN6mGEacV Original-NNTP-Posting-Host: 194.39.218.10 User-Agent: G2/1.0 Injection-Date: Fri, 07 Nov 2014 14:18:40 +0000 Original-Xref: usenet.stanford.edu gnu.emacs.help:208547 X-Mailman-Approved-At: Fri, 07 Nov 2014 09:45:44 -0500 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:100825 Archived-At: In order to use CEDET with Windows I need to tell semantic to append includ= e files to search through to "the" list. In order to do this, I run a funct= ion on C++ mode. For example: =3D=3D=3D (add-hook 'c++-mode-hook 'rjd-my-semantic-load-includes) =3D=3D=3D ^^^^^ This is fine. When I load up a .cpp file the function is called and a= ll the necessary headers are included and CEDET parses them. However, a few lines down I have this line: =3D=3D=3D (add-hook 'c-mode-hook 'rjd-my-semantic-load-includes) =3D=3D=3D At work we do not adhere to calling C++ include files with the .hpp file ex= tension. Our header files are .h - thus, emacs considers this to be a C sty= le. When I open a .h file however I know the hook function has not been cal= led (and I can prove it if you wish unless you are just happy to accept th= is). What am I doing wrong with these hook functions? =3D=3D=3D The simply way to get around this is to - having loaded up a .h file - do "= M-x c-mode" and then the hook function runs and everything is fine. But why= do I need to do this? The mode in the bottom of the emacs screen doesn't c= hange even after doing M-x c-mode, it is always (C/1 Abbrev). Cheers.