Hi, Matt Price <mopto...@gmail.com> writes:
> I feel like I should know how to do this -- how od I retrieve the current > headline as an org-element object? > > context: I want to take a headline like this > > ** Jane Doe > - demonstrates an understanding of research topic :: yes > - Annotated Bibliography :: very nicely done > - Grammar and Spelling :: no major problems, but see inline comments > - Further Comments :: see file > - Grade :: A > > And set the headline's "GRADE" property to the value of the "- Grade ::" > line. But, I want to make sure that I'm still in the current headline when > I set the property (rather than accidentally navigating to the next > headline, because the current headline doesn't contain a "- Grade ::" lin). > > Tanks as always for the help! I'm pretty sure I've asked this question > before but can't find the answer... Would this do what you want? (save-excursion (org-back-to-heading) (org-element-at-point)) If you have a more sophisticated parse tree you could use org-element-lineage. Rasmus -- Don't slow down Johnny, leave the Cadillac runnin'