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: Wed, 25 Jun 2003 06:30:59 -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> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: main.gmane.org 1056548296 4523 80.91.224.249 (25 Jun 2003 13:38:16 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 25 Jun 2003 13:38:16 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Wed Jun 25 15:38:14 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 19VATG-00018s-00 for ; Wed, 25 Jun 2003 15:37:58 +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 19VAQx-0005sZ-6U for gnu-help-gnu-emacs@m.gmane.org; Wed, 25 Jun 2003 09:35:35 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed-east.nntpserver.com!nntpserver.com!news3.optonline.net!rip!news.webusenet.com!peer01.cox.net!cox.net!p01!fed1read03.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3.50 (gnu/linux) Cancel-Lock: sha1:q3frvjJMimLyQIcxOjI6SvDb6Nc= Original-Lines: 133 Original-NNTP-Posting-Host: 68.6.72.73 Original-X-Complaints-To: abuse@cox.net Original-X-Trace: fed1read03 1056547859 68.6.72.73 (Wed, 25 Jun 2003 09:30:59 EDT) Original-NNTP-Posting-Date: Wed, 25 Jun 2003 09:30:59 EDT Original-Xref: shelby.stanford.edu gnu.emacs.help:114719 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:11209 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:11209 --=-=-= Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: 8bit kai.grossjohann@gmx.net (Kai Großjohann) writes: > I just had a quick look, but maybe you could check > > (setq sh-indentation 2) > (setq-default indent-tabs-mode nil) > > (The variable indent-tabs-mode is buffer-local by default. With > setq-default, most modes will avoid tabs for indentation. If you > only want to tweak this for shell script mode, then you can do it > with a mode hook.) I just tried this, but not sure its a fair test: 1) Put the two lines you suggest as sole entries in lisp.el then start a fresh emacs. (emacs -q -no-site-file -bg midnightblue -l ./lisp.el -l ./vi-list.el) (vi-list.el is some plaguerized code that allows one to display a buffer as if vi's `list' command had been run on it. (showing ^I = tab $= newline) Set background different than usual so I could keep track of which emacs has the new code. 2) Started a second emacs (emacs -q -no-site-file -l ./vi-list.el) (without the new code) Ran C-x h then C-M \ on both Then saved the results as: shellt1.sh (new code) shellt2.sh (no new code) Both files are attached. invoking vi-list shows the tabs are gone, but strangely the code is formatted almost the same. The deepest indentation being only 2 spcs different. I would have expected to gain quite a lot more. The source file looks like: Cat shell-script.sh if [ ];then if [ ];then case $opt in t) cmd lf [ ];then cmd fi ;; h) cmd if [ ];then case $otheropt in a) cmd if [ ];then cmd fi ;; b) cmd :: esac fi esac if [];then cmd ii fi fi --=-=-= Content-Type: application/x-sh Content-Disposition: attachment; filename=shellt1.sh Content-Description: with new code if [ ];then if [ ];then case $opt in t) cmd lf [ ];then cmd fi ;; h) cmd if [ ];then case $otheropt in a) cmd if [ ];then cmd fi ;; b) cmd :: esac fi esac if [];then cmd ii fi fi --=-=-= Content-Type: application/x-sh Content-Disposition: attachment; filename=shellt2.sh Content-Description: without new code if [ ];then if [ ];then case $opt in t) cmd lf [ ];then cmd fi ;; h) cmd if [ ];then case $otheropt in a) cmd if [ ];then cmd fi ;; b) cmd :: esac fi esac if [];then cmd ii fi fi --=-=-= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit _______________________________________________ Help-gnu-emacs mailing list Help-gnu-emacs@gnu.org http://mail.gnu.org/mailman/listinfo/help-gnu-emacs --=-=-=--