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: indentation - always a pita Date: Tue, 24 Jun 2003 15:28:43 -0700 Organization: Still searching... Sender: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1056493993 24533 80.91.224.249 (24 Jun 2003 22:33:13 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Tue, 24 Jun 2003 22:33:13 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Wed Jun 25 00:33:10 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 19UwLd-0006NA-00 for ; Wed, 25 Jun 2003 00:33:09 +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 19UwLj-0003EG-2O for gnu-help-gnu-emacs@m.gmane.org; Tue, 24 Jun 2003 18:33:15 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.20) id 19UwLL-000356-Np for help-gnu-emacs@gnu.org; Tue, 24 Jun 2003 18:32:51 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.20) id 19UwJ4-0002Gl-Kk for help-gnu-emacs@gnu.org; Tue, 24 Jun 2003 18:30:32 -0400 Original-Received: from main.gmane.org ([80.91.224.249]) by monty-python.gnu.org with esmtp (Exim 4.20) id 19UwHP-00017F-HE for help-gnu-emacs@gnu.org; Tue, 24 Jun 2003 18:28:47 -0400 Original-Received: from list by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 19UwH8-00060v-00 for ; Wed, 25 Jun 2003 00:28:30 +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 19UwH7-00060k-00 for ; Wed, 25 Jun 2003 00:28:29 +0200 Original-Lines: 56 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:FfmJ3jvU+yuoBdN6Z9SDECE3Zm0= 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:11195 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:11195 Maybe its just because I only have 3 brain cells to rub together. But it always seems like a massive undertaking to do anything about indentation in some of the scripting or language modes. In the instant case its Shell-script (bash) Pressing Ctrl-Alt \ to format the entire buffer. Gives me something like: if [ ];then if [ ];then case $opt in t) cmd if [ ];then cmd fi ;; h) cmd if [ ];then case $otheropt in a) cmd if [ ];then cmd fi ;; b) cmd :: esac fi esac if [];then cmd fi fi fi Admittedly a bit contrived but this seems a little extreme to me. Now to do something about this, I dimmly recall starting to before and quickly discovering its quite complicated. I'd like something closer to what cperl does. Also I'd like there to be NO TABS whatever. Using tabs in code is guaranteed to cause a problem sooner or later, when one is forced to edit with something besides emacs. So what is the simplist route to getting something like if [ ];then if [ ];then if [];then cmd fi fi fi Two spaces per clause and 2 spaces for actions inside clause. No tabs at all.