From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.help Subject: Re: how to prevent abbreviation in c comment? Date: Mon, 10 Mar 2008 15:00:15 -0400 Organization: UseNetServer.com Message-ID: References: <20080307145914.GA25274@sunway> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1205178152 22002 80.91.229.12 (10 Mar 2008 19:42:32 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 10 Mar 2008 19:42:32 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Mar 10 20:42:50 2008 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.50) id 1JYnt3-0004oN-9z for geh-help-gnu-emacs@m.gmane.org; Mon, 10 Mar 2008 20:42:17 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JYnsV-0004Iy-4F for geh-help-gnu-emacs@m.gmane.org; Mon, 10 Mar 2008 15:41:43 -0400 Original-Path: shelby.stanford.edu!headwall.stanford.edu!newshub.sdsu.edu!nx01.iad01.newshosting.com!newshosting.com!208.49.83.146.MISMATCH!uns-out.usenetserver.com!news.usenetserver.com!pc03.usenetserver.com!TEKSAVVY.COM-Free-a2kHrUvQQWlmc!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) Cancel-Lock: sha1:f01CmAvKUYO3vqqih+HntXtCzyc= Original-X-Complaints-To: abuse@usenetserver.com Original-Lines: 26 Original-X-Trace: 118c447d582346b5d39b013912 Original-Xref: shelby.stanford.edu gnu.emacs.help:156858 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:52231 Archived-At: >> 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