help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: indentation - always a pita


From: Harry Putnam
Subject: Re: indentation - always a pita
Date: Thu, 26 Jun 2003 11:35:26 -0700
User-agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3.50 (gnu/linux)

> Try `sh-basic-offset' instead.  That's what I use.  I tried to
> format your example with the following result:

Thanks Jens, that does look a lot better. 
But one of the things I was after was so I could open the same files
with vim and not see radical changes.

I may have missed the boat on that.  In fact after testing a little
bit more it appears the only way both editors display the code ok is
if I leave emacs defaults in place.  But it seems like awfully deep
indentaition. 

I may never have actually left a shell script in default format.  So
what I was seeing in vim may have been of my own creation.

I wondered if you have a chance, if you might test out your settings
by formatting the enclosed code with emacs.  Then open the file in
vim. (vanilla) and see if it looks ok.  I suspect you may have more
customization in place than I do.  I might want to plaguerize some.

On my setup, using your suggestion and Kais about tabs does look much
nicer but displays bad in vim.  So leaving tabs alone and just using
your suggestion on offset.  Its closer but still displays bad in vim.
Leaving emacs entirely vanilla on those vars produces a file that vim
displays well.  But seems to have unnecessarily deep indentation.
So I may have been beating myself up for nothing.  Maybe just leaving
it alone will be the best solution.  Maybe emacs maintainers had the
right idea to start with.

if [ ];then
if [ ];then
case $option
t)cmd
if[];then
cmd
fi
;;
h)cmd
if[];then
case $otheroption
a) cmd
if[];then
cmd
fi
;;
b) cmd
;;
esac
;;
esac
fi
if[];then
cmd
fi
fi
fi





reply via email to

[Prev in Thread] Current Thread [Next in Thread]