From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Colin S. Miller" Newsgroups: gmane.emacs.help Subject: Re: multiple collapse sections of code? Date: Wed, 04 Oct 2006 18:18:26 +0100 Organization: SunSITE.dk - Supporting Open source Message-ID: <4523ecee$0$49198$14726298@news.sunsite.dk> References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1159983801 23421 80.91.229.2 (4 Oct 2006 17:43:21 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 4 Oct 2006 17:43:21 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Oct 04 19:43:20 2006 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1GVAjg-0000lJ-U8 for geh-help-gnu-emacs@m.gmane.org; Wed, 04 Oct 2006 19:40:50 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GVAjg-0000Aw-2A for geh-help-gnu-emacs@m.gmane.org; Wed, 04 Oct 2006 13:40:48 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!uninett.no!news.net.uni-c.dk!dotsrc.org!filter.dotsrc.org!news.dotsrc.org!not-for-mail User-Agent: Thunderbird 1.5.0.5 (X11/20060812) Original-Newsgroups: gnu.emacs.help In-Reply-To: Original-Lines: 46 Original-NNTP-Posting-Host: 62.56.73.25 Original-X-Trace: news.sunsite.dk DXC=h?M_a`9@g1i; WQXm>CYcVo05McgSG3K2eCDPh Original-X-Complaints-To: staff@sunsite.dk Original-Xref: shelby.stanford.edu gnu.emacs.help:142184 Original-To: help-gnu-emacs@gnu.org 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:37804 Archived-At: Mickey Ferguson wrote: > Suppose I'm writing some C++ code that looks like the following: > > > > if (MyFunc() != NO_ERROR) > > { > > // now we start a big, complicated error handling routine > > CallFirstErrorHandlingRoutine(); > > CallSecondEHRoutine(); > > CallYetMore(); > > // there would be much more, but I've abbreviated for simplicity > > } > > > Mickey, hs-minor-mode also does this. I find these bindings more comfortable than the defaults (add-hook 'hs-minor-mode-hook '(lambda () (define-key hs-minor-mode-map [(control c) (control \') (control h)] 'hs-hide-block) (define-key hs-minor-mode-map [(control c) (control \') (control s)] 'hs-show-block) (define-key hs-minor-mode-map [(control c) (control \') (control meta h)] 'hs-hide-all) (define-key hs-minor-mode-map [(control c) (control \') (control meta s)] 'hs-show-all) (define-key hs-minor-mode-map [(control c) (control \') (control l)] 'hs-hide-level) (define-key hs-minor-mode-map [(control c) (control \') (control c)] 'hs-toggle-hiding) )) It will place ellipsises after each folded block. You can expand the block by right clicking on the ellipsis, although I agree that a [+] icon would be more intuitive. HTH, Colin S. Miller