GNU bug report logs -
#36348
26.2; Indentation problem with Delphi inline variables
Previous Next
Reported by: Pascal Quesseveur <pquessev <at> gmail.com>
Date: Mon, 24 Jun 2019 07:39:02 UTC
Severity: minor
Found in version 26.2
Done: Stefan Monnier <monnier <at> iro.umontreal.ca>
Bug is archived. No further changes may be made.
Full log
Message #13 received at 36348-done <at> debbugs.gnu.org (full text, mbox):
> 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)))
This bug report was last modified 5 years and 309 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.