Possible Duplicate:
Emacs equivalent of Vim's foldmethod = indent
JEdit has a mode (specifically, folding mode: indent, in Options) that lets you fold code blocks based purely on indentation. It does not require any additional configuration, or knowledge of the language you are using.
That is, if you have code like this:
foo
bar
blah
oof
and the cursor is on the second or third line, and you tell JEdit to fold, those two lines will be hidden.
I have read similar SO questions, but I haven't found anything in emacs that "just works", for any buffer, like JEdit's code folding does.
I have specifically tried Fold Dwim. It doesn't work for me. It folds right to the end of the buffer, for some reason, which is utterly useless.