From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lennart Borgman Newsgroups: gmane.emacs.help Subject: Re: distinguish .h files Date: Wed, 20 Oct 2010 17:48:19 +0200 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1287589758 14934 80.91.229.12 (20 Oct 2010 15:49:18 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 20 Oct 2010 15:49:18 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Andrea Crotti Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Oct 20 17:49:17 2010 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1P8auh-0000dW-Vm for geh-help-gnu-emacs@m.gmane.org; Wed, 20 Oct 2010 17:49:16 +0200 Original-Received: from localhost ([127.0.0.1]:47776 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P8auh-00082U-Be for geh-help-gnu-emacs@m.gmane.org; Wed, 20 Oct 2010 11:49:15 -0400 Original-Received: from [140.186.70.92] (port=59083 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P8au9-00081n-AM for help-gnu-emacs@gnu.org; Wed, 20 Oct 2010 11:48:42 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P8au8-0008FT-D0 for help-gnu-emacs@gnu.org; Wed, 20 Oct 2010 11:48:41 -0400 Original-Received: from mail-qy0-f176.google.com ([209.85.216.176]:40136) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1P8au8-0008FP-9M for help-gnu-emacs@gnu.org; Wed, 20 Oct 2010 11:48:40 -0400 Original-Received: by qyk29 with SMTP id 29so2795336qyk.0 for ; Wed, 20 Oct 2010 08:48:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:in-reply-to :references:from:date:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=JCUR5nAHe9lyDBH5VBPPVczRhdNday1SyzoKBCMoFyQ=; b=ioLD9A9YQGH9SEh2rXzpGZbMIUwK808NfJZyr6CaKrLDjjF997rmSF3pqYK/cSA1k7 SWKfTI43BWz8nv6jQknJKw0dd9KUdmRknOmRkYC7/LeuyA3nBrYmBUAv+hShgAn0YPRw yRDlQ5Icp5CPcM8ahqkgA9A53rsWT7n9PM+uI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=m0ijbSEKHT1R+ED2kzxKmkwI8bjSezqhH/ljpbyAWpZewDQ0OACygNiuj/l2pWVZfR uGsVUVy3SEn1LDcauLd477UG8MphJRes+CWOfDz40Bm+JbC3Uz4XIIruYk73wHZfbQkS CAlsk1djv0yL+rl07HjdPpvoKPyYKxy0jYWTg= Original-Received: by 10.229.189.66 with SMTP id dd2mr6634803qcb.123.1287589719766; Wed, 20 Oct 2010 08:48:39 -0700 (PDT) Original-Received: by 10.229.224.199 with HTTP; Wed, 20 Oct 2010 08:48:19 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:75175 Archived-At: On Wed, Oct 20, 2010 at 5:37 PM, Andrea Crotti wrote: > > It's a bit annoying that the header files .h BUT for c++ are not > automatically recognized (but of course understandable). > > I tried the following approach but it doesn't work, maybe the function > is executed too early? > Or what else can be the problem? > > --8<---------------cut here---------------start------------->8--- > =C2=A0(defun is-cpp-header-file () > =C2=A0 =C2=A0"enable c++-mode when finding classes" > =C2=A0 =C2=A0(when (re-search-forward "class ") > =C2=A0 =C2=A0 =C2=A0(c++-mode))) > > =C2=A0;;(add-hook 'c-mode-common-hook 'is-cpp-header-file) > --8<---------------cut here---------------end--------------->8--- Please have a look at (info "(emacs) Choosing Modes")