Created
June 10, 2010 16:31
-
-
Save takumikinjo/433251 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; http://article.gmane.org/gmane.emacs.orgmode/10256 | |
(defun org-get-heading-title () | |
"Returns the heading of the current entry as a string, without the leading stars, the TODO keyword or the tags." | |
(let ((title-with-props (org-get-heading t)) | |
(keyword (org-get-todo-state))) | |
(substring-no-properties title-with-props (if keyword (1+ (length keyword)))))) | |
(defun org-insert-heading-category () | |
"Insert a :CATEGORY: property and it's value to the PROPERTY drawer at point." | |
(interactive) | |
(let ((point (point))) | |
(org-entry-put point "CATEGORY" (org-get-heading-title)))) | |
(defun org-insert-heading-categories-all () | |
"Insert :CATEGORY: properties to each headlines indented level 2." | |
(interactive) | |
(org-map-entries | |
(lambda () | |
(if (eq 2 (org-current-level)) | |
(org-insert-heading-category))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment