From: Lars Ingebrigtsen <larsi@gnus.org>
To: Ivan Andrus <darthandrus@gmail.com>
Cc: 27552@debbugs.gnu.org, Stefan Monnier <monnier@iro.umontreal.ca>
Subject: bug#27552: 25.2.50; Indentation problem in rnc-mode
Date: Tue, 17 May 2022 21:25:04 +0200 [thread overview]
Message-ID: <87k0akhshb.fsf@gnus.org> (raw)
In-Reply-To: <BEC9975E-04D0-431C-B2D4-E7E73A059C79@gmail.com> (Ivan Andrus's message of "Sat, 1 Jul 2017 14:33:59 -0600")
Ivan Andrus <darthandrus@gmail.com> writes:
> The RNC snippet below (from
> http://cs.brown.edu/courses/cs196-9/slidestore/relaxng.html) shows an
> indentation problem when using multiple opening namespace/datatypes
> clauses.
>
> -Ivan
>
> default namespace rng = "http://relaxng.org/ns/structure/1.0"
> namespace local = ""
> datatypes xsd = "http://www.w3.org/2001/XMLSchema-datatypes"
>
> start = pattern
>
> pattern =
> element element { (nameQName | nameClass), (common & pattern+) }
> | element attribute { (nameQName | nameClass), (common & pattern?) }
> | element group|interleave|choice|optional
(defun rnc-smie-rules (kind token)
(pcase (cons kind token)
(`(:list-intro . "element") t)
(`(:elem . empty-line-token) " ; ")
(`(:before . ,(or "include" "default" "namespace" "datatypes")) 0)
[...]
(`(:after . ,(or "=" "|=" "&=")) smie-indent-basic)
I guess this "=" rule is for stuff like the "pattern =" etc. But it
leads to things like this being indented more for each line:
default namesace rng = "http://relaxng.org/ns/structure/1.0"
namespace local = ""
datatypes xsd = "http://www.w3.org/2001/XMLSchema-datatypes"
I betcha this is easy to express in smie, but I have no idea how, so
I've added Stefan to the CCs.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
next prev parent reply other threads:[~2022-05-17 19:25 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-01 20:33 bug#27552: 25.2.50; Indentation problem in rnc-mode Ivan Andrus
2022-05-17 19:25 ` Lars Ingebrigtsen [this message]
2022-06-15 14:25 ` Lars Ingebrigtsen
2022-06-15 15:15 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-06-15 15:56 ` Lars Ingebrigtsen
2022-07-02 20:43 ` Ivan Andrus
2022-07-02 21:37 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
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=87k0akhshb.fsf@gnus.org \
--to=larsi@gnus.org \
--cc=27552@debbugs.gnu.org \
--cc=darthandrus@gmail.com \
--cc=monnier@iro.umontreal.ca \
/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.