emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Moving checkbox item to end of list when checked


From: Thorsten Jolitz
Subject: Re: [O] Moving checkbox item to end of list when checked
Date: Wed, 22 Jan 2014 13:16:28 +0100
User-agent: Gnus/5.130002 (Ma Gnus v0.2) Emacs/24.3 (gnu/linux)

Cecil Westerhof <address@hidden> writes:

> I have the folowing:
> * Actions
 - [X] A
 - [ ] B
 - [ ] C
>
> When on A I give ‘C-c C-c’ I get:
> * Actions
>   - [X] A
>   - [ ] B
>   - [ ] C
>
> but I would like to get:
> * Actions
>   - [ ] B
>   - [ ] C
>   - [X] A
>
> Is this possible?
> If not I could write an alias for it I think. Is there a command for
> going to the end of the list?

Your function could be implemented along the line of:

1. put an 'after' advice on `org-toggle-checkbox'
2. use function `org-list-send-item' with DEST 'end to send 'ITEM at
   point' to the end of 'STRUCT at point' in this advice

#+begin_src emacs-lisp
(defun org-list-send-item (item dest struct)
  "Send ITEM to destination DEST.
  ...)
#+end_src

Its easy to get 'struct at point' with

#+begin_src emacs-lisp
(defun org-list-struct ()
  "Return structure of list at point.
   ...)
#+end_src

but I could not find an equivalent function to get the item at
point. 

-- 
cheers,
Thorsten




reply via email to

[Prev in Thread] Current Thread [Next in Thread]