emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Re: Org-mode 'organized' visibility
       [not found] <20060823131338.GA32711@zoidberg.homeip.net>
@ 2006-08-24  6:28 ` Carsten Dominik
  2006-08-24 20:17   ` Eddward DeVilla
  0 siblings, 1 reply; 3+ messages in thread
From: Carsten Dominik @ 2006-08-24  6:28 UTC (permalink / raw)
  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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Re: Org-mode 'organized' visibility
  2006-08-24  6:28 ` Org-mode 'organized' visibility Carsten Dominik
@ 2006-08-24 20:17   ` Eddward DeVilla
  2006-08-25  7:01     ` Carsten Dominik
  0 siblings, 1 reply; 3+ messages in thread
From: Eddward DeVilla @ 2006-08-24 20:17 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: Casper Gripenberg, emacs-orgmode

I don't know if I'm following or not.  I think I get the grouping you
are after.  If trailing blank line are empty it does not collapse into
the text for a heading.  If it is blank, but contains white space
character, it does collapse.

So I am able to do the following

    ------
    * heading
      I have something to say
    <space or tab>
    *heading 2
      I have more to say

    * unrelated heading
      Now for something completely different

    ------

And this will collapse down to

    ------
    * heading
    * heading 2

    * unrelated heading

    ------

Along these lines, I used to wish for something like a horizontal line
that I could throw in between 'sections'.  For the moment, I have a
layout style that looks fine without it and without playing too many
games with trailing blank (but not empty) lines.

On 8/24/06, Carsten Dominik <dominik@science.uva.nl> wrote:
> 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
>
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Re: Org-mode 'organized' visibility
  2006-08-24 20:17   ` Eddward DeVilla
@ 2006-08-25  7:01     ` Carsten Dominik
  0 siblings, 0 replies; 3+ messages in thread
From: Carsten Dominik @ 2006-08-25  7:01 UTC (permalink / raw)
  To: Eddward DeVilla; +Cc: Casper Gripenberg, emacs-orgmode

This is again different behavior on Emacs 21 and Emacs 22.  What I have 
been describing was Emacs 22 behavior.  It seems that the Emacs 21 
behavior is about the same as Emacs 22 with outline-blank-lines set to 
t.

- Carsten

On Aug 24, 2006, at 22:17, Eddward DeVilla wrote:

> I don't know if I'm following or not.  I think I get the grouping you
> are after.  If trailing blank line are empty it does not collapse into
> the text for a heading.  If it is blank, but contains white space
> character, it does collapse.
>
> So I am able to do the following
>
>    ------
>    * heading
>      I have something to say
>    <space or tab>
>    *heading 2
>      I have more to say
>
>    * unrelated heading
>      Now for something completely different
>
>    ------
>
> And this will collapse down to
>
>    ------
>    * heading
>    * heading 2
>
>    * unrelated heading
>
>    ------
>
> Along these lines, I used to wish for something like a horizontal line
> that I could throw in between 'sections'.  For the moment, I have a
> layout style that looks fine without it and without playing too many
> games with trailing blank (but not empty) lines.
>
> On 8/24/06, Carsten Dominik <dominik@science.uva.nl> wrote:
>> 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
>>
>>
>>
>> _______________________________________________
>> Emacs-orgmode mailing list
>> Emacs-orgmode@gnu.org
>> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>>
>
>

--
Carsten Dominik
Sterrenkundig Instituut "Anton Pannekoek"
Universiteit van Amsterdam
Kruislaan 403
NL-1098SJ Amsterdam
phone: +31 20 525 7477

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-08-25  7:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20060823131338.GA32711@zoidberg.homeip.net>
2006-08-24  6:28 ` Org-mode 'organized' visibility Carsten Dominik
2006-08-24 20:17   ` Eddward DeVilla
2006-08-25  7:01     ` Carsten Dominik

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).