all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* suggestion: converting plain lists to subtrees
@ 2009-07-21 17:21 Ilya Shlyakhter
  2009-07-21 18:09 ` Dan Davison
  2009-07-25 22:12 ` Bastien
  0 siblings, 2 replies; 6+ messages in thread
From: Ilya Shlyakhter @ 2009-07-21 17:21 UTC (permalink / raw)
  To: emacs-orgmode

A suggestion for a simple but useful command: convert a plain list to
a full-blown org subtree.
Sometimes I start with a plain list and later realize that it is
getting complex and a full-fledged hierarchy is needed.
Converting by hand is a pain.   It would be great if this could be automated.
Thanks,
ilya

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

* Re: suggestion: converting plain lists to subtrees
  2009-07-21 17:21 suggestion: converting plain lists to subtrees Ilya Shlyakhter
@ 2009-07-21 18:09 ` Dan Davison
  2009-07-21 20:23   ` Bastien
  2009-07-25 22:12 ` Bastien
  1 sibling, 1 reply; 6+ messages in thread
From: Dan Davison @ 2009-07-21 18:09 UTC (permalink / raw)
  To: Ilya Shlyakhter; +Cc: emacs-orgmode

Ilya Shlyakhter <ilya_shl@alum.mit.edu> writes:

> A suggestion for a simple but useful command: convert a plain list to
> a full-blown org subtree.

Have you seen org-toggle-heading? (C-c * when not in a table).

However, it seems that it doesn't preserve any list hierarchical
structure when converting to headlines.

Bastien -- I think C-c * could do with a mention in the manual section
on Plain Lists. Here's a patch which just copies the section on C-c *
from the Structure Editing section.

Dan

diff --git a/doc/org.texi b/doc/org.texi
index 3dc329e..75d9c79 100644
--- a/doc/org.texi
+++ b/doc/org.texi
@@ -1435,6 +1435,15 @@ region when calling this, all lines will be converted to list items.  If the
 first line already was a list item, any item markers will be removed from the
 list.  Finally, even without an active region, a normal line will be
 converted into a list item.
+@kindex C-c *
+@item C-c *
+Turn a normal line or plain list item into a headline (so that it
+becomes a subheading at its location). Also turn a headline into a
+normal line by removing the stars. If there is an active region, turn
+all lines in the region into headlines. If the first line in the
+region was an item, turn only the item lines into headlines. Finally,
+if the first line is a headline, remove the stars from all headlines
+in the region.
 @kindex S-@key{left}
 @kindex S-@key{right}
 @item S-@key{left}/@key{right}



> Sometimes I start with a plain list and later realize that it is
> getting complex and a full-fledged hierarchy is needed.
> Converting by hand is a pain.   It would be great if this could be automated.
> Thanks,
> ilya
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Remember: use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

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

* Re: suggestion: converting plain lists to subtrees
  2009-07-21 18:09 ` Dan Davison
@ 2009-07-21 20:23   ` Bastien
  2009-07-24  8:03     ` Christian Egli
  0 siblings, 1 reply; 6+ messages in thread
From: Bastien @ 2009-07-21 20:23 UTC (permalink / raw)
  To: Dan Davison; +Cc: Ilya Shlyakhter, emacs-orgmode

Dan Davison <davison@stats.ox.ac.uk> writes:

> Ilya Shlyakhter <ilya_shl@alum.mit.edu> writes:
>
>> A suggestion for a simple but useful command: convert a plain list to
>> a full-blown org subtree.
>
> Have you seen org-toggle-heading? (C-c * when not in a table).
>
> However, it seems that it doesn't preserve any list hierarchical
> structure when converting to headlines.

Yes, Ilya suggestion makes sense, I will work on this.

> Bastien -- I think C-c * could do with a mention in the manual section
> on Plain Lists. Here's a patch which just copies the section on C-c *
> from the Structure Editing section.

Applied, thanks!

-- 
 Bastien

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

* Re: suggestion: converting plain lists to subtrees
  2009-07-21 20:23   ` Bastien
@ 2009-07-24  8:03     ` Christian Egli
  2009-07-25 11:57       ` Bastien
  0 siblings, 1 reply; 6+ messages in thread
From: Christian Egli @ 2009-07-24  8:03 UTC (permalink / raw)
  To: emacs-orgmode

Bastien <bastienguerry@googlemail.com> writes:

>> Bastien -- I think C-c * could do with a mention in the manual section
>> on Plain Lists. Here's a patch which just copies the section on C-c *
>> from the Structure Editing section.
>
> Applied, thanks!

I'm not such a big fan of code or documentation duplication. Here's a
patch that removes this duplication and simply refers to the original
section on C-c *.

Thanks
Christian

diff --git a/doc/org.texi b/doc/org.texi
index 8a65f1a..37cad40 100644
--- a/doc/org.texi
+++ b/doc/org.texi
@@ -1437,13 +1437,8 @@ list.  Finally, even without an active region, a normal line will be
 converted into a list item.
 @kindex C-c *
 @item C-c *
-Turn a normal line or plain list item into a headline (so that it
-becomes a subheading at its location). Also turn a headline into a
-normal line by removing the stars. If there is an active region, turn
-all lines in the region into headlines. If the first line in the
-region was an item, turn only the item lines into headlines. Finally,
-if the first line is a headline, remove the stars from all headlines
-in the region.
+Turn a plain list item into a headline (so that it becomes a subheading at
+its location). @xref{Structure editing}, for a detailed explanation.
 @kindex S-@key{left}
 @kindex S-@key{right}
 @item S-@key{left}/@key{right}

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

* Re: Re: suggestion: converting plain lists to subtrees
  2009-07-24  8:03     ` Christian Egli
@ 2009-07-25 11:57       ` Bastien
  0 siblings, 0 replies; 6+ messages in thread
From: Bastien @ 2009-07-25 11:57 UTC (permalink / raw)
  To: Christian Egli; +Cc: emacs-orgmode

Christian Egli <christian.egli@sbszh.ch> writes:

> I'm not such a big fan of code or documentation duplication. Here's a
> patch that removes this duplication and simply refers to the original
> section on C-c *.

Well spotted, thanks, I applied the patch.

-- 
 Bastien

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

* Re: suggestion: converting plain lists to subtrees
  2009-07-21 17:21 suggestion: converting plain lists to subtrees Ilya Shlyakhter
  2009-07-21 18:09 ` Dan Davison
@ 2009-07-25 22:12 ` Bastien
  1 sibling, 0 replies; 6+ messages in thread
From: Bastien @ 2009-07-25 22:12 UTC (permalink / raw)
  To: Ilya Shlyakhter; +Cc: emacs-orgmode

Ilya Shlyakhter <ilya_shl@alum.mit.edu> writes:

> A suggestion for a simple but useful command: convert a plain list to
> a full-blown org subtree.

I have implemented this.

C-c C-* will convert the plain list at point into a subtree, projecting 
the structure of the list into the hierarchy of the tree.

Of course, this calls for a C-c C-- function that will do the opposite:
convert a subtree into a list.  I plan to do this using a new version of
the parser I've been working on.

Thanks for this idea!

-- 
 Bastien

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

end of thread, other threads:[~2009-07-25 22:12 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-21 17:21 suggestion: converting plain lists to subtrees Ilya Shlyakhter
2009-07-21 18:09 ` Dan Davison
2009-07-21 20:23   ` Bastien
2009-07-24  8:03     ` Christian Egli
2009-07-25 11:57       ` Bastien
2009-07-25 22:12 ` Bastien

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.