[Top][All Lists]

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

Problems with HideShow

From: kj
Subject: Problems with HideShow
Date: Tue, 6 Mar 2007 19:38:55 +0000 (UTC)
User-agent: nn/6.7.2

I desperately need the ability to selectively fold chunks of code
and comments in my source files, and over the years I have tried
various Emacs modes for this, but I always abandon them due to
bugs.  I'm trying once again, this time with hs-minor-mode, but
again, I'm running into bugs.

The most common problem is that the command hs-hide-all fails to
fold some pretty simple/obvious blocks.

For example, if I have a buffer with only this snippet:

if ( x ) {
  y = 0;

...hs-hide-all fails to fold the block.

However, if I now move the point so that it is inside the unfolded
block and execute hs-toggle-hiding, the folding happens perfectly.

What's the matter?  I can't understand what's confusing hs-hide-all,
but I'm willing to modify my coding style if this makes it easier
for hs-hide-all to do its job.  Are there any known do's and don't's
for keeping HideShow happy?  FWIW, the major mode in this case is
JavaScript Abbrev.

The other problem I'm having is easier to describe through an
example.  Suppose my code looks like this:


First I fold the first internal block, so that my screen would look
like this:


and afterwards I fold the outer block, so that now my screen would
look like this:


My problem now is that I don't know how to undo the last fold to
return to


Whether I use hs-toggle-hiding or hs-show-all I always end up with
both internal blocks expanded.

Basically I need a "reversible folding" process that somehow
remembers the state of the folded code before folding.  Is this
available already?

Many thanks in advance!


NOTE: In my address everything before the first period is backwards;
and the last period, and everything after it, should be discarded.

reply via email to

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