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

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

Re: Strings as opening/closing delimiters in the syntax table?


From: Stefan Monnier
Subject: Re: Strings as opening/closing delimiters in the syntax table?
Date: Wed, 08 Dec 2010 15:33:55 -0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

> 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


reply via email to

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