all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: help-gnu-emacs@gnu.org
Subject: Re: how to prevent abbreviation in c comment?
Date: Mon, 10 Mar 2008 15:00:15 -0400	[thread overview]
Message-ID: <jwvlk4ql83x.fsf-monnier+gnu.emacs.help@gnu.org> (raw)
In-Reply-To: mailman.8518.1204914695.18990.help-gnu-emacs@gnu.org

>> 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


      parent reply	other threads:[~2008-03-10 19:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-07 14:59 how to prevent abbreviation in c comment? sunway
2008-03-07 18:33 ` Andreas Röhler
     [not found] ` <mailman.8518.1204914695.18990.help-gnu-emacs@gnu.org>
2008-03-10 19:00   ` Stefan Monnier [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvlk4ql83x.fsf-monnier+gnu.emacs.help@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.