emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Carsten Dominik <carsten.dominik@gmail.com>
To: Bernt Hansen <bernt@norang.ca>
Cc: emacs-orgmode@gnu.org
Subject: Re: [PATCH] New function org-reset-checkbox-state which always clears the checkboxes
Date: Fri, 24 Apr 2009 15:43:35 +0200	[thread overview]
Message-ID: <FF6E339B-AF4A-4543-9ADE-E6CF5F8A924C@gmail.com> (raw)
In-Reply-To: <1240579733-7219-1-git-send-email-bernt@norang.ca>

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

  reply	other threads:[~2009-04-24 13:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-24 13:28 [PATCH] New function org-reset-checkbox-state which always clears the checkboxes Bernt Hansen
2009-04-24 13:43 ` Carsten Dominik [this message]
2009-04-24 15:48   ` Bernt Hansen
2009-05-04 14:58     ` Carsten Dominik

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=FF6E339B-AF4A-4543-9ADE-E6CF5F8A924C@gmail.com \
    --to=carsten.dominik@gmail.com \
    --cc=bernt@norang.ca \
    --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).