emacs-devel
[Top][All Lists]
Advanced

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

Re: good "modern" example code for a programming-language mode?


From: Tassilo Horn
Subject: Re: good "modern" example code for a programming-language mode?
Date: Wed, 16 Feb 2011 16:54:57 +0100
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/24.0.50 (gnu/linux)

Stefan Monnier <address@hidden> writes:

Hi Stefan,

> and for /bin/sh it currently looks like:
>
> (defun sh-smie-rules (kind token)
>   (pcase (cons kind token)
>     (`(:elem . basic) sh-indentation)
>     (`(:after . "case-)") (or sh-indentation smie-indent-basic))
>     (`(:before . ,(or `"(" `"{" `"["))
>      (if (smie-rule-hanging-p) (smie-rule-parent)))
>     ;; FIXME: Maybe this handling of ;; should be made into
>     ;; a smie-rule-terminator function that takes the substitute ";" as arg.
>     (`(:before . ,(or `";;" `";&" `";;&"))
>      (if (and (smie-rule-bolp) (looking-at ";;?&?[ \t]*\\(#\\|$\\)"))
>          (cons 'column (smie-indent-keyword ";"))
>        (smie-rule-separator kind)))
>     (`(:after . ,(or `";;" `";&" `";;&"))
>      (with-demoted-errors
>        (smie-backward-sexp token)
>        (cons 'column (current-column))))))

Do you have the SMIE-based indentation of sh in some (private) branch?
I can't find the above function in sh-script.el...

Bye,
Tassilo



reply via email to

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