From mboxrd@z Thu Jan 1 00:00:00 1970 From: Livin Stephen Sharma Subject: Re: Re: TODO's dependency on nested-Checkboxes -- 'org-enforce-todo-checkbox-dependencies' Date: Mon, 17 May 2010 16:11:41 +0530 Message-ID: <9F4B3811-5557-48C6-B482-22E71D5BEB3E@gmail.com> References: <3F173FA7-5ABC-4F72-BA48-FD30950C128F@gmail.com> <662DCCDE-CBC7-43C6-B406-233B425A2D11@gmail.com> Mime-Version: 1.0 (Apple Message framework v1078) Content-Type: multipart/mixed; boundary="===============1338058380==" Return-path: Received: from [140.186.70.92] (port=60659 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ODxlf-0007rT-2Z for emacs-orgmode@gnu.org; Mon, 17 May 2010 06:41:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1ODxlc-00019x-LR for emacs-orgmode@gnu.org; Mon, 17 May 2010 06:41:50 -0400 Received: from mail-px0-f169.google.com ([209.85.212.169]:55221) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1ODxlb-00019f-T6 for emacs-orgmode@gnu.org; Mon, 17 May 2010 06:41:48 -0400 Received: by pxi12 with SMTP id 12so5062685pxi.0 for ; Mon, 17 May 2010 03:41:46 -0700 (PDT) In-Reply-To: <662DCCDE-CBC7-43C6-B406-233B425A2D11@gmail.com> 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: Carsten Dominik Cc: emacs-org-mode-help gnu --===============1338058380== Content-Type: multipart/alternative; boundary=Apple-Mail-6--567041727 --Apple-Mail-6--567041727 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=iso-8859-1 Thanks Livin Stephen Sharma On May 17, 2010, at 15:16:40 , Carsten Dominik wrote: > Hi, >=20 >=20 > On May 17, 2010, at 11:40 AM, Livin Stephen Sharma wrote: >=20 >> Hi again, >> This is regarding a TODO which has: >> a. nested-checkboxes AND >> b. a statistics-cookie. >>=20 >> Need help to achieve this: >> The TODO should auto-update/-change to 'DONE' when the stats-cookie = hits '100%'. >=20 > I think you should be able to build this using = org-checkbox-statistics-hook. Nothing like this is built-in. Thanks for the info, Carsten. Too bad the code doesn't already exist.. and I don't know *any* lisp! Still, I'm trying to give this a shot... Could you let me know: 1. Where/how are n-done and n-not-done defined/set? I'm trying to see if = I can reuse the example from the documentation. 2. are 'c-on' and 'c-off' the checkbox-equivalents for the n-(not)-done = variables? Where/how are *these* set? FWIW, this attempt did not work for me (this would leave the cursor at = the TODO): (defun org-summary-todo-checkbox (c-on c-off) "Switch entry to DONE when all subentry-checkboxes are done, to TODO = otherwise." (outline-previous-visible-heading 1) (let (org-log-done org-log-states) ; turn off logging (org-todo (if (=3D c-off 0) "DONE" "TODO")))) (add-hook 'org-checkbox-statistics-hook 'org-summary-todo-checkbox) I get this error: run-hooks: Wrong number of arguments: #[(c-on c-off) "=C3=C4!\210=C5\211^X= ^Y=C6 =C7U\203^S^@=C8\202^T^@=C9!*\207" [org-log-states org-log-done c-off = outline-previous-visible-heading 1 nil org-todo 0 "DONE" "TODO"] 3 = ("/Users/livin/.emacs.d/addons/org/org_stuff.elc" . 6903)], 0 Could you suggest a change in the above lisp, or point out what I'm = doing wrong? > You can do it relatively easily when you are using subtasks instead = of checkboxes, there are examples for this in the documentation. Yes, I recently started using this feature (picked it up from the = documentation) to achieve this for subtask-TODOs ). >=20 > - Carsten >=20 >>=20 >> --lss >>=20 >>=20 >> On May 15, 2010, at 23:44:21 , Livin Stephen Sharma wrote: >>=20 >>> This is a tree from a hypothetical minimal org-file: >>>> **** TODO meet people [100%] >>>> - [X] John >>>> - [X] Jane >>>=20 >>>=20 >>>=20 >>>=20 >>> How can I achieve this: >>> TODO-state should automatically change to DONE when I have = checked-off both 'John' and 'Jane' ? >>>=20 >>> 1. The manual showed me how to do this if John and Jane are also = TODOs: using org-after-todo-statistics-hook. >>> I just can't find the check-box equivalent. >>>=20 >>> 2. Google turned up 'org-enforce-todo-checkbox-dependencies' - but = that is only half of what I'm looking for. >>>=20 >>>=20 >>> If this feature does not already exist, I'd like to suggest this as = a useful enhancement. >>>=20 >>>=20 >>> Livin Stephen Sharma >>>=20 >>>=20 >>>=20 >>=20 >> _______________________________________________ >> Emacs-orgmode mailing list >> Please use `Reply All' to send replies to the list. >> Emacs-orgmode@gnu.org >> http://lists.gnu.org/mailman/listinfo/emacs-orgmode >=20 > - Carsten >=20 >=20 >=20 --Apple-Mail-6--567041727 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=iso-8859-1
Thanks
Livin = Stephen Sharma

On May 17, 2010, at 15:16:40 , Carsten = Dominik wrote:

Hi,


On May = 17, 2010, at 11:40 AM, Livin Stephen Sharma wrote:

Hi again,
This = is regarding a TODO which has:
a. nested-checkboxes AND
b. a statistics-cookie.

Need help to = achieve this:
The TODO should = auto-update/-change to 'DONE' when the stats-cookie hits = '100%'.

I think you should be able to build this = using org-checkbox-statistics-hook.  Nothing like this is = built-in.

Thanks for the info, = Carsten.

Too bad the code doesn't already exist.. and = I don't know *any* lisp!
Still, I'm trying to give this a = shot...

Could you let me know:
1. Where/how = are n-done and n-not-done defined/set? I'm trying to see if I can reuse = the example from the documentation.
2. are 'c-on' and 'c-off' the = checkbox-equivalents for the n-(not)-done variables? Where/how are = *these* set?

FWIW, this attempt did not work for me (this would = leave the cursor at the TODO):

(defun = org-summary-todo-checkbox (c-on c-off)
  "Switch entry to = DONE when all subentry-checkboxes are done, to TODO = otherwise."
  (outline-previous-visible-heading = 1)
  (let (org-log-done org-log-states)
= ; = turn off logging
  
= (org-todo (if (=3D c-off 0) "DONE" "TODO"))))
(add-hook = 'org-checkbox-statistics-hook = 'org-summary-todo-checkbox)

I get this = error:
run-hooks: Wrong number of arguments: #[(c-on c-off) = "=C3=C4!\210=C5\211^X^Y=C6
=C7U\203^S^@=C8\202^T^@=C9!*\207" = [org-log-states org-log-done c-off outline-previous-visible-heading 1 = nil org-todo 0 "DONE" "TODO"] 3 = ("/Users/livin/.emacs.d/addons/org/org_stuff.elc" . 6903)], = 0

Could you suggest a change in the above lisp, or = point out what I'm doing = wrong?



 You can do it relatively easily when you are using = subtasks instead of checkboxes, there are examples for this in the = documentation.

Yes, I recently started using this = feature (picked it up from the documentation) to achieve this for = subtask-TODOs ).


- = Carsten


--lss


On May 15, = 2010, at 23:44:21 , Livin Stephen Sharma = wrote:

This is a tree from a hypothetical minimal = org-file:
**** = TODO meet people = [100%]
 - = [X] John
 - = [X] Jane




How can I achieve = this:
TODO-state should automatically change to DONE when I have = checked-off both 'John' and 'Jane' = ?

1. The manual showed me how to = do this if John and Jane are also TODOs: using = org-after-todo-statistics-hook.
I just can't find the check-box = equivalent.

2. Google turned up = 'org-enforce-todo-checkbox-dependencies' - but that is only half of what = I'm looking for.


If this feature does not already = exist, I'd like to suggest this as a useful = enhancement.


Livin Stephen = Sharma




_______________________________________________
Emacs-orgmode mailing = list
Please use `Reply All' to = send replies to the list.
Emacs-orgmode@gnu.org
http://lists.= gnu.org/mailman/listinfo/emacs-orgmode

- = Carsten




= --Apple-Mail-6--567041727-- --===============1338058380== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode --===============1338058380==--