From unknown Fri Sep 05 11:00:48 2025 X-Loop: help-debbugs@gnu.org Subject: bug#20617: 23.4; sh-script.el indentation for "main" function Resent-From: Thibaut Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 20 May 2015 16:47:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 20617 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 20617@debbugs.gnu.org X-Debbugs-Original-To: "bug-gnu-emacs@gnu.org" Reply-To: Thibaut Received: via spool by submit@debbugs.gnu.org id=B.143214041021941 (code B ref -1); Wed, 20 May 2015 16:47:02 +0000 Received: (at submit) by debbugs.gnu.org; 20 May 2015 16:46:50 +0000 Received: from localhost ([127.0.0.1]:51450 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Yv78r-0005hl-4r for submit@debbugs.gnu.org; Wed, 20 May 2015 12:46:50 -0400 Received: from eggs.gnu.org ([208.118.235.92]:55056) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Yv6yd-00056s-CF for submit@debbugs.gnu.org; Wed, 20 May 2015 12:36:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yv6yQ-0002Cp-66 for submit@debbugs.gnu.org; Wed, 20 May 2015 12:36:10 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM, HTML_MESSAGE,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:52038) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yv6yQ-0002Ce-2o for submit@debbugs.gnu.org; Wed, 20 May 2015 12:36:02 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40296) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yv6yO-0000tv-SB for bug-gnu-emacs@gnu.org; Wed, 20 May 2015 12:36:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yv6yK-0002BY-Pj for bug-gnu-emacs@gnu.org; Wed, 20 May 2015 12:36:00 -0400 Received: from nm7-vm7.bullet.mail.gq1.yahoo.com ([98.136.218.214]:41797) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yv6yK-0002B9-8d for bug-gnu-emacs@gnu.org; Wed, 20 May 2015 12:35:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s2048; t=1432139754; bh=laxJCSLXKqYJAzcNO92p7BnD1SOy87ajU9NZf84kw5Y=; h=Date:From:Reply-To:To:Subject:From:Subject; b=nFZKvRP2lNBjYt3IkbxRf8CmlJHa5FnihTGtQNoyVZkszsAQNoGvVodLb7kKFvVoOfWnNHCVc77ZVvnPCVNKNPeY5XQIjtEZDSLmPhCtGr5dZnQxohiWyIPPtpe3R16Zh5vBIQvCNRxP4RDt+zrr4hJCpZNsJAlhNN8SCZNcSuXRSCEb/Zm8b2XVdoK+5d0AvgPKK553UhPE9oEtD6/Z9WvdNf6Sr85m9vukhoWxCTT19H2s0Ybd7hQr1fXBlDa6+LbmSguajUq1RYSy3Qxp+ROXPKVF1dH7PdlQ06MuVd+cAPG0NpHxfcRBiQ5y+ifQcWlN0/WyDWv8pjUg0CjBQg== Received: from [216.39.60.180] by nm7.bullet.mail.gq1.yahoo.com with NNFMP; 20 May 2015 16:35:54 -0000 Received: from [212.82.98.96] by tm16.bullet.mail.gq1.yahoo.com with NNFMP; 20 May 2015 16:35:54 -0000 Received: from [127.0.0.1] by omp1033.mail.ir2.yahoo.com with NNFMP; 20 May 2015 16:35:54 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 56783.98553.bm@omp1033.mail.ir2.yahoo.com X-YMail-OSG: H1ARnh0VM1lK0rKwe_9u8mH.Fmux7nZ3IXCW.ybKpuNWVYGgEzaAPKEdz70aAm2 A.W3tNrBV5ySm_LRJYCOkoX1PLlLvlv85C1.xDuwSZClVLGLUBIJKPJuJ9g_Xz2pCK3s5NrLbu76 d0ujejUM7fOGFBGI3.tzlXO_xp6KMdDfzOPT8DHlijT_rR6lCAsZB7x0VxiVItiRFg6NeNADMv9W Nlpr8bmwws6Dp6CqmVg1KaFMO9ZP3mr7ufYcf9EMBppraxAKUbIgZ9ELX8Z8NSpfeDgNqEKgHs5w U9sPsPnJRRxzJiQeBrpH8VmjMB0niDunOu_1AP2q3xLc36tIQwZjMrsKTEmPG5FVHeLTfYW5xftH F0_8mnhRORSveui35FKfxraga8xlrynKYcv2FMoj9wrEonU.9B3SlN2iSk36CAJrXPgsR8mMwYC4 hWqMorXaNM1Mhsg8BQRtBAv4BwQZcUeaMAWiChd2999aTgf3DJActAKaQsi14bbhD7mJ5Mye4hkf hJY7jsBY- Received: by 212.82.98.115; Wed, 20 May 2015 16:35:53 +0000 Date: Wed, 20 May 2015 16:35:53 +0000 (UTC) From: Thibaut Message-ID: <2045575880.4837107.1432139753060.JavaMail.yahoo@mail.yahoo.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_4837106_38641287.1432139753056" Content-Length: 5539 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Mailman-Approved-At: Wed, 20 May 2015 12:46:47 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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: -5.0 (-----) ------=_Part_4837106_38641287.1432139753056 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable =C2=A0 When indenting sh script in "Shell-script" mode, I have this very st= range behaviour with the funtion named 'main' =C2=A0 It indent on more time the line in the function AND the line after t= he function! example:---------------------------1: main( ) { 2: =C2=A0=C2=A0 echo "usage: $1"3: =C2=A0=C2=A0 exit 0 4: =C2=A0=C2=A0 } 5: =C2=A0=C2=A0=20 6: =C2=A0=C2=A0 main $* ---------------------------(for lines 2 and 3 I have one Tab, for lines 4 t= o 6, I have 4 spaces) It does not do the same with an other function name of 4 letters. ---------------------------=20 =C2=A0#!/bin/sh toto( ) { =C2=A0=C2=A0=C2=A0 echo "usage: $1" =C2=A0=C2=A0=C2=A0 exit 0 } toto $* ---------------------------=C2=A0And if I add a parameter, the behaviour ch= anges back to normal... ---------------------------#!/bin/sh main( nil ) { =C2=A0=C2=A0=C2=A0 echo "usage: $1" =C2=A0=C2=A0=C2=A0 exit 0 } main $* ---------------------------=C2=A0=20 I looked in the file: http://repo.or.cz/w/emacs.git/blob/HEAD:/lisp/progmod= es/sh-script.elBut could not find a specific processing of the 'main' funct= ion. Longue Vie au Gnou! ------=_Part_4837106_38641287.1432139753056 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
  When indenting sh script in "Shell-script" mode, I hav= e this very strange behaviour with the funtion named 'main'
  It in= dent on more time the line in the function AND the line after the function!=

example:
---------------------------
1: = main( ) {
2:    echo "usage: $1"
3:    exi= t 0
4:    }
5: =   
6:    main $*
---------------------------
(for lines 2 and 3 I have one Tab,= for lines 4 to 6, I have 4 spaces)


It does not do the same with an other function name of 4 letters.=
---------------------------
 #!/bin/sh<= br style=3D"" class=3D"">
toto( ) {
    echo "usage: $1"
&nb= sp;   exit 0
}
=
toto $*
-----= ----------------------
 
And if I add a parameter,= the behaviour changes back to normal...
---------= ------------------
#!/bin/sh

main( nil ) {
    = echo "usage: $1"
    exit 0
}

main= $*
---------------------------
 
But could not find a specific processing of th= e 'main' function.

Longue Vie au Gnou!


------=_Part_4837106_38641287.1432139753056-- From unknown Fri Sep 05 11:00:48 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.503 (Entity 5.503) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Thibaut Subject: bug#20617: closed (Re: bug#20617: 23.4; sh-script.el indentation for "main" function) Message-ID: References: <76mw0zjik1.fsf@fencepost.gnu.org> <2045575880.4837107.1432139753060.JavaMail.yahoo@mail.yahoo.com> X-Gnu-PR-Message: they-closed 20617 X-Gnu-PR-Package: emacs Reply-To: 20617@debbugs.gnu.org Date: Wed, 20 May 2015 16:55:03 +0000 Content-Type: multipart/mixed; boundary="----------=_1432140903-23702-1" This is a multi-part message in MIME format... ------------=_1432140903-23702-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #20617: 23.4; sh-script.el indentation for "main" function 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 20617@debbugs.gnu.org. --=20 20617: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D20617 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1432140903-23702-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 20617-done) by debbugs.gnu.org; 20 May 2015 16:54:43 +0000 Received: from localhost ([127.0.0.1]:51455 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Yv7GV-000692-1w for submit@debbugs.gnu.org; Wed, 20 May 2015 12:54:43 -0400 Received: from fencepost.gnu.org ([208.118.235.10]:46017 ident=Debian-exim) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Yv7GT-00068r-5U for 20617-done@debbugs.gnu.org; Wed, 20 May 2015 12:54:41 -0400 Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1Yv7GR-0004mk-Dl; Wed, 20 May 2015 12:54:39 -0400 From: Glenn Morris To: 20617-done@debbugs.gnu.org Subject: Re: bug#20617: 23.4; sh-script.el indentation for "main" function References: <2045575880.4837107.1432139753060.JavaMail.yahoo@mail.yahoo.com> X-Spook: underground AVN Mena Soviet blackjack world domination X-Ran: 'F!n,@q%HXQ]r6qivDJK.YtUPS3*`01K+~#,62CIut/.>B8W]v"pgCj}iiqg6`wnn6h(+\ X-Hue: blue X-Debbugs-No-Ack: yes X-Attribution: GM Date: Wed, 20 May 2015 12:54:38 -0400 In-Reply-To: <2045575880.4837107.1432139753060.JavaMail.yahoo@mail.yahoo.com> (Thibaut's message of "Wed, 20 May 2015 16:35:53 +0000 (UTC)") Message-ID: <76mw0zjik1.fsf@fencepost.gnu.org> User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -4.3 (----) X-Debbugs-Envelope-To: 20617-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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: -4.3 (----) Version: 24.1 Thibaut wrote: > =C2=A0 When indenting sh script in "Shell-script" mode, I have this very > strange behaviour with the funtion named 'main' > =C2=A0 It indent on more time the line in the function AND the line after > the function! > > example:---------------------------1: main( ) { > 2: =C2=A0=C2=A0 echo "usage: $1"3: =C2=A0=C2=A0 exit 0 > 4: =C2=A0=C2=A0 } > 5: =C2=A0=C2=A0=20 > 6: =C2=A0=C2=A0 main $* > ---------------------------(for lines 2 and 3 I have one Tab, for lines 4= to 6, I have 4 spaces) Thanks for the report. By experiment, this was fixed in Emacs 24.1. Please upgrade (current is 24.5). ------------=_1432140903-23702-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 20 May 2015 16:46:50 +0000 Received: from localhost ([127.0.0.1]:51450 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Yv78r-0005hl-4r for submit@debbugs.gnu.org; Wed, 20 May 2015 12:46:50 -0400 Received: from eggs.gnu.org ([208.118.235.92]:55056) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Yv6yd-00056s-CF for submit@debbugs.gnu.org; Wed, 20 May 2015 12:36:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yv6yQ-0002Cp-66 for submit@debbugs.gnu.org; Wed, 20 May 2015 12:36:10 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM, HTML_MESSAGE,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:52038) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yv6yQ-0002Ce-2o for submit@debbugs.gnu.org; Wed, 20 May 2015 12:36:02 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40296) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yv6yO-0000tv-SB for bug-gnu-emacs@gnu.org; Wed, 20 May 2015 12:36:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yv6yK-0002BY-Pj for bug-gnu-emacs@gnu.org; Wed, 20 May 2015 12:36:00 -0400 Received: from nm7-vm7.bullet.mail.gq1.yahoo.com ([98.136.218.214]:41797) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yv6yK-0002B9-8d for bug-gnu-emacs@gnu.org; Wed, 20 May 2015 12:35:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s2048; t=1432139754; bh=laxJCSLXKqYJAzcNO92p7BnD1SOy87ajU9NZf84kw5Y=; h=Date:From:Reply-To:To:Subject:From:Subject; b=nFZKvRP2lNBjYt3IkbxRf8CmlJHa5FnihTGtQNoyVZkszsAQNoGvVodLb7kKFvVoOfWnNHCVc77ZVvnPCVNKNPeY5XQIjtEZDSLmPhCtGr5dZnQxohiWyIPPtpe3R16Zh5vBIQvCNRxP4RDt+zrr4hJCpZNsJAlhNN8SCZNcSuXRSCEb/Zm8b2XVdoK+5d0AvgPKK553UhPE9oEtD6/Z9WvdNf6Sr85m9vukhoWxCTT19H2s0Ybd7hQr1fXBlDa6+LbmSguajUq1RYSy3Qxp+ROXPKVF1dH7PdlQ06MuVd+cAPG0NpHxfcRBiQ5y+ifQcWlN0/WyDWv8pjUg0CjBQg== Received: from [216.39.60.180] by nm7.bullet.mail.gq1.yahoo.com with NNFMP; 20 May 2015 16:35:54 -0000 Received: from [212.82.98.96] by tm16.bullet.mail.gq1.yahoo.com with NNFMP; 20 May 2015 16:35:54 -0000 Received: from [127.0.0.1] by omp1033.mail.ir2.yahoo.com with NNFMP; 20 May 2015 16:35:54 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 56783.98553.bm@omp1033.mail.ir2.yahoo.com X-YMail-OSG: H1ARnh0VM1lK0rKwe_9u8mH.Fmux7nZ3IXCW.ybKpuNWVYGgEzaAPKEdz70aAm2 A.W3tNrBV5ySm_LRJYCOkoX1PLlLvlv85C1.xDuwSZClVLGLUBIJKPJuJ9g_Xz2pCK3s5NrLbu76 d0ujejUM7fOGFBGI3.tzlXO_xp6KMdDfzOPT8DHlijT_rR6lCAsZB7x0VxiVItiRFg6NeNADMv9W Nlpr8bmwws6Dp6CqmVg1KaFMO9ZP3mr7ufYcf9EMBppraxAKUbIgZ9ELX8Z8NSpfeDgNqEKgHs5w U9sPsPnJRRxzJiQeBrpH8VmjMB0niDunOu_1AP2q3xLc36tIQwZjMrsKTEmPG5FVHeLTfYW5xftH F0_8mnhRORSveui35FKfxraga8xlrynKYcv2FMoj9wrEonU.9B3SlN2iSk36CAJrXPgsR8mMwYC4 hWqMorXaNM1Mhsg8BQRtBAv4BwQZcUeaMAWiChd2999aTgf3DJActAKaQsi14bbhD7mJ5Mye4hkf hJY7jsBY- Received: by 212.82.98.115; Wed, 20 May 2015 16:35:53 +0000 Date: Wed, 20 May 2015 16:35:53 +0000 (UTC) From: Thibaut To: "bug-gnu-emacs@gnu.org" Message-ID: <2045575880.4837107.1432139753060.JavaMail.yahoo@mail.yahoo.com> Subject: 23.4; sh-script.el indentation for "main" function MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_4837106_38641287.1432139753056" Content-Length: 5539 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Wed, 20 May 2015 12:46:47 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Thibaut 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: -5.0 (-----) ------=_Part_4837106_38641287.1432139753056 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable =C2=A0 When indenting sh script in "Shell-script" mode, I have this very st= range behaviour with the funtion named 'main' =C2=A0 It indent on more time the line in the function AND the line after t= he function! example:---------------------------1: main( ) { 2: =C2=A0=C2=A0 echo "usage: $1"3: =C2=A0=C2=A0 exit 0 4: =C2=A0=C2=A0 } 5: =C2=A0=C2=A0=20 6: =C2=A0=C2=A0 main $* ---------------------------(for lines 2 and 3 I have one Tab, for lines 4 t= o 6, I have 4 spaces) It does not do the same with an other function name of 4 letters. ---------------------------=20 =C2=A0#!/bin/sh toto( ) { =C2=A0=C2=A0=C2=A0 echo "usage: $1" =C2=A0=C2=A0=C2=A0 exit 0 } toto $* ---------------------------=C2=A0And if I add a parameter, the behaviour ch= anges back to normal... ---------------------------#!/bin/sh main( nil ) { =C2=A0=C2=A0=C2=A0 echo "usage: $1" =C2=A0=C2=A0=C2=A0 exit 0 } main $* ---------------------------=C2=A0=20 I looked in the file: http://repo.or.cz/w/emacs.git/blob/HEAD:/lisp/progmod= es/sh-script.elBut could not find a specific processing of the 'main' funct= ion. Longue Vie au Gnou! ------=_Part_4837106_38641287.1432139753056 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
  When indenting sh script in "Shell-script" mode, I hav= e this very strange behaviour with the funtion named 'main'
  It in= dent on more time the line in the function AND the line after the function!=

example:
---------------------------
1: = main( ) {
2:    echo "usage: $1"
3:    exi= t 0
4:    }
5: =   
6:    main $*
---------------------------
(for lines 2 and 3 I have one Tab,= for lines 4 to 6, I have 4 spaces)


It does not do the same with an other function name of 4 letters.=
---------------------------
 #!/bin/sh<= br style=3D"" class=3D"">
toto( ) {
    echo "usage: $1"
&nb= sp;   exit 0
}
=
toto $*
-----= ----------------------
 
And if I add a parameter,= the behaviour changes back to normal...
---------= ------------------
#!/bin/sh

main( nil ) {
    = echo "usage: $1"
    exit 0
}

main= $*
---------------------------
 
But could not find a specific processing of th= e 'main' function.

Longue Vie au Gnou!


------=_Part_4837106_38641287.1432139753056-- ------------=_1432140903-23702-1--