From: Doug Maxey <pops@maxeygroup.tech>
To: Stefan Monnier <monnier@iro.umontreal.ca>,
Lars Ingebrigtsen <larsi@gnus.org>
Cc: Doug Maxey <emacs-bugs@maxeygroup.tech>, 53817@debbugs.gnu.org
Subject: bug#53817: 28.0.91; sh-mode indent misses on 'if test; then' when 'then' is on 'if' line
Date: Sun, 06 Feb 2022 18:14:45 -0600 [thread overview]
Message-ID: <14f63bd0e8e26669615c2661dfe53f43420a0aca.camel@maxeygroup.tech> (raw)
In-Reply-To: <jwvmtj3y204.fsf-monnier+emacs@gnu.org>
[-- Attachment #1.1: Type: text/plain, Size: 1202 bytes --]
On Sun, 2022-02-06 at 19:11 -0500, Stefan Monnier wrote:
> > (defun sh-smie--default-backward-token ()
> > [...]
> > (progn (skip-syntax-backward ".w_'")
> > (or (not (zerop (skip-syntax-backward "\\")))
> > (when (eq ?\\ (char-before (1- (point))))
> >
> > Semi-colons have punctuation syntax, so we're skipping back over
> > the
> > entirety of "test;then" instead of stopping after "then".
>
> We should indeed only skip over "then", and then only over ";" and
> then
> only over "test".
>
> > This looks easy enough to fix, but the overall logic of that
> > function is
> > somewhat obscure to me, so I've added Stefan to the comments;
> > perhaps he
> > has some comments.
>
> The sh syntax is fairly nasty to parse, especially backwards, so I
> can't
> give you any general comment here. I'd try something and then see if
> it
> breaks any tests (including looking at test/manual/indent/shell.sh).
>
> For sure, I'd recommend adding a regression test.
just a further point, if it helps, this was fine in 27.2.
>
>
> Stefan
>
[-- Attachment #1.2: Type: text/html, Size: 2233 bytes --]
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2022-02-07 0:14 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-06 4:37 bug#53817: 28.0.91; sh-mode indent misses on 'if test; then' when 'then' is on 'if' line Doug Maxey
2022-02-06 23:50 ` Lars Ingebrigtsen
2022-02-07 0:11 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-02-07 0:14 ` Doug Maxey [this message]
2022-02-07 8:16 ` Lars Ingebrigtsen
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=14f63bd0e8e26669615c2661dfe53f43420a0aca.camel@maxeygroup.tech \
--to=pops@maxeygroup.tech \
--cc=53817@debbugs.gnu.org \
--cc=emacs-bugs@maxeygroup.tech \
--cc=larsi@gnus.org \
--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.