From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: kj Newsgroups: gmane.emacs.help Subject: Problems with HideShow Date: Tue, 6 Mar 2007 19:38:55 +0000 (UTC) Organization: none Message-ID: NNTP-Posting-Host: lo.gmane.org X-Trace: sea.gmane.org 1173210101 27181 80.91.229.12 (6 Mar 2007 19:41:41 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 6 Mar 2007 19:41:41 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Mar 06 20:41:35 2007 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1HOfXR-0002zn-I4 for geh-help-gnu-emacs@m.gmane.org; Tue, 06 Mar 2007 20:41:33 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HOfXR-00056M-TJ for geh-help-gnu-emacs@m.gmane.org; Tue, 06 Mar 2007 14:41:33 -0500 Original-Path: shelby.stanford.edu!newshub.stanford.edu!bloom-beacon.mit.edu!panix!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 80 Original-NNTP-Posting-Host: panix3.panix.com Original-X-Trace: reader2.panix.com 1173209935 21181 166.84.1.3 (6 Mar 2007 19:38:55 GMT) Original-X-Complaints-To: abuse@panix.com Original-NNTP-Posting-Date: Tue, 6 Mar 2007 19:38:55 +0000 (UTC) X-No-Confirm: yes User-Agent: nn/6.7.2 Original-Xref: shelby.stanford.edu gnu.emacs.help:146126 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:41730 Archived-At: 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: { { foo(); bar(); } { baz(); } } First I fold the first internal block, so that my screen would look like this: { {... { baz(); } } 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 { {... { baz(); } } 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! kj -- NOTE: In my address everything before the first period is backwards; and the last period, and everything after it, should be discarded.