From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Harry Putnam Newsgroups: gmane.emacs.help Subject: Re: indentation - always a pita Date: Thu, 26 Jun 2003 11:35:26 -0700 Organization: Still searching... 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 1056654844 8334 80.91.224.249 (26 Jun 2003 19:14:04 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Thu, 26 Jun 2003 19:14:04 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Thu Jun 26 21:14:03 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 19VcAd-000229-00 for ; Thu, 26 Jun 2003 21:12:36 +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 19Vc5A-0001U4-Vt for gnu-help-gnu-emacs@m.gmane.org; Thu, 26 Jun 2003 15:06:57 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.20) id 19Vbva-0007yq-4X for help-gnu-emacs@gnu.org; Thu, 26 Jun 2003 14:57:02 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.20) id 19VbsE-00075h-JH for help-gnu-emacs@gnu.org; Thu, 26 Jun 2003 14:53:35 -0400 Original-Received: from main.gmane.org ([80.91.224.249]) by monty-python.gnu.org with esmtp (Exim 4.20) id 19Vbbb-00037V-RC for help-gnu-emacs@gnu.org; Thu, 26 Jun 2003 14:36:23 -0400 Original-Received: from list by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 19Vban-0006ya-00 for ; Thu, 26 Jun 2003 20:35:33 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-To: help-gnu-emacs@gnu.org Original-Received: from news by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 19VbaT-0006xA-00 for ; Thu, 26 Jun 2003 20:35:13 +0200 Original-Lines: 57 Original-X-Complaints-To: usenet@main.gmane.org User-Agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3.50 (gnu/linux) Cancel-Lock: sha1:MJvNa4RuUlrfcI7cApdrVn4bUd4= 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:11252 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:11252 > 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