From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter Jones Subject: Re: Jump to Heading Body, Create Plain List Item Date: Sat, 21 Feb 2009 14:51:13 -0700 Message-ID: References: <86k57l2i05.fsf@pmade.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Lazky-0006yl-9h for emacs-orgmode@gnu.org; Sat, 21 Feb 2009 16:51:32 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Lazkv-0006yZ-Rb for emacs-orgmode@gnu.org; Sat, 21 Feb 2009 16:51:30 -0500 Received: from [199.232.76.173] (port=45038 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Lazkv-0006yW-LB for emacs-orgmode@gnu.org; Sat, 21 Feb 2009 16:51:29 -0500 Received: from main.gmane.org ([80.91.229.2]:55133 helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Lazkv-0001BA-7K for emacs-orgmode@gnu.org; Sat, 21 Feb 2009 16:51:29 -0500 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1Lazku-0005zN-09 for emacs-orgmode@gnu.org; Sat, 21 Feb 2009 21:51:28 +0000 Received: from c-67-177-235-141.hsd1.co.comcast.net ([67.177.235.141]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 21 Feb 2009 21:51:27 +0000 Received: from mlists by c-67-177-235-141.hsd1.co.comcast.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 21 Feb 2009 21:51:27 +0000 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: emacs-orgmode@gnu.org Peter Jones writes: > I'd like a function that would do the following: > > 1) Move to the "body" of a heading (skipping drawers and the like) > > 2) Create the "body" if necessary (when there are no lines between > sibling headings or between drawers and a sibling heading) > > 3) Append a new plain list item (or create a new plain list if there This is what I've come up with so far. I have M-RET bound to the first function, and M-S-RET bound to the second function. (defun pmade:org-list-append (&optional checkbox) "Append a plain list item to the current heading. If the current heading already has plain list items, a new one will be added, otherwise a new plain list will be created. If checkbox is set, add a plain list item with a checkbox." (interactive "P") (when (not (org-insert-item (if checkbox 'checkbox))) (org-back-to-heading) (org-show-subtree) (outline-next-heading) (newline) (when (bolp) (previous-line)) (org-indent-line-function) (insert (concat "-" (if checkbox " [ ] " " "))))) (defun pmade:org-list-append-with-checkbox () "Calls `pmade:org-list-append' with checkbox set." (interactive) (pmade:org-list-append t)) -- Peter Jones, http://pmade.com pmade inc. Louisville, CO US