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

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

Re: expand/collapse{} in c++


From: Baloff
Subject: Re: expand/collapse{} in c++
Date: 27 Aug 2005 06:31:36 +1000
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.4

Alan Mackenzie <address@hidden> writes:

> Baloff <address@hidden> wrote on 24 Aug 2005 06:00:22 +1000:
> 
> > Hello
> > I tried to find out how to do this expand/collapse the code into {...}
> > from the info docs but it is not there. could someone help please.
> 
> Oh yes it is!  Or, at least, something very like it.  The node is in the
> Emacs manual, and is called "Hideshow".  Briefly, enable it with "M-x
> hs-minor-mode" (possibly from a hook).  Then you will have commands
> available like :
> 
>   `C-c @ C-h'
>        Hide the current block (`hs-hide-block').
> 
>   `C-c @ C-s'
>        Show the current block (`hs-show-block').
> 
>   `C-c @ C-c'
>        Either hide or show the current block (`hs-toggle-hiding')
> 
> [ .... ]
> 
> > thanks
> 
> -- 
> Alan Mackenzie (Munich, Germany)
> Email: address@hidden; to decode, wherever there is a repeated letter
> (like "aa"), remove half of them (leaving, say, "a").

I did the following but I must have done something wrong because it is
still not working.
in my .emacs I put
(add-hook 'c++-mode-hook 'hs-minor-mode t) ;for block hide/show

in a .emacs-c++ file to be loaded from inside .emacs, I have
(local-set-key [f4] "\C-c @ \C-c") ;toggles block hide/show

restart emacs, when I open .cpp file, f4 does nothing.


reply via email to

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