all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Florian Beck <abstraktion@t-online.de>
To: Jeff Horn <jrhorn424@gmail.com>
Cc: Org-mode ml <emacs-orgmode@gnu.org>
Subject: Re: Refiling list items
Date: Mon, 08 Aug 2011 18:12:19 +0200	[thread overview]
Message-ID: <874o1r9924.fsf@sophokles.streitblatt.de> (raw)
In-Reply-To: CA+K2SAyswO3ce+s+On83=g4tqDx6CAO6LyQAwgfsqJuKZFVMdw@mail.gmail.com

Jeff Horn <jrhorn424@gmail.com> 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 <jrhorn424@gmail.com> 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

  parent reply	other threads:[~2011-08-08 16:12 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-06 18:54 Refiling list items Jeff Horn
2011-08-08  4:09 ` Jeff Horn
2011-08-08  9:48   ` Nicolas Goaziou
2011-08-08 22:35     ` Jeff Horn
2011-08-08 23:03       ` Nicolas Goaziou
2011-08-08 23:47         ` Jeff Horn
2011-08-09  0:02           ` Nick Dokos
2011-08-09  2:31             ` suvayu ali
2011-08-09  0:20           ` Nick Dokos
2011-08-09  0:40             ` Jeff Horn
2011-08-09  0:45               ` Jeff Horn
2011-08-10 10:05               ` Nicolas Goaziou
2011-08-10 15:16                 ` Jeff Horn
2011-08-17  9:32                 ` Bastien
2011-08-22 16:12                   ` Jeff Horn
2012-01-18  4:56                   ` Jeff Horn
2013-06-28 21:09                     ` Samuel Wales
2013-06-30 23:16                       ` Bastien
2013-07-01 21:35                         ` Samuel Wales
2013-07-02  7:32                           ` Bastien
2011-08-09  1:07           ` Florian Beck
2011-08-08 16:12   ` Florian Beck [this message]
2011-08-08 17:05     ` Nicolas Goaziou

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=874o1r9924.fsf@sophokles.streitblatt.de \
    --to=abstraktion@t-online.de \
    --cc=emacs-orgmode@gnu.org \
    --cc=jrhorn424@gmail.com \
    /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.