From mboxrd@z Thu Jan 1 00:00:00 1970 From: Florian Beck Subject: Re: Refiling list items Date: Mon, 08 Aug 2011 18:12:19 +0200 Message-ID: <874o1r9924.fsf@sophokles.streitblatt.de> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([140.186.70.92]:46782) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QqSRG-0004zT-IL for emacs-orgmode@gnu.org; Mon, 08 Aug 2011 12:12:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QqSRF-00070U-Fz for emacs-orgmode@gnu.org; Mon, 08 Aug 2011 12:12:26 -0400 Received: from mo-p05-ob.rzone.de ([81.169.146.182]:20881) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QqSRF-00070H-8J for emacs-orgmode@gnu.org; Mon, 08 Aug 2011 12:12:25 -0400 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Jeff Horn Cc: Org-mode ml Jeff Horn writes: > Would someone throw me a bone? I couldn't find anything on gmane, but > I my gmane-fu isn't the strongest. :D > > On Sat, Aug 6, 2011 at 14:54, Jeff Horn wrote: >> Should org-refile be able to refile list items? I suspect it would be >> non-trivial to add this functionality if it isn't already there, but I >> feel a bit overwhelmed keeping notes as headlines, particularly >> because I like to leave soft wrapping off and have a hard wrap at 80 >> columns. Here is a hack I use. It doesn't do any bookkeeping, doesn't check for errors, (temporarily) moves the point during refiling and you might want to set `org-refile-targets' to your liking. On the other hand, it might just do the trick: (defun org-copy-item (&optional kill) "Copy item at point to another location. With prefix argument, move the item." (interactive "P") (org-get-item kill) (let ((org-refile-targets '((org-default-notes-file :maxlevel . 4)))) (save-window-excursion (org-refile t) (outline-next-visible-heading 1) (skip-chars-backward " \t\n") (insert "\n") (yank)))) (defun org-get-item (&optional kill) "Copy the item at point to the kill ring. Optionally, kill it." (save-excursion (let ((beg (org-in-item-p))) (org-end-of-item) (funcall (if kill 'kill-region 'copy-region-as-kill) beg (point))))) -- Florian Beck