From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tassilo Horn Newsgroups: gmane.emacs.help Subject: Re: Narrow/widen in folding.el Date: Wed, 22 Dec 2010 09:16:27 +0100 Message-ID: <87zkryz0h0.fsf@member.fsf.org> References: <87mxnz9dd1.fsf@member.fsf.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1293005899 18656 80.91.229.12 (22 Dec 2010 08:18:19 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 22 Dec 2010 08:18:19 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Dec 22 09:18:15 2010 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PVJtn-000790-BV for geh-help-gnu-emacs@m.gmane.org; Wed, 22 Dec 2010 09:18:15 +0100 Original-Received: from localhost ([127.0.0.1]:52206 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PVJtl-00024t-8O for geh-help-gnu-emacs@m.gmane.org; Wed, 22 Dec 2010 03:18:13 -0500 Original-Received: from [140.186.70.92] (port=52829 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PVJsJ-00023C-JQ for help-gnu-emacs@gnu.org; Wed, 22 Dec 2010 03:16:45 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PVJsI-0003bo-HN for help-gnu-emacs@gnu.org; Wed, 22 Dec 2010 03:16:43 -0500 Original-Received: from lo.gmane.org ([80.91.229.12]:41859) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PVJsI-0003bV-7f for help-gnu-emacs@gnu.org; Wed, 22 Dec 2010 03:16:42 -0500 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1PVJsF-0006ci-I9 for help-gnu-emacs@gnu.org; Wed, 22 Dec 2010 09:16:39 +0100 Original-Received: from tsdh.uni-koblenz.de ([141.26.67.142]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 22 Dec 2010 09:16:39 +0100 Original-Received: from tassilo by tsdh.uni-koblenz.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 22 Dec 2010 09:16:39 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 54 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: tsdh.uni-koblenz.de User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/24.0.50 (gnu/linux) Cancel-Lock: sha1:+Q/VYYGcNgGKUabIqBADn4Nh7I8= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) 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:77769 Archived-At: Andrea Crotti writes: Hi Andrea, >> But org-mode doesn't work for source code files, e.g. it's not the >> right thing for using folding in C++ files. > > Aha ok I didn't understand it was for source code. Nah, no-one said that. But folding.el and outline.el (both minor modes) can be used in any buffer, whereas org-mode (a major mode) is for org-files only. So activating org-mode in a lisp buffer ==> lisp completion, highlighting, and indentation are gone. > Anyway for C++ with cedet and the function > > senator-fold-tag > it works perfectly for me, not sure if it's what you want... > I have this > (local-set-key [f6] 'senator-fold-tag-toggle) > > for the buffers supported by semantic. Yes, several modes implement some folding capabilities wtr. some syntactic constructs of a programming language. For example, there's also hs-minor-mode, which can collapse/expand blocks in languages like C/C++/Java. That's a good thing, but with outline-minor-mode (or folding.el), you can add more coarse-grained sections to structure your code into several groups of things (e.g. functions) belonging together, like: ;;* Code ;;** User Variables ;;** User Commands ;;** Internal Implementation ;;*** General ;;*** Feature A ;;*** Feature B > Now I remember I also tried to do something like this some time ago, > but I couldn't stand the fact that I had to use a special syntax for > it. That's what I like with `outline-minor-mode' and my config (i.e. outline headings are `comment-start' + one or many *s). You would comment your code anyway (I hope so!), and adding a few * to make a comment a headline to make the structure of the file visible is worth it. But I agree, that I don't like folding.el's obtrusive {{{ ... }}} syntax, too. Bye, Tassilo