From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bernt Hansen Subject: Re: two new functions: org-move-thing-up org-move-thing-down Date: Thu, 12 Feb 2009 11:13:31 -0500 Message-ID: <87eiy363bo.fsf@gollum.intra.norang.ca> References: <874oyzabsv.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LXeZg-00049H-6Y for emacs-orgmode@gnu.org; Thu, 12 Feb 2009 11:38:04 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LXeZe-00047x-H5 for emacs-orgmode@gnu.org; Thu, 12 Feb 2009 11:38:03 -0500 Received: from [199.232.76.173] (port=42799 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LXeZe-00047q-9L for emacs-orgmode@gnu.org; Thu, 12 Feb 2009 11:38:02 -0500 Received: from mho-02-bos.mailhop.org ([63.208.196.179]:51514) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LXeC5-0007nT-Tq for emacs-orgmode@gnu.org; Thu, 12 Feb 2009 11:13:42 -0500 In-Reply-To: <874oyzabsv.fsf@gmail.com> (Richard KLINDA's message of "Thu\, 12 Feb 2009 16\:56\:48 +0100") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Richard KLINDA Cc: emacs-orgmode@gnu.org 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 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