[Top][All Lists]

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

Re: distinguish .h files

From: Andrea Crotti
Subject: Re: distinguish .h files
Date: Thu, 21 Oct 2010 13:04:54 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (darwin)

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 "\\_<class\\_>" 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 

reply via email to

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