From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matt Lundin Subject: Re: turn headline(s) into plain list? Date: Sat, 07 May 2011 10:20:06 -0400 Message-ID: <87hb96pp7t.fsf@fastmail.fm> References: <87liyippca.fsf@fastmail.fm> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([140.186.70.92]:48520) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QIiMa-0006JS-Jy for emacs-orgmode@gnu.org; Sat, 07 May 2011 10:20:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QIiMZ-0001Wt-JW for emacs-orgmode@gnu.org; Sat, 07 May 2011 10:20:08 -0400 Received: from out2.smtp.messagingengine.com ([66.111.4.26]:54945) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QIiMZ-0001Wo-Hm for emacs-orgmode@gnu.org; Sat, 07 May 2011 10:20:07 -0400 In-Reply-To: <87liyippca.fsf@fastmail.fm> (Matt Lundin's message of "Sat, 07 May 2011 10:17:25 -0400") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Gary Oberbrunner Cc: Orgmode Mailing List Matt Lundin writes: > Gary Oberbrunner writes: > >> Is there any way to turn a headline (and its subtree) into a plain >> list (and nested list items)? Or better yet, turn all level N and >> below headlines into plain lists at the corresponding level? > > For the latter, you could use org-map-entries: > > (defun org-convert-low-levels-to-list (level) > "Convert headings in file equal or greater than LEVEL to lists. > A numeric prefix argument can be used to set the level. The > default level is three" > (interactive "P") > (let ((level (number-to-string (or level 3)))) > (org-map-entries 'org-ctrl-c-minus > (concat "+LEVEL>=" level) 'file))) > As an example, the function above converts the following: --8<---------------cut here---------------start------------->8--- * One ** Two *** Three **** Four ***** Five ****** Six ******* Seven ****** Six ***** Five **** Four *** Three ** Two * One --8<---------------cut here---------------end--------------->8--- To this: --8<---------------cut here---------------start------------->8--- * One ** Two - Three - Four - Five - Six - Seven - Six - Five - Four - Three ** Two * One --8<---------------cut here---------------end--------------->8--- Best, Matt