From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcelo de Moraes Serpa Subject: Re: Move to item to the bottom Date: Mon, 4 Jul 2011 22:27:13 -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> <87k4bz8zzk.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001636c5a2d5587cb604a74a0f78 Return-path: Received: from eggs.gnu.org ([140.186.70.92]:33823) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QdwI8-0000us-Hr for emacs-orgmode@gnu.org; Mon, 04 Jul 2011 23:27:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QdwI7-0007hT-IG for emacs-orgmode@gnu.org; Mon, 04 Jul 2011 23:27:16 -0400 Received: from mail-bw0-f41.google.com ([209.85.214.41]:34898) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QdwI7-0007hN-9j for emacs-orgmode@gnu.org; Mon, 04 Jul 2011 23:27:15 -0400 Received: by bwd14 with SMTP id 14so5719319bwd.0 for ; Mon, 04 Jul 2011 20:27:13 -0700 (PDT) In-Reply-To: <87k4bz8zzk.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 --001636c5a2d5587cb604a74a0f78 Content-Type: text/plain; charset=ISO-8859-1 I definitely need to get my head around elisp. Thank you very much. On Sun, Jul 3, 2011 at 4:39 AM, Nicolas Goaziou wrote: > Hello, > > Marcelo de Moraes Serpa writes: > > > 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. > > > Sure, it's simple as packing it into a (save-excursion ...) > > #+begin_src emacs-lisp > (defun ngz-move-headline-at-bottom () > "Move current headline to the last position in the same tree" > (interactive) > (unless (org-at-heading-p) (error "Not at an headline")) > (save-excursion (while (ignore-errors (org-move-subtree-down))))) > #+end_src > > Regards, > > -- > Nicolas Goaziou > --001636c5a2d5587cb604a74a0f78 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable I=A0definitely=A0need to get my head around elisp. Thank you very much.
=
On Sun, Jul 3, 2011 at 4:39 AM, Nicolas Goaz= iou <n.goaziou@= gmail.com> wrote:
Hello,

Marcelo de Moraes Serpa <celoserp= a@gmail.com> writes:

> Nicolas, the function works quite well! =A0Tha= nks. 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 po= inter
> is also put there and the buffer scrolls down with it.


Sure, it's simple as packing it into a (save-excursion ...)

#+begin_src emacs-lisp
(defun ngz-move-headline-at-bottom ()
=A0"Move current headline to the last position in the same tree"=
=A0(interactive)
=A0(unless (org-at-heading-p) (error "Not at an headline"))
=A0(save-excursion (while (ignore-errors (org-move-subtree-down)))))=
#+end_src

Regards,

--
Nicolas Goaziou

--001636c5a2d5587cb604a74a0f78--