From: Richard KLINDA <rklinda@gmail.com>
To: emacs-orgmode@gnu.org
Subject: two new functions: org-move-thing-up org-move-thing-down
Date: Thu, 12 Feb 2009 16:56:48 +0100 [thread overview]
Message-ID: <874oyzabsv.fsf@gmail.com> (raw)
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
next reply other threads:[~2009-02-12 15:59 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-12 15:56 Richard KLINDA [this message]
2009-02-12 16:13 ` two new functions: org-move-thing-up org-move-thing-down Bernt Hansen
2009-02-12 16:46 ` Richard KLINDA
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=874oyzabsv.fsf@gmail.com \
--to=rklinda@gmail.com \
--cc=emacs-orgmode@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.