From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcelo de Moraes Serpa Subject: Re: Move to item to the bottom Date: Sat, 2 Jul 2011 21:02:52 -0500 Message-ID: References: <878vsjb14b.fsf@gmail.com> <87zkkya4ok.fsf@gmail.com> <87hb765qfz.fsf@gnu.org> <87mxgy9xjq.fsf@gmail.com> <87vcvmxs5h.fsf@gnu.org> <87wrg08oxz.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=0003255540bafe8ca204a720a5e9 Return-path: Received: from eggs.gnu.org ([140.186.70.92]:60781) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QdC1R-0000x1-39 for emacs-orgmode@gnu.org; Sat, 02 Jul 2011 22:02:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QdC1P-0004X2-8K for emacs-orgmode@gnu.org; Sat, 02 Jul 2011 22:02:56 -0400 Received: from mail-bw0-f41.google.com ([209.85.214.41]:38125) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QdC1O-0004Wf-FF for emacs-orgmode@gnu.org; Sat, 02 Jul 2011 22:02:54 -0400 Received: by bwd14 with SMTP id 14so4447677bwd.0 for ; Sat, 02 Jul 2011 19:02:52 -0700 (PDT) In-Reply-To: <87wrg08oxz.fsf@gmail.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Nicolas Goaziou Cc: Bastien , Org Mode --0003255540bafe8ca204a720a5e9 Content-Type: text/plain; charset=ISO-8859-1 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 wrote: > Hello, > > Bastien writes: > > > Nicolas Goaziou 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 ). > > So, what do you all think about it? > > > Regards, > > -- > Nicolas Goaziou > --0003255540bafe8ca204a720a5e9 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Nicolas, the function works quite well! =A0Thanks. Just one last request: I= s it possible to not follow the item until the bottom? The issue is that, o= nce running it and when the item is sent to the bottom of the file, the poi= nter 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><= /span> 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:

=A0 =A0 =A0 =A0 =A0 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:

=A0Send ITEM to destination DEST.

=A0STRUCT is the list structure.

=A0DEST can have various values.

=A0If DEST is a buffer position, the function will assume it points
=A0to another item in the same list as ITEM, and will move the
=A0latter just before the former.

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

=A0If DEST is a string like "N", where N is an integer, ITEM wil= l
=A0be moved at the Nth position in the list.

=A0If DEST is `kill-ring', ITEM will be deleted and its body will be =A0added to the kill-ring.

=A0If DEST is nil, ITEM will be deleted.

=A0This 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:
=A01. it doesn't add yet another key-binding;
=A02. it doesn't prevent macros to stop at the beginning of the list =A0 =A0 (when using C-u 0 <F4>).

So, what do you all think about it?


Regards,

--
Nicolas Goaziou

--0003255540bafe8ca204a720a5e9--