[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Orgmode] Re: two new functions: org-move-thing-up org-move-thing-down
From: |
Bernt Hansen |
Subject: |
[Orgmode] Re: two new functions: org-move-thing-up org-move-thing-down |
Date: |
Thu, 12 Feb 2009 11:13:31 -0500 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux) |
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 <address@hidden> 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.
> address@hidden
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode