From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: Org-mode 'organized' visibility Date: Thu, 24 Aug 2006 08:28:47 +0200 Message-ID: <90638e0b9c5926bff62ebdb050997516@science.uva.nl> References: <20060823131338.GA32711@zoidberg.homeip.net> Mime-Version: 1.0 (Apple Message framework v624) Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GG8i2-0004w8-6E for emacs-orgmode@gnu.org; Thu, 24 Aug 2006 02:28:58 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GG8i0-0004tk-GW for emacs-orgmode@gnu.org; Thu, 24 Aug 2006 02:28:57 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GG8i0-0004tP-Cs for emacs-orgmode@gnu.org; Thu, 24 Aug 2006 02:28:56 -0400 Received: from [146.50.4.51] (helo=imap.science.uva.nl) by monty-python.gnu.org with esmtp (Exim 4.52) id 1GG8q0-0003tS-4K for emacs-orgmode@gnu.org; Thu, 24 Aug 2006 02:37:12 -0400 In-Reply-To: <20060823131338.GA32711@zoidberg.homeip.net> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Casper Gripenberg Cc: emacs-orgmode Hi Caspar, On Aug 23, 2006, at 15:13, Casper Gripenberg wrote: > Hi..is it possible to not make S-TAB collapse > empty spaces between items. If I have a long > list of items I like to organize them into > groups..and then when I collapse the whole > tree I'd like my groupings it to be visible like this: > > * Tasks... > > * Something important... > * Something related to above... > > * Something else not related... > * Again related... > * Related... > > * Not related... > > Instead of the current way: > > * Tasks... > * Something important... > * Something related to above... > * Something else not related... > * Again related... > * Related... > * Not related... > > ..which doesn't allow me to see the groupings > between the tasks I have. I just think grouping provides > much quicker visual feedback of the tasks/headlines and > their relations to each other. > > To implement the groupings you might have a rule that > more than two empty lines between two headings will > then activate 'grouping'. > > So if I have: > > * Important > > Blah blah > > * Related > > Blah blah > > > * Not related > > This would collapse into: > > * Important... > * Related... > > * Not related... > > Or something along those lines..is that possible to > do somehow? > > Thanks.. > > Regards, > Casper This is something outside the direct control of Org-mode, it is entirely done by outline-mode. Looking at outline.el, I see two possibilities to address this: 1. For this first one, you need a current version of Emacs (must be CVS, Emacs 21 does not have this). Outline has an undocumented feature which makes it possible to relate an empty line before a heading to the heading. So when the heading is shown, the empty line is shows along with it. Similarly, a subtree is then defined to be before that empty line. As I said, this is an undocumented feature in so far as the corresponding variable is not customizable. However, you can still set it in the old way using (setq outline-blank-line t) If you do it in this way, there will be no difference between a single or a double empty line. An empty line before a heading will create an empty line in the CONTENT and CHILDREN views of org-cycle. 2. If we insist on your convention on using two line to mark a separation (we should, because it is the better convention), you would have to redefine a function in outline. This is not clean, but who gives a s*** :-) And I like this convention better, because I very often want to have an empty line above a headline without it meaning a separation. The function to modify is outline-show-heading, and it must be modified after outline.el has been loaded. If you are only using outline in connection with Org-mode, here is a way to do this: (add-hook 'org-load-hook (lambda () (defun outline-show-heading () "Show the current heading and move to its end." (outline-flag-region (- (point) (cond ((bobp) 0) ((equal (buffer-substring (max (point-min) (- (point) 3)) (point)) "\n\n\n") 2) (t 1))) (progn (outline-end-of-heading) (point)) nil)))) If you want this for other uses of outline as well, you could use `eval-after-load' or defadvice to achieve this change. There is a small possibility that doing either of these things might break something else in org-mode. I don't think so, but maybe I am not overseeing it fully. If you see something strange, let me know. Hope this helps. - Carsten