Created
May 18, 2020 01:08
-
-
Save commander-trashdin/c193491ab2f12f23685ea0353f6523ca to your computer and use it in GitHub Desktop.
I'm just trying to help
This file contains hidden or 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
| (defun tt-heading-description () | |
| "Get header and description of first header element in buffer." | |
| (with-temp-buffer | |
| (insert " | |
| * Top Heading | |
| Some description | |
| * Second Heading | |
| Other description | |
| ") | |
| (let ((first-headline (seq-find (lambda (part) (eql (car part) 'headline)) (org-element-parse-buffer)))) | |
| (let ((contents-begin (org-element-property :contents-begin first-headline)) | |
| (contents-end (org-element-property :contents-end first-headline))) | |
| (list | |
| (org-element-property :raw-value first-headline) | |
| (buffer-substring contents-begin (- contents-end 1))))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment