Answer: org-mode how to keep the level when refilingsteemCreated with Sketch.

in org-mode •  6 years ago  (edited)

Question: https://emacs.stackexchange.com/questions/41362

Snapshot:

Answer:

(defun org-mode-keep-the-level-when-refiling ()
  (interactive)
  (cl-destructuring-bind (level reduced-level todo-keyword priority-character headline-text tags-string)
      (org-heading-components)
    (org-refile)
    (goto-char
     (point-max))
    (re-search-backward-lax-whitespace
     (format "** %s" headline-text))
    (dotimes (i 2)
      (org-toggle-heading level))))
Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!