From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Pascal Quesseveur <pquessev@gmail.com>
Cc: 36348-done@debbugs.gnu.org
Subject: bug#36348: 26.2; Indentation problem with Delphi inline variables
Date: Mon, 22 Jul 2019 13:12:04 -0400 [thread overview]
Message-ID: <jwvr26ivvtt.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <83k1db8mbj.fsf@gmail.com> (Pascal Quesseveur's message of "Mon, 24 Jun 2019 09:38:40 +0200")
> Indentation doesn't work properly when using inline variable
> introduced by Delphi 10.3 (using Emacs 26.2, opascal,
> opascal-indent-level is 3):
>
> for i := 0 to str.Length - 1 do
> Write (str.Chars[i]);
>
> for var i := 0 to str.Length - 1 do
> Write (str.Chars[i]);
I just pushed the patch below which seems to fix it.
Stefan
diff --git a/lisp/progmodes/opascal.el b/lisp/progmodes/opascal.el
index 7d51816bf4..9bb62ced3b 100644
--- a/lisp/progmodes/opascal.el
+++ b/lisp/progmodes/opascal.el
@@ -1177,8 +1177,11 @@ opascal-enclosing-indent-of
(throw 'done (opascal-stmt-line-indent-of
(or last-token token) opascal-indent-level)))
- ;; We indent relative to an enclosing declaration section.
- ((opascal-is token-kind opascal-decl-sections)
+ ;; We indent relative to an enclosing declaration section,
+ ;; unless this is within the a delimited expression
+ ;; (bug#36348).
+ ((and (not expr-delimited)
+ (opascal-is token-kind opascal-decl-sections))
(throw 'done (opascal-indent-of (if last-token last-token token)
opascal-indent-level)))
prev parent reply other threads:[~2019-07-22 17:12 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-24 7:38 bug#36348: 26.2; Indentation problem with Delphi inline variables Pascal Quesseveur
2019-06-24 13:45 ` Stefan Monnier
2019-07-22 17:12 ` Stefan Monnier [this message]
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=jwvr26ivvtt.fsf-monnier+emacs@gnu.org \
--to=monnier@iro.umontreal.ca \
--cc=36348-done@debbugs.gnu.org \
--cc=pquessev@gmail.com \
/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.