GNU bug report logs - #43799
27.1; AWK wrong switch-case indentation

Previous Next

Package: emacs;

Reported by: Mauro Panigada <shintakezou <at> gmail.com>

Date: Sun, 4 Oct 2020 17:38:03 UTC

Severity: normal

Found in version 27.1

Fixed in version 29.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 43799 in the body.
You can then email your comments to 43799 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#43799; Package emacs. (Sun, 04 Oct 2020 17:38:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Mauro Panigada <shintakezou <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 04 Oct 2020 17:38:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Mauro Panigada <shintakezou <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 27.1; AWK wrong switch-case indentation
Date: Sun, 4 Oct 2020 15:13:13 +0200
[Message part 1 (text/plain, inline)]
In AWK mode, switch's cases get indented as statement of the previous
case, instead of being "aligned" with the first case line. We end up
having something like

   switch($1)
   {
      case "a":
         things()
         break

         case "b":
            hello = 0
            break

            case "bye":
               indent_again = 1
               break

               # ....
   }



In GNU Emacs 27.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.12)
 of 2020-08-30 built on Mister-X
Windowing system distributor 'The X.Org Foundation', version 11.0.12005000
System Description: Ubuntu 19.10

Recent messages:
Mark saved where search started
(New file)
Making completion list...
next-line: End of buffer
Making completion list...
Auto-saving...done
previous-line: Beginning of buffer [2 times]
Making completion list... [2 times]
user-error: End of history; no default available
delete-backward-char: Text is read-only

Configured using:
 'configure --prefix=/home/user/.local/ 'CFLAGS=-mtune=corei7 -O3 -mavx2
 -msse4.2''

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

Important settings:
  value of $LC_MONETARY: it_IT.UTF-8
  value of $LC_NUMERIC: en_DK.UTF-8
  value of $LC_TIME: en_DK.UTF-8
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: @im=ibus
  locale-coding-system: utf-8-unix

Major mode: AWK//l

Minor modes in effect:
  delete-selection-mode: t
  show-paren-mode: t
  cua-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-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
  line-number-mode: t
  transient-mark-mode: t
  abbrev-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug sendmail mm-archive mule-util gnutls
network-stream url-http url-gw nsm url-cache url-auth cua-rect rect
misearch multi-isearch cc-awk cc-mode cc-fonts cc-guess cc-menus cc-cmds
cc-styles cc-align cc-engine cc-vars cc-defs markdown-mode color
thingatpt view org-element avl-tree generator ol-eww ol-rmail ol-mhe
ol-irc ol-info ol-gnus nnir gnus-sum url url-proxy url-privacy
url-expand url-methods url-history mailcap shr url-cookie url-domsuf
url-util svg xml dom gnus-group gnus-undo gnus-start gnus-cloud nnimap
nnmail mail-source utf7 netrc nnoo parse-time iso8601 gnus-spec gnus-int
gnus-range message rmc puny rfc822 mml mml-sec epa derived epg
epg-config mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev
gmm-utils mailheader gnus-win gnus nnheader gnus-util rmail
rmail-loaddefs rfc2047 rfc2045 ietf-drums text-property-search
mail-utils mm-util mail-prsvr wid-edit ol-docview doc-view jka-compr
image-mode exif dired dired-loaddefs ol-bibtex bibtex ol-bbdb ol-w3m org
ob ob-tangle ob-ref ob-lob ob-table ob-exp org-macro org-footnote
org-src ob-comint org-pcomplete pcomplete comint ansi-color ring
org-list org-faces org-entities time-date noutline outline easy-mmode
org-version ob-emacs-lisp ob-core ob-eval org-table ol org-keys
org-compat advice org-macs org-loaddefs format-spec find-func cal-menu
calendar cal-loaddefs perl6-detect leuven-theme delsel paren cua-base
cus-start cus-load finder-inf rx info package easymenu browse-url
url-handlers url-parse auth-source cl-seq eieio eieio-core cl-macs
eieio-loaddefs password-cache json subr-x map url-vars seq byte-opt gv
bytecomp byte-compile cconv cl-loaddefs cl-lib 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 tab-bar menu-bar rfn-eshadow isearch timer
select scroll-bar mouse jit-lock font-lock syntax facemenu font-core
term/tty-colors frame minibuffer 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 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 move-toolbar gtk x-toolkit x
multi-tty make-network-process emacs)

Memory information:
((conses 16 323421 26493)
 (symbols 48 24386 2)
 (strings 32 95162 7634)
 (string-bytes 1 2959769)
 (vectors 16 35946)
 (vector-slots 8 416297 26914)
 (floats 8 399 312)
 (intervals 56 11341 466)
 (buffers 1000 28))


-- 
*Mauro Panigada*
https://www.mauropanigada.net
http://shintakezou.blogspot.com
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#43799; Package emacs. (Mon, 06 Jun 2022 16:25:01 GMT) Full text and rfc822 format available.

Message #8 received at 43799 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Mauro Panigada <shintakezou <at> gmail.com>
Cc: 43799 <at> debbugs.gnu.org
Subject: Re: bug#43799: 27.1; AWK wrong switch-case indentation
Date: Mon, 06 Jun 2022 18:24:09 +0200
Mauro Panigada <shintakezou <at> gmail.com> writes:

> In AWK mode, switch's cases get indented as statement of the previous
> case, instead of being "aligned" with the first case line. We end up
> having something like
>
>    switch($1)
>    {
>       case "a":
>          things()
>          break
>
>          case "b":
>             hello = 0
>             break
>
>             case "bye":
>                indent_again = 1
>                break
>
>                # ....            
>    }

(I'm going through old bug reports that unfortunately weren't resolved
at the time.)

I can reproduce this in Emacs 27.1, but not in Emacs 29, so it seems
like this has been fixed in the time since this was reported, and I'm
therefore closing this bug report.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




bug marked as fixed in version 29.1, send any further explanations to 43799 <at> debbugs.gnu.org and Mauro Panigada <shintakezou <at> gmail.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Mon, 06 Jun 2022 16:25:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 05 Jul 2022 11:24:14 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 295 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.