* two new functions: org-move-thing-up org-move-thing-down
@ 2009-02-12 15:56 Richard KLINDA
2009-02-12 16:13 ` Bernt Hansen
0 siblings, 1 reply; 3+ messages in thread
From: Richard KLINDA @ 2009-02-12 15:56 UTC (permalink / raw)
To: emacs-orgmode
Here are two functions for moving things around. Useful to bind them to
keys.
Carsten, please include these functions in org if you think it's ok.
,----[ for me it is ]
| (define-key org-mode-map [(alt ?N)] 'org-move-thing-up)
| (define-key org-mode-map [(alt ?T)] 'org-move-thing-down)
`----
,----
| (defun org-move-thing-up ()
| "Move table row, headline or list item up."
| (interactive)
| (let ((headline-p (save-excursion
| (beginning-of-line)
| (when (looking-at (concat "^\\(" outline-regexp "\\)"))
| t))))
| (cond ((org-at-table-p) (org-table-move-row-up))
| (headline-p (org-move-subtree-up))
| (t (org-move-item-up 1)))))
|
| (defun org-move-thing-down ()
| "Move table row, headline or list item down."
| (interactive)
| (let ((headline-p (save-excursion
| (beginning-of-line)
| (when (looking-at (concat "^\\(" outline-regexp "\\)"))
| t))))
| (cond ((org-at-table-p) (org-table-move-row-down))
| (headline-p (org-move-subtree-down))
| (t (org-move-item-down)))))
`----
--
Udv, Richard
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: two new functions: org-move-thing-up org-move-thing-down
2009-02-12 15:56 two new functions: org-move-thing-up org-move-thing-down Richard KLINDA
@ 2009-02-12 16:13 ` Bernt Hansen
2009-02-12 16:46 ` Richard KLINDA
0 siblings, 1 reply; 3+ messages in thread
From: Bernt Hansen @ 2009-02-12 16:13 UTC (permalink / raw)
To: Richard KLINDA; +Cc: emacs-orgmode
How are these functions different from org-metaup and org-metadown which
are bound to M-up arrow and M-down arrow on my system?
-Bernt
Richard KLINDA <rklinda@gmail.com> writes:
> Here are two functions for moving things around. Useful to bind them to
> keys.
>
> Carsten, please include these functions in org if you think it's ok.
>
> ,----[ for me it is ]
> | (define-key org-mode-map [(alt ?N)] 'org-move-thing-up)
> | (define-key org-mode-map [(alt ?T)] 'org-move-thing-down)
> `----
>
> ,----
> | (defun org-move-thing-up ()
> | "Move table row, headline or list item up."
> | (interactive)
> | (let ((headline-p (save-excursion
> | (beginning-of-line)
> | (when (looking-at (concat "^\\(" outline-regexp "\\)"))
> | t))))
> | (cond ((org-at-table-p) (org-table-move-row-up))
> | (headline-p (org-move-subtree-up))
> | (t (org-move-item-up 1)))))
> |
> | (defun org-move-thing-down ()
> | "Move table row, headline or list item down."
> | (interactive)
> | (let ((headline-p (save-excursion
> | (beginning-of-line)
> | (when (looking-at (concat "^\\(" outline-regexp "\\)"))
> | t))))
> | (cond ((org-at-table-p) (org-table-move-row-down))
> | (headline-p (org-move-subtree-down))
> | (t (org-move-item-down)))))
> `----
>
> --
> Udv, Richard
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Remember: 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
* Re: two new functions: org-move-thing-up org-move-thing-down
2009-02-12 16:13 ` Bernt Hansen
@ 2009-02-12 16:46 ` Richard KLINDA
0 siblings, 0 replies; 3+ messages in thread
From: Richard KLINDA @ 2009-02-12 16:46 UTC (permalink / raw)
To: emacs-orgmode
>>>>> Regarding 'Re: two new functions: org-move-thing-up org-move-thing-down'; Bernt Hansen adds:
> How are these functions different from org-metaup and org-metadown
> which are bound to M-up arrow and M-down arrow on my system?
I did not know about them, I was looking for "org.*move", now I use
org-metadown and -metaup. Thank you.
--
Udv, Richard
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-02-12 16:49 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-12 15:56 two new functions: org-move-thing-up org-move-thing-down Richard KLINDA
2009-02-12 16:13 ` Bernt Hansen
2009-02-12 16:46 ` Richard KLINDA
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).