unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* sh-basic-offset help?
@ 2005-09-22 16:12 Bruce Korb
  0 siblings, 0 replies; 3+ messages in thread
From: Bruce Korb @ 2005-09-22 16:12 UTC (permalink / raw)



Hi,

The shell script mode seems to be filled with so many offset
settings that I have trouble setting the offsets the way I
would like to have them set.  Is there a straight forward
way to find them all or else find a "master" setting that
the others can be derived from?

My preference is for "sh-basic-offset" and "sh-indentation"
to be 4.  So, I get:

> for x
>   do
>   statement
> done

Sure looks like 2 to me.  And what's with the indentation
of "do"?  do/done should line up, indented or not.  (I
would as soon not indent "do", but they must line up
either way.)  "if" seems to work okay, but:

> if test x
>     then
>     statement
> else
>     statement
> fi

Again, "then", "else" and "fi" ought to line up.

Hints about the magic, please?  :)  Thank you! - Bruce

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: sh-basic-offset help?
       [not found] <mailman.8074.1127406463.20277.help-gnu-emacs@gnu.org>
@ 2005-10-06  0:31 ` Will Parsons
  2005-10-06  4:01   ` Stefan Monnier
  0 siblings, 1 reply; 3+ messages in thread
From: Will Parsons @ 2005-10-06  0:31 UTC (permalink / raw)


Bruce Korb wrote:
>
> Hi,
>
> The shell script mode seems to be filled with so many offset
> settings that I have trouble setting the offsets the way I
> would like to have them set.  Is there a straight forward
> way to find them all or else find a "master" setting that
> the others can be derived from?
>
> My preference is for "sh-basic-offset" and "sh-indentation"
> to be 4.  So, I get:
>
>> for x
>>   do
>>   statement
>> done
>
> Sure looks like 2 to me.  And what's with the indentation
> of "do"?  do/done should line up, indented or not.  (I
> would as soon not indent "do", but they must line up
> either way.)  "if" seems to work okay, but:
>
>> if test x
>>     then
>>     statement
>> else
>>     statement
>> fi
>
> Again, "then", "else" and "fi" ought to line up.
>
> Hints about the magic, please?  :)  Thank you! - Bruce

I've tried to find a solution to this and failed.  I've been looking
for some sort of response to this, but none has appeared.  My sole 
purpose in responding is to indicate that more than one person can't 
get shell mode to do the right thing - surely someone must be using 
Emacs for writing shell scripts!

- Will

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: sh-basic-offset help?
  2005-10-06  0:31 ` Will Parsons
@ 2005-10-06  4:01   ` Stefan Monnier
  0 siblings, 0 replies; 3+ messages in thread
From: Stefan Monnier @ 2005-10-06  4:01 UTC (permalink / raw)


> I've tried to find a solution to this and failed.  I've been looking
> for some sort of response to this, but none has appeared.  My sole 
> purpose in responding is to indicate that more than one person can't 
> get shell mode to do the right thing - surely someone must be using 
> Emacs for writing shell scripts!

With Emacs-CVS, I get the following which looks OK to me:

  for f in *
  do
      sdfg
  done

  if swrgfef
  then blas
  else sdf
  fi

IIRC the indentation code hasn't really changed, only the default settings,
so you should be able to get basically the same behavior by fiddling with
the sh-indent-* custom vars.


        Stefan

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-10-06  4:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-09-22 16:12 sh-basic-offset help? Bruce Korb
     [not found] <mailman.8074.1127406463.20277.help-gnu-emacs@gnu.org>
2005-10-06  0:31 ` Will Parsons
2005-10-06  4:01   ` Stefan Monnier

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