From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thien-Thi Nguyen Newsgroups: gmane.emacs.help Subject: Re: Arbitrary folding in emacs Date: Fri, 28 Mar 2014 21:00:20 +0100 Message-ID: <87ha6im6uj.fsf@zigzag.favinet> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" X-Trace: ger.gmane.org 1396036600 6480 80.91.229.3 (28 Mar 2014 19:56:40 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 28 Mar 2014 19:56:40 +0000 (UTC) Cc: "help-gnu-emacs@gnu.org" To: C K Kashyap Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Mar 28 20:56:49 2014 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1WTctU-0004DO-Lm for geh-help-gnu-emacs@m.gmane.org; Fri, 28 Mar 2014 20:56:48 +0100 Original-Received: from localhost ([::1]:35707 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WTctU-000113-A7 for geh-help-gnu-emacs@m.gmane.org; Fri, 28 Mar 2014 15:56:48 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39580) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WTctC-00010d-42 for help-gnu-emacs@gnu.org; Fri, 28 Mar 2014 15:56:37 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WTct3-0000Od-1y for help-gnu-emacs@gnu.org; Fri, 28 Mar 2014 15:56:30 -0400 Original-Received: from smtp205.alice.it ([82.57.200.101]:38452) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WTct2-0000OF-M2 for help-gnu-emacs@gnu.org; Fri, 28 Mar 2014 15:56:20 -0400 Original-Received: from zigzag.favinet (79.24.52.139) by smtp205.alice.it (8.6.060.28) id 529A593119F4BFB6; Fri, 28 Mar 2014 20:56:16 +0100 Original-Received: from ttn by zigzag.favinet with local (Exim 4.80) (envelope-from ) id 1WTcx6-0005OT-NK; Fri, 28 Mar 2014 21:00:32 +0100 In-Reply-To: (C. K. Kashyap's message of "Fri, 28 Mar 2014 14:36:47 +0530") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 82.57.200.101 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:96819 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable () C K Kashyap () 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 =E2=80=98hs-hide-comment-region=E2=80=99, 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 =E2=80=98hs-set-up-overlay=E2=80=99.) =2D-=20 Thien-Thi Nguyen GPG key: 4C807502 (if you're human and you know it) read my lisp: (responsep (questions 'technical) (not (via 'mailing-list))) =3D> nil --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iEYEARECAAYFAlM11NkACgkQZwMiJEyAdQJ7QACg4zD98BnKpOHjXsfpfW5HIIrO fGkAnjflnR3pPPOWDzJSTSP1AKcox6Lt =RmKY -----END PGP SIGNATURE----- --=-=-=--