From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jai Dayal Newsgroups: gmane.emacs.help Subject: Re: Arbitrary folding in emacs Date: Fri, 28 Mar 2014 15:58:17 -0400 Message-ID: References: <87ha6im6uj.fsf@zigzag.favinet> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: ger.gmane.org 1396036729 8163 80.91.229.3 (28 Mar 2014 19:58:49 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 28 Mar 2014 19:58:49 +0000 (UTC) Cc: "help-gnu-emacs@gnu.org" , C K Kashyap To: Thien-Thi Nguyen Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Mar 28 20:58:59 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 1WTcvW-0005YD-RO for geh-help-gnu-emacs@m.gmane.org; Fri, 28 Mar 2014 20:58:54 +0100 Original-Received: from localhost ([::1]:35710 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WTcvW-0001ZG-Hk for geh-help-gnu-emacs@m.gmane.org; Fri, 28 Mar 2014 15:58:54 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39900) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WTcvJ-0001Z3-Sw for help-gnu-emacs@gnu.org; Fri, 28 Mar 2014 15:58:43 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WTcvI-00013p-Ci for help-gnu-emacs@gnu.org; Fri, 28 Mar 2014 15:58:41 -0400 Original-Received: from mail-vc0-x232.google.com ([2607:f8b0:400c:c03::232]:36593) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WTcvG-00013C-AM; Fri, 28 Mar 2014 15:58:38 -0400 Original-Received: by mail-vc0-f178.google.com with SMTP id im17so6308694vcb.37 for ; Fri, 28 Mar 2014 12:58:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=r3kk6sYcToBA0zhhQj5RSwXLXgPTksPARfMbPviXNhY=; b=LuZXcf5e1GdXaHFq3G8TfjADKKQYEynQiZrlJ/r9JMrppdwp+y02zLcG7BJf+dSz5v AmBHRw0NatU2dYYbBUIdoWZ8IwcIlBOmVAs2NtvuSNer9mQ39he+xTxugsGaUKjBkU+Q G48LomqyPLqVBOvFW9bc+EQwzg8lr2MvBNuEjNXly6XAOcxG7kfh7ZIjabcXgxkvd15Y KFYquSEA+X1hUo4E6jlgVk+JnrHvTnQuwzIGkPbz8K1GYBu6x7YKEyW568BGf5Ct9XVc NbuGUjFxKr7AQj7wfLphUJBCE4NgCQubUTskmMYsJLt29tR1tDd98p0jrQnRAB9X6J11 7+IA== X-Received: by 10.58.201.5 with SMTP id jw5mr8497509vec.6.1396036717232; Fri, 28 Mar 2014 12:58:37 -0700 (PDT) Original-Received: by 10.221.42.10 with HTTP; Fri, 28 Mar 2014 12:58:17 -0700 (PDT) In-Reply-To: <87ha6im6uj.fsf@zigzag.favinet> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:400c:c03::232 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 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:96820 Archived-At: after enabling hs-minor-mode, hs-hide-block works too, right? On Fri, Mar 28, 2014 at 4:00 PM, Thien-Thi Nguyen wrote: > () 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 '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 >