emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Peter Jones <mlists@pmade.com>
To: emacs-orgmode@gnu.org
Subject: Re: Jump to Heading Body, Create Plain List Item
Date: Sat, 21 Feb 2009 21:29:37 -0700	[thread overview]
Message-ID: <m2eixr9jri.fsf@pmade.com> (raw)
In-Reply-To: m2k57ja27i.fsf@pmade.com

Peter Jones <mlists@pmade.com> writes:
> 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.

Small bug fix:

(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)
    (if (eolp) (newline)
      (newline)
      (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

      reply	other threads:[~2009-02-22  4:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-20 16:24 Jump to Heading Body, Create Plain List Item Peter Jones
2009-02-21 21:51 ` Peter Jones
2009-02-22  4:29   ` Peter Jones [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2eixr9jri.fsf@pmade.com \
    --to=mlists@pmade.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).