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

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

Re: how to prevent abbreviation in c comment?


From: Stefan Monnier
Subject: Re: how to prevent abbreviation in c comment?
Date: Mon, 10 Mar 2008 15:00:15 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)

>> I have defined an abbreviation of  "main" for "int main () {}" in c-mode 
> using
>> skeleton,
>> but I don't want "main" be expanded when it is in c comment blocks, how to?
>> 
>> 
>> -- 
>> sunway
>> 
>> "Never, never, never, never give up."
>> 

> IMO best solution is to redefine your abbrev.

> Maybe, when defining abbrevs, think about how to avoid
> such, i.e. don't use existing words as abbreviations,
> unless there are reasons to do so.

In Emacs-23, abbreviations have been reimplemented and they offer some
new features, including an ability to disable them with a hook.
This was specifically designed so that programming modes can set
this :enable-function to a function that disables the abbreviations in
comments and strings.


        Stefan


reply via email to

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