all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: John Hendy <jw.hendy@gmail.com>
To: Peter Salazar <cycleofsong@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: automatically mark DONE when all sub checkboxes are checked
Date: Fri, 10 Feb 2012 15:13:36 -0600	[thread overview]
Message-ID: <CA+M2ft82JagcESy_qFC+SfyAqQXLRBO-xRi8TOmv=HHuOtdnnQ@mail.gmail.com> (raw)
In-Reply-To: <CAE+_6TxENro8VqNBNcDyue7zHziQCW-yAtmX086KfrancHx2Zw@mail.gmail.com>

On Fri, Feb 10, 2012 at 3:06 PM, Peter Salazar <cycleofsong@gmail.com> wrote:
> Hello everyone! Org-mode is amazing. I've totally fallen in love with it.
> Glad to be joining the community.
>
> I'm trying to get org-mode to automatically mark DONE when all sub
> checkboxes are checked. On http://orgmode.org/worg/org-faq.html, I found a
> function that purports to do this.
>
> I pasted the function into my .emacs file, but now I'm getting an error
> message when I launch: "Symbol's value as variable is void:
> org-checkbox-statistics-hook."
>

I don't get any error, but it doesn't work. Also, the example in worg
had an extra parenthesis at the end of it... not sure if that's
goofing it up. I don't know lisp, so I just deleted one of the last
parentheses and loading my .emacs stopped complaining. Not sure if
that last trailing one was the offender or not. In any case, this is
not working for me on an up to date org install (pulled yesterday).


John

> Any thoughts? Thanks in advance!
>
>
> ;; see http://thread.gmane.org/gmane.emacs.orgmode/42715
> (add-to-list 'org-checkbox-statistics-hook (function
> ndk/checkbox-list-complete))
>
> (defun ndk/checkbox-list-complete ()
>   (save-excursion
>     (org-back-to-heading t)
>     (let ((beg (point)) end)
>       (end-of-line)
>       (setq end (point))
>       (goto-char beg)
>       (if (re-search-forward
> "\\[\\([0-9]*%\\)\\]\\|\\[\\([0-9]*\\)/\\([0-9]*\\)\\]" end t)
>             (if (match-end 1)
>                 (if (equal (match-string 1) "100%")
>                     ;; all done - do the state change
>                     (org-todo 'done)
>                   (org-todo 'todo))
>               (if (and (> (match-end 2) (match-beginning 2))
>                        (equal (match-string 2) (match-string 3)))
>                   (org-todo 'done)
>                 (org-todo 'todo))))))))
>
>
>
> P.S. Not sure if it's relevant, but I'm on OSX using Aquamacs 2.4.

  reply	other threads:[~2012-02-10 21:13 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-10 21:06 automatically mark DONE when all sub checkboxes are checked Peter Salazar
2012-02-10 21:13 ` John Hendy [this message]
2012-02-10 22:31   ` Angel de Vicente
2012-02-10 22:47     ` John Hendy
2012-02-11  0:41       ` Nick Dokos
2012-02-11  2:20         ` John Hendy
2012-02-11 18:17 ` Nick Dokos
2012-02-13  8:08   ` Peter Salazar

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

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

  git send-email \
    --in-reply-to='CA+M2ft82JagcESy_qFC+SfyAqQXLRBO-xRi8TOmv=HHuOtdnnQ@mail.gmail.com' \
    --to=jw.hendy@gmail.com \
    --cc=cycleofsong@gmail.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 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.