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

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

Re: Arbitrary folding in emacs


From: Thien-Thi Nguyen
Subject: Re: Arbitrary folding in emacs
Date: Fri, 28 Mar 2014 21:00:20 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

() C K Kashyap <address@hidden>
() Fri, 28 Mar 2014 14:36:47 +0530

   I am trying to go-over a huge c++ file. In vim, I can collapse a
   huge set of lines by simply highlighting it an then doing a zf.
   I was wondering if I can do something similar in emacs - rather
   how I can do it in emacs.

   I tried hs-minor-mode but it appears to have pre-defined notions
   of "foldable" blocks.

You can (ab)use ‘hs-hide-comment-region’, like so:

 (defun hs-hide-region (beg end)
   "Basically (hs-hide-comment-region BEG END), as a command."
   (interactive "r")
   (hs-hide-comment-region beg end))

Does that work for you?  I tested lightly w/ Emacs Lisp only.
(See also ‘hs-set-up-overlay’.)

-- 
Thien-Thi Nguyen
   GPG key: 4C807502
   (if you're human and you know it)
      read my lisp: (responsep (questions 'technical)
                               (not (via 'mailing-list)))
                     => nil

Attachment: pgpCOnlEZo3lo.pgp
Description: PGP signature


reply via email to

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