Skip to content

Instantly share code, notes, and snippets.

@joonro
Last active May 22, 2018 19:23
Show Gist options
  • Save joonro/b400f14cf284339602f822c02bfdb22b to your computer and use it in GitHub Desktop.
Save joonro/b400f14cf284339602f822c02bfdb22b to your computer and use it in GitHub Desktop.
#+BEGIN_SRC emacs-lisp :results none
(setq properties-list '("Title" "Composer" "Publisher" "NDisks"))
(let ((MATCH t)
(SCOPE 'file)
(SKIP nil)
(spacing nil))
(org-map-entries
(lambda ()
(let ((level (nth 1 (org-heading-components))))
(if (= level 3)
(save-restriction
(org-narrow-to-subtree)
(goto-char (point-max))
(org-insert-heading)
(insert "New Entry\n")
(dolist (property properties-list)
(org-entry-put (point) property nil)
)
;; now cut tree and paste at level 4
(org-cut-subtree)
(org-paste-subtree 4)
)))) MATCH SCOPE SKIP))
#+END_SRC
** Class One
*** Student 1
**** Essay 1
*** Student 2
*** Student 3
**** Essay 1
** Class Two
*** Student 1
*** Student 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment