help-gnu-emacs
[Top][All Lists]
Advanced

[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 14:56:38 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (darwin)

Oleksandr Gavenko <gavenko@bifit.com.ua> writes:

>> I don't know exactly,...
>>
>> --8<---------------cut here---------------start------------->8---
>> (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))
>> --8<---------------cut here---------------end--------------->8---
>>
> I use your code to get this value (add this after 'string-match'):
>
>         (message "%s" (- (point-max) (point-min)))
>
> I get 4000.

I don't get your point...
What's that useful for exactly?




reply via email to

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