Subject: bug#36348: closed (Re: bug#36348: 26.2; Indentation problem with Delphi inline variables)

From: [email-masked] (GNU bug Tracking System)
Date: Mon, 22 Jul 2019 17:13:03 +0000

Your bug report

#36348: 26.2; Indentation problem with Delphi inline variables

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
36348: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=36348
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#36348: 26.2; Indentation problem with Delphi inline variables
From: Stefan Monnier <[email-masked]>
To: Pascal Quesseveur <[email-masked]>
Cc: [email-masked]
Date: Mon, 22 Jul 2019 13:12:04 -0400
List-Id: <debbugs-submit.debbugs.gnu.org>

> 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)))

Subject: 26.2; Indentation problem with Delphi inline variables
From: Pascal Quesseveur <[email-masked]>
To: [email-masked]
Date: Mon, 24 Jun 2019 09:38:40 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

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]);

In GNU Emacs 26.2 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.22.30)
 of 2019-04-12 built on lgw01-amd64-060
Windowing system distributor 'The X.Org Foundation', version 11.0.11906000
System Description:	Ubuntu 18.04.2 LTS

Configured using:
 'configure --build=x86_64-linux-gnu --prefix=/usr
 '--includedir=${prefix}/include' '--mandir=${prefix}/share/man'
 '--infodir=${prefix}/share/info' --sysconfdir=/etc
 --localstatedir=/var --disable-silent-rules
 '--libdir=${prefix}/lib/x86_64-linux-gnu'
 '--libexecdir=${prefix}/lib/x86_64-linux-gnu'
 --disable-maintainer-mode --disable-dependency-tracking --prefix=/usr
 --sharedstatedir=/var/lib --program-suffix=26 --with-modules
 --with-file-notification=inotify --with-mailutils --with-x=yes
 --with-x-toolkit=gtk3 --with-xwidgets --with-lcms2 'CFLAGS=-g -O2
 -fdebug-prefix-map=/build/emacs26-CYbeHB/emacs26-26.2~1.gitfd1b34b=. -fstack-protector-strong
 -Wformat -Werror=format-security -no-pie' 'CPPFLAGS=-Wdate-time
 -D_FORTIFY_SOURCE=2' 'LDFLAGS=-Wl,-Bsymbolic-functions -Wl,-z,relro
 -no-pie''

Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GSETTINGS GLIB
NOTIFY LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB
TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM MODULES THREADS XWIDGETS
LIBSYSTEMD LCMS2

Important settings:
  value of $LANG: fr_FR.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Summary

Minor modes in effect:
  display-time-mode: t
  shell-dirtrack-mode: t
  icomplete-mode: t
  auto-image-file-mode: t
  show-paren-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  buffer-read-only: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t

Load-path shadows:
/home/local/emacs-site/lisp/bbdb/bbdb-vcard-export hides /home/local/emacs-site/lisp/utils/bbdb-vcard-export
/usr/share/emacs/site-lisp/dictionaries-common/ispell hides /usr/share/emacs/26.2/lisp/textmodes/ispell
/usr/share/emacs/site-lisp/dictionaries-common/flyspell hides /usr/share/emacs/26.2/lisp/textmodes/flyspell

Features:
(shadow warnings emacsbug flow-fill url-http url-gw url-auth url-queue
url-cache gnus-fun mm-archive sort smiley gnus-cite gnus-bcklg
gnus-async qp gnus-ml disp-table gnus-topic nndraft nnmh gnus-agent
gnus-srvr gnus-score score-mode nnvirtual gnus-msg nnml utf-7 nnfolder
cl-extra help-mode gnus-cache network-stream nsm starttls gnus-demon
nntp elec-pair highlight-current-line color-theme time tumblesocks
tumblesocks-view tumblesocks-compose markdown-mode thingatpt noutline
outline htmlize tumblesocks-user tumblesocks-api json map oauth sasl
sasl-anonymous sasl-login sasl-plain hex-util hmac-sha1 shr svg xml
dom browse-url html2help footnote muse-odf muse-xml muse-help
muse-bbcode muse-blosxom muse-wiki muse-texinfo texnfo-upd texinfo
muse-latex muse-html muse-docbook muse-xml-common cus-edit cus-start
cus-load muse-publish muse-project muse-protocols muse-regexps muse
muse-nested-tags muse-mode u-vm-color org-import-icalendar icalendar
diary-lib diary-loaddefs bbdb-gnus gnus-art mm-uu mml2015 mm-view
mml-smime smime dig gnus-sum gnus-group gnus-undo gnus-start
gnus-cloud nnimap nnmail mail-source tls gnutls utf7 netrc nnoo
gnus-spec gnus-int gnus-range gnus-win gnus nnheader bbdb-snarf
mail-extr bbdb-com smtpmail sendmail message rmc puny dired-explore
dired-sort-menu wid-edit acid dired-arc file-op dired-x dired
dired-loaddefs rfc822 mml mml-sec gnus-util rmail rmail-loaddefs
mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045
mm-util ietf-drums mail-prsvr mailabbrev mail-utils gmm-utils
mailheader bbdb-vcard-export bbdb-export bbdb-autoloads bbdb timezone
tramp tramp-compat tramp-loaddefs trampver ucs-normalize shell
pcomplete parse-time format-spec which idb gud comint ansi-color ring
jsee javadoc-lookup ido seq jserial jswat qproj-java jdok tempo url
url-proxy url-privacy url-expand url-methods url-history url-cookie
url-domsuf url-util url-parse auth-source eieio byte-opt bytecomp
byte-compile cconv eieio-core eieio-loaddefs password-cache url-vars
mailcap xml-parse doxymacs qproj-cpp qproj server dos-indent generic
generic-x cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles
cc-align cc-engine cc-vars cc-defs w3m-load lunar solar cal-dst
cal-tex cal-iso cal-menu calendar cal-loaddefs epa-file epa derived
epg epg-config preview prv-emacs info reporter desktop frameset latex
tex-buf tex font-latex tex-site ps-mule ipp cl-seq cl-macs cl gv
easymenu printing ps-print ps-print-loaddefs ps-def lpr genconv
icomplete+ easy-mmode icomplete edmacro kmacro cl-loaddefs cl-lib
advice image-file paren time-date mule-util tooltip eldoc electric
uniquify ediff-hook vc-hooks lisp-float-type mwheel term/x-win x-win
term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe
tabulated-list replace newcomment text-mode elisp-mode lisp-mode
prog-mode register page menu-bar rfn-eshadow isearch timer select
scroll-bar mouse jit-lock font-lock syntax facemenu font-core
term/tty-colors frame cl-generic cham georgian utf-8-lang misc-lang
vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932
hebrew greek romanian slovak czech european ethiopic indian cyrillic
chinese composite charscript charprop case-table epa-hook
jka-cmpr-hook help simple abbrev obarray minibuffer cl-preloaded
nadvice loaddefs button faces cus-face macroexp files text-properties
overlay sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote threads dbusbind inotify lcms2
dynamic-setting system-font-setting font-render-setting
xwidget-internal move-toolbar gtk x-toolkit x multi-tty
make-network-process emacs)

Memory information:
((conses 16 734770 64386)
 (symbols 48 112551 2)
 (miscs 40 1112 393)
 (strings 32 173012 10074)
 (string-bytes 1 6028761)
 (vectors 16 66422)
 (vector-slots 8 1165711 31400)
 (floats 8 1171 900)
 (intervals 56 928 423)
 (buffers 992 37))

-- 
Pascal Quesseveur