Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (defun simpson-org-to-todo()
- "Convert a line (or region) in an org file to a TODO"
- (interactive)
- (let ((heading "") (i 1) (number (read-number "What level?" 1)))
- (while (<= i number)
- (setq heading (concat heading "*"))
- (setq i (+ i 1)))
- (if (region-active-p)
- (let ((strings (seq-map (lambda(x) (concat heading " TODO " x))
- (split-string (buffer-substring-no-properties (region-beginning) (region-end)) "\n" t))))
- (delete-active-region)
- (insert (mapconcat 'identity strings "\n")))
- (org-beginning-of-line)
- (insert heading " TODO ") t)))
Add Comment
Please, Sign In to add comment