From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: [PATCH] New function org-reset-checkbox-state which always clears the checkboxes Date: Fri, 24 Apr 2009 15:43:35 +0200 Message-ID: References: <1240579733-7219-1-git-send-email-bernt@norang.ca> Mime-Version: 1.0 (Apple Message framework v930.3) Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LxLgv-0006J1-3o for emacs-orgmode@gnu.org; Fri, 24 Apr 2009 09:43:45 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LxLgp-0006Ia-Hl for emacs-orgmode@gnu.org; Fri, 24 Apr 2009 09:43:43 -0400 Received: from [199.232.76.173] (port=54992 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LxLgp-0006IS-3F for emacs-orgmode@gnu.org; Fri, 24 Apr 2009 09:43:39 -0400 Received: from mail-ew0-f162.google.com ([209.85.219.162]:37797) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LxLgo-0006NO-GY for emacs-orgmode@gnu.org; Fri, 24 Apr 2009 09:43:38 -0400 Received: by ewy6 with SMTP id 6so1019490ewy.42 for ; Fri, 24 Apr 2009 06:43:37 -0700 (PDT) In-Reply-To: <1240579733-7219-1-git-send-email-bernt@norang.ca> 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: Bernt Hansen Cc: emacs-orgmode@gnu.org Applied, thanks. Maybe we should move this function into org-list.el. - Carsten On Apr 24, 2009, at 3:28 PM, Bernt Hansen wrote: > Copying subtrees with checked off lists to create a new task would > normally require the boxes to be unchecked. This function lets > you easily clear all checkboxes in an entry without requiring > the RESET_CHECK_BOXES property. > --- > This patch is available at git://git.norang.ca/org-mode.git for- > carsten > > contrib/lisp/org-checklist.el | 27 ++++++++++++++++----------- > 1 files changed, 16 insertions(+), 11 deletions(-) > > diff --git a/contrib/lisp/org-checklist.el b/contrib/lisp/org- > checklist.el > index 9661b53..c3348bc 100644 > --- a/contrib/lisp/org-checklist.el > +++ b/contrib/lisp/org-checklist.el > @@ -52,17 +52,22 @@ > "Reset all checkboxes in an entry if the `RESET_CHECK_BOXES' > property is set" > (interactive "*") > (if (org-entry-get (point) "RESET_CHECK_BOXES") > - (save-restriction > - (save-excursion > - (org-narrow-to-subtree) > - (org-show-subtree) > - (goto-char (point-min)) > - (let ((end (point-max))) > - (while (< (point) end) > - (when (org-at-item-checkbox-p) > - (replace-match "[ ]" t t)) > - (beginning-of-line 2)))) > - (org-update-checkbox-count-maybe)))) > + (org-reset-checkbox-state))) > + > +(defun org-reset-checkbox-state () > + "Reset all checkboxes in an entry" > + (interactive "*") > + (save-restriction > + (save-excursion > + (org-narrow-to-subtree) > + (org-show-subtree) > + (goto-char (point-min)) > + (let ((end (point-max))) > + (while (< (point) end) > + (when (org-at-item-checkbox-p) > + (replace-match "[ ]" t t)) > + (beginning-of-line 2)))) > + (org-update-checkbox-count-maybe))) > > (defun org-make-checklist-export () > "Produce a checklist containing all unchecked items from a list > -- > 1.6.3.rc1.34.g0be9b > > > > _______________________________________________ > Emacs-orgmode mailing list > Remember: use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode