all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* indentation - always a pita
@ 2003-06-24 22:28 Harry Putnam
  0 siblings, 0 replies; 11+ messages in thread
From: Harry Putnam @ 2003-06-24 22:28 UTC (permalink / raw)


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.

^ permalink raw reply	[flat|nested] 11+ messages in thread
[parent not found: <mailman.8589.1056493977.21513.help-gnu-emacs@gnu.org>]

end of thread, other threads:[~2003-06-27 20:35 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-06-24 22:28 indentation - always a pita Harry Putnam
     [not found] <mailman.8589.1056493977.21513.help-gnu-emacs@gnu.org>
2003-06-25  6:14 ` Kai Großjohann
2003-06-25 13:30   ` Harry Putnam
2003-06-25 14:15     ` Harry Putnam
2003-06-25 17:13     ` Kai Großjohann
2003-06-26  4:13       ` Harry Putnam
     [not found]       ` <mailman.8648.1056600891.21513.help-gnu-emacs@gnu.org>
2003-06-26  9:13         ` Jens Schmidt
2003-06-26 18:21           ` Harry Putnam
2003-06-26 18:35           ` Harry Putnam
     [not found]           ` <mailman.8693.1056654403.21513.help-gnu-emacs@gnu.org>
2003-06-27 10:21             ` Jens Schmidt
2003-06-27 20:35               ` Harry Putnam

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.