help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: indentation - always a pita


From: Jens Schmidt
Subject: Re: indentation - always a pita
Date: 27 Jun 2003 11:21:43 +0100
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1

Harry Putnam <address@hidden> 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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]