From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcelo de Moraes Serpa Subject: Re: Move to item to the bottom Date: Thu, 7 Jul 2011 10:51:18 -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=bcaec5540a7e13360004a77cb02f Return-path: Received: from eggs.gnu.org ([140.186.70.92]:51669) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QeqrK-00008j-1F for emacs-orgmode@gnu.org; Thu, 07 Jul 2011 11:51:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QeqrI-00044D-MI for emacs-orgmode@gnu.org; Thu, 07 Jul 2011 11:51:21 -0400 Received: from mail-bw0-f52.google.com ([209.85.214.52]:56919) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QeqrI-000446-1O for emacs-orgmode@gnu.org; Thu, 07 Jul 2011 11:51:20 -0400 Received: by bwj24 with SMTP id 24so1797042bwj.39 for ; Thu, 07 Jul 2011 08:51:18 -0700 (PDT) In-Reply-To: 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 --bcaec5540a7e13360004a77cb02f Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable It's obvious, but here's the snippet to promote the headline for your convenience: (defun ngz-move-headline-up () "Move current headline to the top of the tree" (interactive) (unless (org-at-heading-p) (error "Not at an headline")) (save-excursion (while (ignore-errors (org-move-subtree-up))))) The only minor issue I have now is with my org file conf section. It's supposed to be the last item in the file, but when I send the item to the bottom, it starts pilling up as I add more. It would be nice if we could setup a special tag for the conf section of th= e org file, i.e: * conf :HIDDEN: #+STARTUP: overview ... HIDDEN items would be hidden unless show-hidden-items toggles. Does that make sense? Cheers, =EF=9C=81 Marcelo. On Mon, Jul 4, 2011 at 10:27 PM, Marcelo de Moraes Serpa < celoserpa@gmail.com> wrote: > I definitely need to get my head around elisp. Thank you very much. > > > On Sun, Jul 3, 2011 at 4:39 AM, Nicolas Goaziou wrot= e: > >> 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 >> > > --bcaec5540a7e13360004a77cb02f Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable It's obvious, but here's the snippet to promote the headline for yo= ur convenience:


(defun ngz-move-head= line-up ()
=C2=A0 "Move current headline to the top of the t= ree"
=C2=A0 (interactive)
=C2=A0 (unless (org-at-heading-p) (erro= r "Not at an headline"))
=C2=A0 (save-excursion (while = (ignore-errors (org-move-subtree-up)))))


The only minor issue I have now is with my org file conf section. It&= #39;s supposed to be the last item in the file, but when I send the item to= the bottom, it starts pilling up as I add more.=C2=A0

It would be nice if we could setup a special tag for th= e conf section of the org file, i.e:

* conf =C2=A0= :HIDDEN:
#+STARTUP: overview
...

HIDDEN items would be hidden unless show-hidden-items toggles. Does that ma= ke sense?

Cheers,
=EF=9C=81
Ma= rcelo.

On Mon, Jul 4, 2011 at 10:27 PM,= Marcelo de Moraes Serpa <celoserpa@gmail.com> wrote:
I=C2=A0definitely=C2=A0need to get my head = around elisp. Thank you very much.

On Sun, Jul 3, 2011 at 4:39 AM, Nicolas Goaziou <n.goaziou@gmail.com= > wrote:
Hello,

Marcelo de Moraes Serpa <celoserpa@gmail.com> writes:

> Nicolas, the function works quite well! =C2=A0Thanks. 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 ()
=C2=A0"Move current headline to the last position in the same tree&qu= ot;
=C2=A0(interactive)
=C2=A0(unless (org-at-heading-p) (error "Not at an headline"))
=C2=A0(save-excursion (while (ignore-errors (org-move-subtree-down))= )))
#+end_src

Regards,

--
Nicolas Goaziou


--bcaec5540a7e13360004a77cb02f--