From unknown Sat Aug 16 23:47:11 2025 X-Loop: help-debbugs@gnu.org Subject: bug#61192: Emacs 28.1: Bash Shell Script Indenting does not recognize if, [....];then Resent-From: Stephen Montsaroff Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 31 Jan 2023 05:37:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 61192 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 61192@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Reply-To: stephm@pobox.com Received: via spool by submit@debbugs.gnu.org id=B.167514338113160 (code B ref -1); Tue, 31 Jan 2023 05:37:02 +0000 Received: (at submit) by debbugs.gnu.org; 31 Jan 2023 05:36:21 +0000 Received: from localhost ([127.0.0.1]:51136 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pMjJd-0003QA-2t for submit@debbugs.gnu.org; Tue, 31 Jan 2023 00:36:21 -0500 Received: from lists.gnu.org ([209.51.188.17]:37440) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pMcQA-0000LZ-7Y for submit@debbugs.gnu.org; Mon, 30 Jan 2023 17:14:38 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pMcQA-0004JS-0y for bug-gnu-emacs@gnu.org; Mon, 30 Jan 2023 17:14:38 -0500 Received: from pb-smtp1.pobox.com ([64.147.108.70]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pMcQ7-0002O2-Sj for bug-gnu-emacs@gnu.org; Mon, 30 Jan 2023 17:14:37 -0500 Received: from pb-smtp1.pobox.com (unknown [127.0.0.1]) by pb-smtp1.pobox.com (Postfix) with ESMTP id E48DB182696 for ; Mon, 30 Jan 2023 17:14:34 -0500 (EST) (envelope-from stephm@pobox.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=pobox.com; h= content-type:message-id:date:mime-version:reply-to:from:to :subject; s=sasl; bh=TgUyTEZlgTx49iUSqg9ahFlmhUcPNK+wwkLV7m35uEs =; b=lnenNOajaRTDGabQHqoc8/PDYmdsGsLXrh/azdZ5sbMIRe6PQmP9O7cZsSf kwMSKEm+OwsqBCwrZBdt0YqDZeHfMgD/8V3YwniY9cb48p0cGOa2QbO+V6Qv5sOj SJSTUTgMThSkN50qeP6ZkbGlhZ5DQo2fYlfyHjkI594xTrIw= Received: from pb-smtp1.nyi.icgroup.com (unknown [127.0.0.1]) by pb-smtp1.pobox.com (Postfix) with ESMTP id DBD6E182695 for ; Mon, 30 Jan 2023 17:14:34 -0500 (EST) (envelope-from stephm@pobox.com) Received: from [161.55.244.76] (unknown [161.55.244.76]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pb-smtp1.pobox.com (Postfix) with ESMTPSA id 357F8182694 for ; Mon, 30 Jan 2023 17:14:34 -0500 (EST) (envelope-from stephm@pobox.com) Content-Type: multipart/alternative; boundary="------------ioTFPhfP2ZudkbWhCokbnqjE" Message-ID: <2cd38f68-a14c-6937-1356-c86be3232a0b@pobox.com> Date: Mon, 30 Jan 2023 14:14:32 -0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 Content-Language: en-US From: Stephen Montsaroff X-Pobox-Relay-ID: 7A037CF8-A0EB-11ED-A82D-2AEEC5D8090B-43920898!pb-smtp1.pobox.com Received-SPF: pass client-ip=64.147.108.70; envelope-from=stephm@pobox.com; helo=pb-smtp1.pobox.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.6 (-) X-Mailman-Approved-At: Tue, 31 Jan 2023 00:36:19 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.6 (--) This is a multi-part message in MIME format. --------------ioTFPhfP2ZudkbWhCokbnqjE Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Since upgrade to Emacs 28.1, I have noted an annoy change in shell-script mode auto-formatting. I would like to recover the old behavior Before, if I entered if [ "$x" =3D "" ];then =C2=A0=C2=A0=C2=A0 export x=3D$y fi and then enter new line, the new line would align with the fi if [ "$x" =3D "" ];then =C2=A0=C2=A0=C2=A0 export x=3D$y fi cp fred ethel Now it I do the same thing I get the new line indented if [ "$x" =3D "" ];then =C2=A0=C2=A0=C2=A0 export x=3D$y fi =C2=A0=C2=A0=C2=A0 cp fred ethel The matching code also does not recognize that the fi is connected to the then statement. This is not the case if I break the if into two lines or add a leading space to the ; if [ "$x" =3D "" ] then =C2=A0=C2=A0=C2=A0 export x=3D$y fi cp fred ethel if [ "$x" =3D "" ];then =C2=A0=C2=A0=C2=A0 export x=3D$y fi cp fred ethel In GNU Emacs 28.1 (build 2, x86_64-w64-mingw32) =C2=A0of 2022-04-21 built on AVALON Windowing system distributor 'Microsoft Corp.', version 10.0.19045 System Description: Microsoft Windows 10 Enterprise (v10.0.2009.19045.213= 0) Configured using: =C2=A0'configure --with-modules --without-dbus --with-native-compilation =C2=A0--without-compress-install CFLAGS=3D-O2' Configured features: ACL GIF GMP GNUTLS HARFBUZZ JPEG JSON LCMS2 LIBXML2 MODULES NATIVE_COMP NOTIFY W32NOTIFY PDUMPER PNG RSVG SOUND THREADS TIFF TOOLKIT_SCROLL_BARS XPM ZLIB (NATIVE_COMP present but libgccjit not available) Important settings: =C2=A0 value of $LC_CTYPE: en_US.UTF-8 =C2=A0 value of $LANG: ENU =C2=A0 locale-coding-system: cp1252 Major mode: Lisp Interaction Minor modes in effect: =C2=A0 tooltip-mode: t =C2=A0 global-eldoc-mode: t =C2=A0 eldoc-mode: t =C2=A0 show-paren-mode: t =C2=A0 electric-indent-mode: t =C2=A0 mouse-wheel-mode: t =C2=A0 tool-bar-mode: t =C2=A0 menu-bar-mode: t =C2=A0 file-name-shadow-mode: t =C2=A0 global-font-lock-mode: t =C2=A0 font-lock-mode: t =C2=A0 blink-cursor-mode: t =C2=A0 auto-composition-mode: t =C2=A0 auto-encryption-mode: t =C2=A0 auto-compression-mode: t =C2=A0 line-number-mode: t =C2=A0 indent-tabs-mode: t =C2=A0 transient-mark-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message rmc puny dired dired-loaddefs rfc822 mml mml-sec epa derived epg rfc6068 epg-config gnus-util rmail rmail-loaddefs auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs password-cache json map text-property-search seq byte-opt gv bytecomp byte-compile cconv mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils time-date subr-x cl-loaddefs cl-lib iso-transl tooltip eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel dos-w32 ls-lisp disp-table term/w32-win w32-win w32-vars term/common-win tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax 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 emoji-zwj charscript charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray cl-preloaded nadvice button loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote threads w32notify w32 lcms2 multi-tty make-network-process native-compile emacs) Memory information: ((conses 16 60127 6905) =C2=A0(symbols 48 7062 1) =C2=A0(strings 32 21734 2167) =C2=A0(string-bytes 1 718164) =C2=A0(vectors 16 14999) =C2=A0(vector-slots 8 258735 12590) =C2=A0(floats 8 23 303) =C2=A0(intervals 56 228 0) =C2=A0(buffers 992 10)) --------------ioTFPhfP2ZudkbWhCokbnqjE Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable


Since upgrade to Emacs 28.1, I have noted an annoy change in
shell-script mode auto-formatting.

I would like to recover the old behavior

Before, if I entered

if [ "$x" =3D "" ];then
=C2=A0=C2=A0=C2=A0 export x=3D$y
fi

and then enter new line, the new line would align with the fi

if [ "$x" =3D "" ];then
=C2=A0=C2=A0=C2=A0 export x=3D$y
fi
cp fred ethel

Now it I do the same thing I get the new line indented

if [ "$x" =3D "" ];then
=C2=A0=C2=A0=C2=A0 export x=3D$y
fi
=C2=A0=C2=A0=C2=A0 cp fred ethel

The matching code also does not recognize that the
fi is connected to the then statement.

This is not the case if I break the if into two lines or add a leading
space to the ;

if [ "$x" =3D "" ]
then
=C2=A0=C2=A0=C2=A0 export x=3D$y
fi
cp fred ethel

if [ "$x" =3D "" ];then
=C2=A0=C2=A0=C2=A0 export x=3D$y
fi
cp fred ethel





In GNU Emacs 28.1 (build 2, x86_64-w64-mingw32)
=C2=A0of 2022-04-21 built on AVALON
Windowing system distributor 'Microsoft Corp.', version 10.0.19045 System Description: Microsoft Windows 10 Enterprise (v10.0.2009.19045.2130)

Configured using:
=C2=A0'configure --with-modules --without-dbus --with-native-compilat= ion
=C2=A0--without-compress-install CFLAGS=3D-O2'

Configured features:
ACL GIF GMP GNUTLS HARFBUZZ JPEG JSON LCMS2 LIBXML2 MODULES NATIVE_COMP
NOTIFY W32NOTIFY PDUMPER PNG RSVG SOUND THREADS TIFF TOOLKIT_SCROLL_BARS
XPM ZLIB

(NATIVE_COMP present but libgccjit not available)

Important settings:
=C2=A0 value of $LC_CTYPE: en_US.UTF-8
=C2=A0 value of $LANG: ENU
=C2=A0 locale-coding-system: cp1252

Major mode: Lisp Interaction

Minor modes in effect:
=C2=A0 tooltip-mode: t
=C2=A0 global-eldoc-mode: t
=C2=A0 eldoc-mode: t
=C2=A0 show-paren-mode: t
=C2=A0 electric-indent-mode: t
=C2=A0 mouse-wheel-mode: t
=C2=A0 tool-bar-mode: t
=C2=A0 menu-bar-mode: t
=C2=A0 file-name-shadow-mode: t
=C2=A0 global-font-lock-mode: t
=C2=A0 font-lock-mode: t
=C2=A0 blink-cursor-mode: t
=C2=A0 auto-composition-mode: t
=C2=A0 auto-encryption-mode: t
=C2=A0 auto-compression-mode: t
=C2=A0 line-number-mode: t
=C2=A0 indent-tabs-mode: t
=C2=A0 transient-mark-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message rmc puny dired dired-loaddefs
rfc822 mml mml-sec epa derived epg rfc6068 epg-config gnus-util rmail
rmail-loaddefs auth-source cl-seq eieio eieio-core cl-macs
eieio-loaddefs password-cache json map text-property-search seq byte-opt
gv bytecomp byte-compile cconv mm-decode mm-bodies mm-encode mail-parse
rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045
ietf-drums mm-util mail-prsvr mail-utils time-date subr-x cl-loaddefs
cl-lib iso-transl tooltip eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel dos-w32 ls-lisp disp-table
term/w32-win w32-win w32-vars term/common-win tool-bar dnd fontset image
regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode
prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu
timer select scroll-bar mouse jit-lock font-lock syntax font-core
term/tty-colors frame minibuffer cl-generic cham georgian utf-8-lang<= br> misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms
cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite emoji-zwj charscript charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray cl-preloaded nadvice
button loaddefs faces cus-face macroexp files window text-properties<= br> overlay sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote threads w32notify w32 lcms2 multi-tty
make-network-process native-compile emacs)

Memory information:
((conses 16 60127 6905)
=C2=A0(symbols 48 7062 1)
=C2=A0(strings 32 21734 2167)
=C2=A0(string-bytes 1 718164)
=C2=A0(vectors 16 14999)
=C2=A0(vector-slots 8 258735 12590)
=C2=A0(floats 8 23 303)
=C2=A0(intervals 56 228 0)
=C2=A0(buffers 992 10))

--------------ioTFPhfP2ZudkbWhCokbnqjE-- From unknown Sat Aug 16 23:47:11 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: stephm@pobox.com Subject: bug#61192: closed (Re: bug#61192: Emacs 28.1: Bash Shell Script Indenting does not recognize if, [....]; then) Message-ID: References: <83cz6u3j5m.fsf@gnu.org> <2cd38f68-a14c-6937-1356-c86be3232a0b@pobox.com> X-Gnu-PR-Message: they-closed 61192 X-Gnu-PR-Package: emacs Reply-To: 61192@debbugs.gnu.org Date: Tue, 31 Jan 2023 13:54:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1675173242-29842-1" This is a multi-part message in MIME format... ------------=_1675173242-29842-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #61192: Emacs 28.1: Bash Shell Script Indenting does not recognize if, [...= .];then 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 61192@debbugs.gnu.org. --=20 61192: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D61192 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1675173242-29842-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 61192-done) by debbugs.gnu.org; 31 Jan 2023 13:53:22 +0000 Received: from localhost ([127.0.0.1]:51880 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pMr4b-0007kH-Mu for submit@debbugs.gnu.org; Tue, 31 Jan 2023 08:53:22 -0500 Received: from eggs.gnu.org ([209.51.188.92]:58886) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pMr4Y-0007k3-Tk for 61192-done@debbugs.gnu.org; Tue, 31 Jan 2023 08:53:20 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pMr4T-0008IC-IJ; Tue, 31 Jan 2023 08:53:13 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=+H60AZTaaRkszVLIyzzy4g5ddbTMk66MrFeFuGq2tXA=; b=K55y909POIcD HvbY6Nl6yCFK3Mm6dK8j1pgiUrb4cah1fWihZl8UF9dFJEWFxb9chX6a3xcjUol8XCiMSgJF+z9yW NqRwGk022vkeXJKgmBT489Z4dfA6uXiZ0/03iHi1/q8iDy/iU6oYY98Pb2onb54Vnb/Q5+Qg4g29M ZT1FrT4TnyDN/zf9iD2BY58cPoj6DvuQnUlpFQcxXbIAyTCHZfEhCFxjPXvj7+xucN6088Jtw+40k ODWAL+6FJg3zF3lzrGfrAV4SSQSs0fYl8H1sEZ8FcjrsYy0XGl2JA6Hj5tziWnQ1hzcdudKoZueWt mqg80hMjHNJe6Rjqwvvk1A==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pMr4T-00032w-0V; Tue, 31 Jan 2023 08:53:13 -0500 Date: Tue, 31 Jan 2023 15:53:09 +0200 Message-Id: <83cz6u3j5m.fsf@gnu.org> From: Eli Zaretskii To: stephm@pobox.com In-Reply-To: <2cd38f68-a14c-6937-1356-c86be3232a0b@pobox.com> (message from Stephen Montsaroff on Mon, 30 Jan 2023 14:14:32 -0800) Subject: Re: bug#61192: Emacs 28.1: Bash Shell Script Indenting does not recognize if, [....]; then References: <2cd38f68-a14c-6937-1356-c86be3232a0b@pobox.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 61192-done Cc: 61192-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Mon, 30 Jan 2023 14:14:32 -0800 > From: Stephen Montsaroff > > Since upgrade to Emacs 28.1, I have noted an annoy change in > shell-script mode auto-formatting. > > I would like to recover the old behavior > > Before, if I entered > > if [ "$x" = "" ];then > export x=$y > fi > > and then enter new line, the new line would align with the fi > > if [ "$x" = "" ];then > export x=$y > fi > cp fred ethel > > Now it I do the same thing I get the new line indented > > if [ "$x" = "" ];then > export x=$y > fi > cp fred ethel > > The matching code also does not recognize that the > fi is connected to the then statement. I can reproduce this in Emacs 28.1, but not in Emacs 28.2 and later. So I think we already fixed this bug; please upgrade. I'm therefore closing this bug. ------------=_1675173242-29842-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 31 Jan 2023 05:36:21 +0000 Received: from localhost ([127.0.0.1]:51136 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pMjJd-0003QA-2t for submit@debbugs.gnu.org; Tue, 31 Jan 2023 00:36:21 -0500 Received: from lists.gnu.org ([209.51.188.17]:37440) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pMcQA-0000LZ-7Y for submit@debbugs.gnu.org; Mon, 30 Jan 2023 17:14:38 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pMcQA-0004JS-0y for bug-gnu-emacs@gnu.org; Mon, 30 Jan 2023 17:14:38 -0500 Received: from pb-smtp1.pobox.com ([64.147.108.70]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pMcQ7-0002O2-Sj for bug-gnu-emacs@gnu.org; Mon, 30 Jan 2023 17:14:37 -0500 Received: from pb-smtp1.pobox.com (unknown [127.0.0.1]) by pb-smtp1.pobox.com (Postfix) with ESMTP id E48DB182696 for ; Mon, 30 Jan 2023 17:14:34 -0500 (EST) (envelope-from stephm@pobox.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=pobox.com; h= content-type:message-id:date:mime-version:reply-to:from:to :subject; s=sasl; bh=TgUyTEZlgTx49iUSqg9ahFlmhUcPNK+wwkLV7m35uEs =; b=lnenNOajaRTDGabQHqoc8/PDYmdsGsLXrh/azdZ5sbMIRe6PQmP9O7cZsSf kwMSKEm+OwsqBCwrZBdt0YqDZeHfMgD/8V3YwniY9cb48p0cGOa2QbO+V6Qv5sOj SJSTUTgMThSkN50qeP6ZkbGlhZ5DQo2fYlfyHjkI594xTrIw= Received: from pb-smtp1.nyi.icgroup.com (unknown [127.0.0.1]) by pb-smtp1.pobox.com (Postfix) with ESMTP id DBD6E182695 for ; Mon, 30 Jan 2023 17:14:34 -0500 (EST) (envelope-from stephm@pobox.com) Received: from [161.55.244.76] (unknown [161.55.244.76]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pb-smtp1.pobox.com (Postfix) with ESMTPSA id 357F8182694 for ; Mon, 30 Jan 2023 17:14:34 -0500 (EST) (envelope-from stephm@pobox.com) Content-Type: multipart/alternative; boundary="------------ioTFPhfP2ZudkbWhCokbnqjE" Message-ID: <2cd38f68-a14c-6937-1356-c86be3232a0b@pobox.com> Date: Mon, 30 Jan 2023 14:14:32 -0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 Content-Language: en-US From: Stephen Montsaroff To: bug-gnu-emacs@gnu.org Subject: Emacs 28.1: Bash Shell Script Indenting does not recognize if, [....];then X-Pobox-Relay-ID: 7A037CF8-A0EB-11ED-A82D-2AEEC5D8090B-43920898!pb-smtp1.pobox.com Received-SPF: pass client-ip=64.147.108.70; envelope-from=stephm@pobox.com; helo=pb-smtp1.pobox.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.6 (-) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Tue, 31 Jan 2023 00:36:19 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: stephm@pobox.com Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.6 (--) This is a multi-part message in MIME format. --------------ioTFPhfP2ZudkbWhCokbnqjE Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Since upgrade to Emacs 28.1, I have noted an annoy change in shell-script mode auto-formatting. I would like to recover the old behavior Before, if I entered if [ "$x" =3D "" ];then =C2=A0=C2=A0=C2=A0 export x=3D$y fi and then enter new line, the new line would align with the fi if [ "$x" =3D "" ];then =C2=A0=C2=A0=C2=A0 export x=3D$y fi cp fred ethel Now it I do the same thing I get the new line indented if [ "$x" =3D "" ];then =C2=A0=C2=A0=C2=A0 export x=3D$y fi =C2=A0=C2=A0=C2=A0 cp fred ethel The matching code also does not recognize that the fi is connected to the then statement. This is not the case if I break the if into two lines or add a leading space to the ; if [ "$x" =3D "" ] then =C2=A0=C2=A0=C2=A0 export x=3D$y fi cp fred ethel if [ "$x" =3D "" ];then =C2=A0=C2=A0=C2=A0 export x=3D$y fi cp fred ethel In GNU Emacs 28.1 (build 2, x86_64-w64-mingw32) =C2=A0of 2022-04-21 built on AVALON Windowing system distributor 'Microsoft Corp.', version 10.0.19045 System Description: Microsoft Windows 10 Enterprise (v10.0.2009.19045.213= 0) Configured using: =C2=A0'configure --with-modules --without-dbus --with-native-compilation =C2=A0--without-compress-install CFLAGS=3D-O2' Configured features: ACL GIF GMP GNUTLS HARFBUZZ JPEG JSON LCMS2 LIBXML2 MODULES NATIVE_COMP NOTIFY W32NOTIFY PDUMPER PNG RSVG SOUND THREADS TIFF TOOLKIT_SCROLL_BARS XPM ZLIB (NATIVE_COMP present but libgccjit not available) Important settings: =C2=A0 value of $LC_CTYPE: en_US.UTF-8 =C2=A0 value of $LANG: ENU =C2=A0 locale-coding-system: cp1252 Major mode: Lisp Interaction Minor modes in effect: =C2=A0 tooltip-mode: t =C2=A0 global-eldoc-mode: t =C2=A0 eldoc-mode: t =C2=A0 show-paren-mode: t =C2=A0 electric-indent-mode: t =C2=A0 mouse-wheel-mode: t =C2=A0 tool-bar-mode: t =C2=A0 menu-bar-mode: t =C2=A0 file-name-shadow-mode: t =C2=A0 global-font-lock-mode: t =C2=A0 font-lock-mode: t =C2=A0 blink-cursor-mode: t =C2=A0 auto-composition-mode: t =C2=A0 auto-encryption-mode: t =C2=A0 auto-compression-mode: t =C2=A0 line-number-mode: t =C2=A0 indent-tabs-mode: t =C2=A0 transient-mark-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message rmc puny dired dired-loaddefs rfc822 mml mml-sec epa derived epg rfc6068 epg-config gnus-util rmail rmail-loaddefs auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs password-cache json map text-property-search seq byte-opt gv bytecomp byte-compile cconv mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils time-date subr-x cl-loaddefs cl-lib iso-transl tooltip eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel dos-w32 ls-lisp disp-table term/w32-win w32-win w32-vars term/common-win tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax 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 emoji-zwj charscript charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray cl-preloaded nadvice button loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote threads w32notify w32 lcms2 multi-tty make-network-process native-compile emacs) Memory information: ((conses 16 60127 6905) =C2=A0(symbols 48 7062 1) =C2=A0(strings 32 21734 2167) =C2=A0(string-bytes 1 718164) =C2=A0(vectors 16 14999) =C2=A0(vector-slots 8 258735 12590) =C2=A0(floats 8 23 303) =C2=A0(intervals 56 228 0) =C2=A0(buffers 992 10)) --------------ioTFPhfP2ZudkbWhCokbnqjE Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable


Since upgrade to Emacs 28.1, I have noted an annoy change in
shell-script mode auto-formatting.

I would like to recover the old behavior

Before, if I entered

if [ "$x" =3D "" ];then
=C2=A0=C2=A0=C2=A0 export x=3D$y
fi

and then enter new line, the new line would align with the fi

if [ "$x" =3D "" ];then
=C2=A0=C2=A0=C2=A0 export x=3D$y
fi
cp fred ethel

Now it I do the same thing I get the new line indented

if [ "$x" =3D "" ];then
=C2=A0=C2=A0=C2=A0 export x=3D$y
fi
=C2=A0=C2=A0=C2=A0 cp fred ethel

The matching code also does not recognize that the
fi is connected to the then statement.

This is not the case if I break the if into two lines or add a leading
space to the ;

if [ "$x" =3D "" ]
then
=C2=A0=C2=A0=C2=A0 export x=3D$y
fi
cp fred ethel

if [ "$x" =3D "" ];then
=C2=A0=C2=A0=C2=A0 export x=3D$y
fi
cp fred ethel





In GNU Emacs 28.1 (build 2, x86_64-w64-mingw32)
=C2=A0of 2022-04-21 built on AVALON
Windowing system distributor 'Microsoft Corp.', version 10.0.19045 System Description: Microsoft Windows 10 Enterprise (v10.0.2009.19045.2130)

Configured using:
=C2=A0'configure --with-modules --without-dbus --with-native-compilat= ion
=C2=A0--without-compress-install CFLAGS=3D-O2'

Configured features:
ACL GIF GMP GNUTLS HARFBUZZ JPEG JSON LCMS2 LIBXML2 MODULES NATIVE_COMP
NOTIFY W32NOTIFY PDUMPER PNG RSVG SOUND THREADS TIFF TOOLKIT_SCROLL_BARS
XPM ZLIB

(NATIVE_COMP present but libgccjit not available)

Important settings:
=C2=A0 value of $LC_CTYPE: en_US.UTF-8
=C2=A0 value of $LANG: ENU
=C2=A0 locale-coding-system: cp1252

Major mode: Lisp Interaction

Minor modes in effect:
=C2=A0 tooltip-mode: t
=C2=A0 global-eldoc-mode: t
=C2=A0 eldoc-mode: t
=C2=A0 show-paren-mode: t
=C2=A0 electric-indent-mode: t
=C2=A0 mouse-wheel-mode: t
=C2=A0 tool-bar-mode: t
=C2=A0 menu-bar-mode: t
=C2=A0 file-name-shadow-mode: t
=C2=A0 global-font-lock-mode: t
=C2=A0 font-lock-mode: t
=C2=A0 blink-cursor-mode: t
=C2=A0 auto-composition-mode: t
=C2=A0 auto-encryption-mode: t
=C2=A0 auto-compression-mode: t
=C2=A0 line-number-mode: t
=C2=A0 indent-tabs-mode: t
=C2=A0 transient-mark-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message rmc puny dired dired-loaddefs
rfc822 mml mml-sec epa derived epg rfc6068 epg-config gnus-util rmail
rmail-loaddefs auth-source cl-seq eieio eieio-core cl-macs
eieio-loaddefs password-cache json map text-property-search seq byte-opt
gv bytecomp byte-compile cconv mm-decode mm-bodies mm-encode mail-parse
rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045
ietf-drums mm-util mail-prsvr mail-utils time-date subr-x cl-loaddefs
cl-lib iso-transl tooltip eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel dos-w32 ls-lisp disp-table
term/w32-win w32-win w32-vars term/common-win tool-bar dnd fontset image
regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode
prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu
timer select scroll-bar mouse jit-lock font-lock syntax font-core
term/tty-colors frame minibuffer cl-generic cham georgian utf-8-lang<= br> misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms
cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite emoji-zwj charscript charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray cl-preloaded nadvice
button loaddefs faces cus-face macroexp files window text-properties<= br> overlay sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote threads w32notify w32 lcms2 multi-tty
make-network-process native-compile emacs)

Memory information:
((conses 16 60127 6905)
=C2=A0(symbols 48 7062 1)
=C2=A0(strings 32 21734 2167)
=C2=A0(string-bytes 1 718164)
=C2=A0(vectors 16 14999)
=C2=A0(vector-slots 8 258735 12590)
=C2=A0(floats 8 23 303)
=C2=A0(intervals 56 228 0)
=C2=A0(buffers 992 10))

--------------ioTFPhfP2ZudkbWhCokbnqjE-- ------------=_1675173242-29842-1-- From unknown Sat Aug 16 23:47:11 2025 X-Loop: help-debbugs@gnu.org Subject: bug#61192: Emacs 28.1: Bash Shell Script Indenting does not recognize if, [....]; then Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 01 Feb 2023 18:29:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61192 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: stephm@pobox.com Cc: 61192@debbugs.gnu.org Received: via spool by 61192-submit@debbugs.gnu.org id=B61192.167527610325608 (code B ref 61192); Wed, 01 Feb 2023 18:29:01 +0000 Received: (at 61192) by debbugs.gnu.org; 1 Feb 2023 18:28:23 +0000 Received: from localhost ([127.0.0.1]:59846 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pNHqJ-0006ey-A2 for submit@debbugs.gnu.org; Wed, 01 Feb 2023 13:28:23 -0500 Received: from eggs.gnu.org ([209.51.188.92]:56270) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pNHqF-0006ee-6V for 61192@debbugs.gnu.org; Wed, 01 Feb 2023 13:28:21 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pNHq9-0006W6-Si; Wed, 01 Feb 2023 13:28:13 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=RPAgIo7c3Afuma0bJJc+w/KW9Dudet4uPcZQARbSHyU=; b=l5zPojuj/f08 2NtsG1DPm8F8toKRnnH+C69xucwgh2Nn+pB62gsB9bC4NhpzXQeRTq4JflDUQRiSsImu6AnHelu1x /60uv1gXu2HKCHxkOlX6DJypPGPZj3HkHDSAfCqrbTLPE3UEmvsfUV6OF78dISxvFZyKT/ZS69ljw gHltK4lKSTi+yOCvCBc0cnaIczHQt5D4ADBlGo7at8hlFywypphSWoQvYRLCl9hrS0CfpFmn3V2/b JXscqzkZgUBUKnts2Co5X9dZnG3PfSNGsRXBGNXMdcXUqqp5rSnY4+N4q70sE1ii/KyJO3vyqQuR/ WFGp27DmYoZxDPvac+pT4A==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pNHq9-0004B4-CF; Wed, 01 Feb 2023 13:28:13 -0500 Date: Wed, 01 Feb 2023 20:28:13 +0200 Message-Id: <83h6w5z1du.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: <9e8e9bc4-457b-0538-4c84-28d610e3ef34@pobox.com> (message from Stephen Montsaroff on Wed, 1 Feb 2023 09:49:36 -0800) References: <2cd38f68-a14c-6937-1356-c86be3232a0b@pobox.com> <83cz6u3j5m.fsf@gnu.org> <9e8e9bc4-457b-0538-4c84-28d610e3ef34@pobox.com> X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Wed, 1 Feb 2023 09:49:36 -0800 > From: Stephen Montsaroff > > I have been able to reproduce for emacs 28.2. Well, I cannot reproduce with Emacs 28.2, so it is strange that it happens for you in Emacs 28.2. Are you sure you don't have some stale files lurking somewhere and shadowing the files that came with Emacs 28.2? Does the problem happen in "emacs -Q" with Emacs 28.2?