unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Thibaut <madtibo@yahoo.co.uk>
To: 20617@debbugs.gnu.org
Subject: bug#20617: 23.4; sh-script.el indentation for "main" function
Date: Wed, 20 May 2015 16:35:53 +0000 (UTC)	[thread overview]
Message-ID: <2045575880.4837107.1432139753060.JavaMail.yahoo@mail.yahoo.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1029 bytes --]

  When indenting sh script in "Shell-script" mode, I have this very strange behaviour with the funtion named 'main'
  It indent on more time the line in the function AND the line after the function!

example:---------------------------1: main( ) {
2:    echo "usage: $1"3:    exit 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

toto( ) {
    echo "usage: $1"
    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 $*
---------------------------  
I looked in the file: http://repo.or.cz/w/emacs.git/blob/HEAD:/lisp/progmodes/sh-script.elBut could not find a specific processing of the 'main' function.
Longue Vie au Gnou!




[-- Attachment #2: Type: text/html, Size: 3760 bytes --]

             reply	other threads:[~2015-05-20 16:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-20 16:35 Thibaut [this message]
2015-05-20 16:54 ` bug#20617: 23.4; sh-script.el indentation for "main" function Glenn Morris

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2045575880.4837107.1432139753060.JavaMail.yahoo@mail.yahoo.com \
    --to=madtibo@yahoo.co.uk \
    --cc=20617@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).