Nicolas, the function works quite well!  Thanks. Just one last request: Is it possible to not follow the item until the bottom? The issue is that, once running it and when the item is sent to the bottom of the file, the pointer is also put there and the buffer scrolls down with it.

Cheers,

M>

On Sat, Jul 2, 2011 at 2:25 PM, Nicolas Goaziou <n.goaziou@gmail.com> wrote:
Hello,

Bastien <bzg@altern.org> writes:

> Nicolas Goaziou <n.goaziou@gmail.com> writes:
>
>> It needs a better optimization (my excuse for
>> `org-list-delete-item'). I will work on it tonight.
>
> Thanks!

I've pushed a draft to:

          git://github.com/ngz/org-mode-lists.git move-cycle


The branch is made of two patches. The first one implements the
all-mighty (but not-so useful) `org-list-send-item' function. Here is
its doc-string:

 Send ITEM to destination DEST.

 STRUCT is the list structure.

 DEST can have various values.

 If DEST is a buffer position, the function will assume it points
 to another item in the same list as ITEM, and will move the
 latter just before the former.

 If DEST is `begin' (resp. `end'), ITEM will be moved at the
 beginning (resp. end) of the list it belongs to.

 If DEST is a string like "N", where N is an integer, ITEM will
 be moved at the Nth position in the list.

 If DEST is `kill-ring', ITEM will be deleted and its body will be
 added to the kill-ring.

 If DEST is nil, ITEM will be deleted.

 This function returns, destructively, the new list structure.


The second one changes the behavior of `org-move-item-up' (and not
`org-move-item-down, for comparison). When the user tries to move the
first item of a list up, the function will ask him whether he wants to
roll it back to the end of the list, or not.

I'm not particularly convinced by that feature, but I implemented it
nonetheless for 2 reasons:
 1. it doesn't add yet another key-binding;
 2. it doesn't prevent macros to stop at the beginning of the list
    (when using C-u 0 <F4>).

So, what do you all think about it?


Regards,

--
Nicolas Goaziou