From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Xah Newsgroups: gmane.emacs.help Subject: Re: abbrev-mode and skeletons question Date: Fri, 24 Oct 2008 12:19:13 -0700 (PDT) Organization: http://groups.google.com Message-ID: <14ba3a8e-8cd1-47fc-a5ba-d88ede2a26b2@g25g2000prf.googlegroups.com> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1224877345 1623 80.91.229.12 (24 Oct 2008 19:42:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 24 Oct 2008 19:42:25 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Oct 24 21:43:25 2008 connect(): Connection refused 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 1KtSZ9-0004eP-Bp for geh-help-gnu-emacs@m.gmane.org; Fri, 24 Oct 2008 21:43:23 +0200 Original-Received: from localhost ([127.0.0.1]:51699 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KtSY2-0004nO-Lh for geh-help-gnu-emacs@m.gmane.org; Fri, 24 Oct 2008 15:42:14 -0400 Original-Path: news.stanford.edu!newsfeed.stanford.edu!postnews.google.com!g25g2000prf.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 24 Original-NNTP-Posting-Host: 24.6.185.159 Original-X-Trace: posting.google.com 1224875953 30719 127.0.0.1 (24 Oct 2008 19:19:13 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Fri, 24 Oct 2008 19:19:13 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: g25g2000prf.googlegroups.com; posting-host=24.6.185.159; posting-account=bRPKjQoAAACxZsR8_VPXCX27T2YcsyMA User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10_4_11; en) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.22, gzip(gfe), gzip(gfe) Original-Xref: news.stanford.edu gnu.emacs.help:163803 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:59141 Archived-At: On Oct 23, 9:51 am, pandagoat wrote: > I have set up several skeletons to use when I type certain abbrevs, but I > have two cases where I do not wish it to insert anything: in commented > regions and in strings. Is there some method to not insert a skeleton if > the abbrev is in a commented region or in a string? > > I know I can just use cryptic abbrevs that I would never type otherwise, = but > doing the aforementioned method would be more nice. i don't have clear answer for you, but i think there's no user level way to do thaty. More specifically, abbrevs is not designed to be context sensitive. (however, abbrev does has some mechanism to prevent expansion while you are typing the word out. You have to type some prefix... see the doc on abbrev) To do what you want, i think you might need to use some skeleton mode or ysnippet mode, which are designed to expand words to prog lang templates, and is context sensitive. Xah =E2=88=91 http://xahlee.org/ =E2=98=84