From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andrea Crotti Newsgroups: gmane.emacs.help Subject: Re: distinguish .h files Date: Thu, 21 Oct 2010 13:04:54 +0200 Message-ID: References: <87k4lb7rx1.fsf@thinkpad.tsdh.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1287659167 3365 80.91.229.12 (21 Oct 2010 11:06:07 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 21 Oct 2010 11:06:07 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Oct 21 13:06:06 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 1P8syD-0002OO-Vt for geh-help-gnu-emacs@m.gmane.org; Thu, 21 Oct 2010 13:06:06 +0200 Original-Received: from localhost ([127.0.0.1]:38492 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P8syC-0002fa-MI for geh-help-gnu-emacs@m.gmane.org; Thu, 21 Oct 2010 07:06:04 -0400 Original-Received: from [140.186.70.92] (port=41435 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P8sxR-0002dc-Ih for help-gnu-emacs@gnu.org; Thu, 21 Oct 2010 07:05:29 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P8sxF-0001xI-3n for help-gnu-emacs@gnu.org; Thu, 21 Oct 2010 07:05:17 -0400 Original-Received: from lo.gmane.org ([80.91.229.12]:46737) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1P8sxE-0001wH-UN for help-gnu-emacs@gnu.org; Thu, 21 Oct 2010 07:05:05 -0400 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1P8sxD-00027V-3o for help-gnu-emacs@gnu.org; Thu, 21 Oct 2010 13:05:03 +0200 Original-Received: from 86-109.eduroam.rwth-aachen.de ([134.61.86.109]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 21 Oct 2010 13:05:03 +0200 Original-Received: from andrea.crotti.0 by 86-109.eduroam.rwth-aachen.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 21 Oct 2010 13:05:03 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 32 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: 86-109.eduroam.rwth-aachen.de User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (darwin) Cancel-Lock: sha1:WVNOaIS35C0NGEAWnNs4D4roXx4= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) 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:75184 Archived-At: Tassilo Horn writes: > > > This should do the trick: > > (defun c++-header-file-p () > "Return non-nil, if in a C++ header." > (and (string-match "\\.h$" > (or (buffer-file-name) > (buffer-name))) > (save-excursion > (re-search-forward "\\_" nil t)))) > > (add-to-list 'magic-mode-alist > '(c++-header-file-p . c++-mode)) > > Bye, > Tassilo Great it works perfectly, now I have to understand how the heck I can make "gtags" understand c++ code... But that's another story... Instead, is not possible somehow that when I say public class X : public Y { } I get all the needed declarations automatically. I didn't find anything useful in CEDET about that, but maybe there is something...