From: Lars Ingebrigtsen <larsi@gnus.org>
To: Doug Maxey <emacs-bugs@maxeygroup.tech>
Cc: Stefan Monnier <monnier@iro.umontreal.ca>, 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: Mon, 07 Feb 2022 00:50:49 +0100 [thread overview]
Message-ID: <87y22n367a.fsf@gnus.org> (raw)
In-Reply-To: <87czk0zk43.fsf@maxeygroup.tech> (Doug Maxey's message of "Sat, 05 Feb 2022 22:37:00 -0600")
Doug Maxey <emacs-bugs@maxeygroup.tech> writes:
> However, lots'o bash gets written here, and one of my idioms is:
> <code>
> if test;then
> do something
> fi
> ^
> </code>
The problem seems to be here:
(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".
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.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
next prev parent reply other threads:[~2022-02-06 23:50 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 [this message]
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
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=87y22n367a.fsf@gnus.org \
--to=larsi@gnus.org \
--cc=53817@debbugs.gnu.org \
--cc=emacs-bugs@maxeygroup.tech \
--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.