emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Trying to write an elisp function to move subtree to end of file
@ 2010-09-21 23:42 Charles Cave
  2010-09-22  5:22 ` Noorul Islam K M
  2010-09-22  5:58 ` Nick Dokos
  0 siblings, 2 replies; 3+ messages in thread
From: Charles Cave @ 2010-09-21 23:42 UTC (permalink / raw)
  To: emacs-orgmode

I am writing an elisp function to move the subtree (at the point/cursor)
to the end of the file.  The code from .elisp is shown

I get an error message "Invalid function: (org-cut-subtree)

(defun move-subtree-to-end ()
  (interactive)
  (save-excursion (
  (org-cut-subtree)
  (end-of-buffer)
   (org-paste-subtree))
  )
)
(global-set-key (kbd "C-c e") 'move-subtree-to-end)

To give you background, my todo list/journal has been captured in 
a date tree and I would like to move an item to the end of the buffer.
The reason for this will be explained in an upcoming article!

Refiling is not applicable as (I don't think) the target can be defined.

A date tree looks like:

* 2010
** 2010-07 July...
** 2010-08 August...
** 2010-09 September
*** 2010-09-21 Tuesday
**** Headline of added entry
**** Headline of another entry
*** 2010-09-22 Wednesday


Thanks!
Charles

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Trying to write an elisp function to move subtree to end of file
  2010-09-21 23:42 Trying to write an elisp function to move subtree to end of file Charles Cave
@ 2010-09-22  5:22 ` Noorul Islam K M
  2010-09-22  5:58 ` Nick Dokos
  1 sibling, 0 replies; 3+ messages in thread
From: Noorul Islam K M @ 2010-09-22  5:22 UTC (permalink / raw)
  To: Charles Cave; +Cc: emacs-orgmode

Charles Cave <charles_cave@optusnet.com.au> writes:

> I am writing an elisp function to move the subtree (at the point/cursor)
> to the end of the file.  The code from .elisp is shown
>
> I get an error message "Invalid function: (org-cut-subtree)
>
> (defun move-subtree-to-end ()
>   (interactive)
>   (save-excursion (
>   (org-cut-subtree)
>   (end-of-buffer)
>    (org-paste-subtree))
>   )
> )
> (global-set-key (kbd "C-c e") 'move-subtree-to-end)
>
> To give you background, my todo list/journal has been captured in 
> a date tree and I would like to move an item to the end of the buffer.
> The reason for this will be explained in an upcoming article!
>
> Refiling is not applicable as (I don't think) the target can be defined.

I wonder why this is not an option. Can you please elaborate a bit?

Thanks and Regards
Noorul

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Trying to write an elisp function to move subtree to end of file
  2010-09-21 23:42 Trying to write an elisp function to move subtree to end of file Charles Cave
  2010-09-22  5:22 ` Noorul Islam K M
@ 2010-09-22  5:58 ` Nick Dokos
  1 sibling, 0 replies; 3+ messages in thread
From: Nick Dokos @ 2010-09-22  5:58 UTC (permalink / raw)
  To: Charles Cave; +Cc: nicholas.dokos, emacs-orgmode

Charles Cave <charles_cave@optusnet.com.au> wrote:

> I am writing an elisp function to move the subtree (at the point/cursor)
> to the end of the file.  The code from .elisp is shown
> 
> I get an error message "Invalid function: (org-cut-subtree)
> 
> (defun move-subtree-to-end ()
>   (interactive)
>   (save-excursion (
>   (org-cut-subtree)
>   (end-of-buffer)
>    (org-paste-subtree))
>   )
> )
> (global-set-key (kbd "C-c e") 'move-subtree-to-end)
> 

A few too many parens: try

(defun move-subtree-to-end ()
  (interactive)

  (save-excursion
    (org-cut-subtree)
    (end-of-buffer)
    (org-paste-subtree))
)

HTH,
Nick

> To give you background, my todo list/journal has been captured in 
> a date tree and I would like to move an item to the end of the buffer.
> The reason for this will be explained in an upcoming article!
> 
> Refiling is not applicable as (I don't think) the target can be defined.
> 
> A date tree looks like:
> 
> * 2010
> ** 2010-07 July...
> ** 2010-08 August...
> ** 2010-09 September
> *** 2010-09-21 Tuesday
> **** Headline of added entry
> **** Headline of another entry
> *** 2010-09-22 Wednesday
> 
> 
> Thanks!
> Charles
> 
> 
> 
> _______________________________________________
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-09-22  5:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-21 23:42 Trying to write an elisp function to move subtree to end of file Charles Cave
2010-09-22  5:22 ` Noorul Islam K M
2010-09-22  5:58 ` Nick Dokos

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).