From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Jens Schmidt Newsgroups: gmane.emacs.help Subject: Re: indentation - always a pita Date: 27 Jun 2003 11:21:43 +0100 Sender: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: <847k7afzu4.fsf@lucy.is.informatik.uni-duisburg.de> <844r2exepk.fsf@lucy.is.informatik.uni-duisburg.de> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1056706163 7304 80.91.224.249 (27 Jun 2003 09:29:23 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Fri, 27 Jun 2003 09:29:23 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Fri Jun 27 11:29:20 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19VpXa-0001st-00 for ; Fri, 27 Jun 2003 11:29:10 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.20) id 19VpXT-0002AM-GN for gnu-help-gnu-emacs@m.gmane.org; Fri, 27 Jun 2003 05:29:03 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!sjc-peer.news.verio.net!news.verio.net!news.sanjose1.Level3.net!Level3.net!news.oracle.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 62 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1 Original-NNTP-Posting-Host: 140.84.81.137 Original-X-Trace: news.oracle.com 1056706191 140.84.81.137 (Fri, 27 Jun 2003 02:29:51 PDT) Original-NNTP-Posting-Date: Fri, 27 Jun 2003 02:29:51 PDT Original-Xref: shelby.stanford.edu gnu.emacs.help:114775 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:11268 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:11268 Harry Putnam writes: > > 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. > > [...] > > 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. The main problem seems to be vim and not Emacs, I think. If I format your example with `sh-basic-offset' set to 2 and `indent-tabs-mode' set to nil I get the result shown below in Emacs. I confirmed that there are no TABs in it by doing C-s TAB. I saved the example to ~/tmp/xxx and opened that file with the version of vi that I have (MKS NT vi). Of course, I get the same results as in Emacs since a blank is a blank in vi, too. So the question is: What does look so radically different in your vim? Have you tried looking at the file using a simple less or cat? Does that look different from Emacs or vim? How? Are you sure that your vim is really vanilla? Jens 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