From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dave Abrahams Subject: Re: Checkbox difficulties Date: Thu, 06 Oct 2011 17:25:02 -0400 Message-ID: References: <87y5x3jjcl.fsf@gmail.com> <22596.1317621010@alphaville.dokosmarshall.org> <23215.1317681137@alphaville.americas.hpqcorp.net> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([140.186.70.92]:60080) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RBvRE-00035d-W6 for emacs-orgmode@gnu.org; Thu, 06 Oct 2011 17:25:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RBvRD-0002WY-Ic for emacs-orgmode@gnu.org; Thu, 06 Oct 2011 17:25:08 -0400 Received: from mail-vx0-f169.google.com ([209.85.220.169]:39436) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RBvRD-0002Vb-G9 for emacs-orgmode@gnu.org; Thu, 06 Oct 2011 17:25:07 -0400 Received: by vcbfo14 with SMTP id fo14so3305190vcb.0 for ; Thu, 06 Oct 2011 14:25:06 -0700 (PDT) In-Reply-To: <23215.1317681137@alphaville.americas.hpqcorp.net> (Nick Dokos's message of "Mon, 03 Oct 2011 18:32:17 -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: nicholas.dokos@hp.com Cc: emacs-orgmode@gnu.org on Mon Oct 03 2011, Nick Dokos wrote: > Dave Abrahams wrote: > >> >> on Mon Oct 03 2011, Nick Dokos wrote: >> >> > Dave Abrahams wrote: >> > >> >> Wow, that's awesome... we're *so* close... but how do I get it to >> >> automatically mark the item DONE when the last box is checked? >> >> >> > >> > Take a look at >> > >> > http://thread.gmane.org/gmane.emacs.orgmode/42715/focus=42721 >> >> Works! Oh-so-awesome! Shouldn't these capabilities be built-in and >> shipped as first class Org features? >> > > Well, if the function can be made to work completely generally, maybe: > as it stands, it is more a proof-of-concept than a complete solution. > > I added an entry in the FAQ on Worg about this - I figured this is the > second time the question has been asked on the list: ergo it's a FAQ ;-) > > http://orgmode.org/worg/org-faq.html#sec-9-7 > > You might want to read the entry: it includes a slightly revised function > but it also includes a couple of caveats that explain why I think it's > not a complete solution: Thanks! Here's a version that deals with at least one of your caveats: (defun ndk/checkbox-list-complete () (save-excursion (org-back-to-heading t) (when looking-at (concat "^\\*+[ \t]+" org-todo-regexp ;; first match group here "[ \t].*\\[" "\\(100%\\)\\|[0-9]+%" "\\|" "\\([0-9]+\\)" "/" "\\([0-9]+\\)" "\\]") (if (or (match-string 2) (and (match-string 3) (equal (match-string 3) (match-string 4)))) (org-todo 'done) (org-todo 'todo))))) -- Dave Abrahams BoostPro Computing http://www.boostpro.com