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: Strings as opening/closing delimiters in the syntax table? Date: Fri, 29 Oct 2010 14:56:45 -0400 Organization: A noiseless patient Spider Message-ID: References: <573afe15-f5c3-4ed9-8d30-1d0775e20aa7@f33g2000yqh.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1291878714 11965 80.91.229.12 (9 Dec 2010 07:11:54 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 9 Dec 2010 07:11:54 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Dec 09 08:11:51 2010 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.69) (envelope-from ) id 1PQafN-00074I-V3 for geh-help-gnu-emacs@m.gmane.org; Thu, 09 Dec 2010 08:11:50 +0100 Original-Received: from localhost ([127.0.0.1]:57514 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PQafN-0002SP-0k for geh-help-gnu-emacs@m.gmane.org; Thu, 09 Dec 2010 02:11:49 -0500 Original-Path: usenet.stanford.edu!newsfeed.esat.net!feeder.news.heanet.ie!news.buerger.net!newsfeed.datemas.de!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 15 Injection-Info: mx03.eternal-september.org; posting-host="SJR+Y8Y8FyTd6G96BfBC4A"; logging-data="24120"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18wAmdz7IAWLlOdGb75pI64" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) Cancel-Lock: sha1:s5TQP15dWJK77HJUapN5RZXzpEA= sha1:T6+v0cL9tyEscM/PDFKbDTxdKGY= Original-Xref: usenet.stanford.edu gnu.emacs.help:182114 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:76800 Archived-At: > I want to make emacs match "if" to "then" in sh mode like it does "(" > and ")" in other modes. I read the wiki page about syntax tables > (http://www.emacswiki.org/emacs/EmacsSyntaxTable ) but it only talks > about opening and closing delimiter *characters*. Have I > misunderstood, or have I found something that emacs cannot do? [ghasp!] FWIW, octave-mode does it. Now that doesn't help you for sh scripts, but the octave-mode in the Emacs development trunk does it in a new way which uses a new generic navigation&indentation package called SMIE. So "all" you need to do is to describe the sh syntax to SMIE and you'll get that behavior (and you'll also get indentation with it, tho sh-mode already provides it in a different way). Stefan