Hello, John Kitchin <jkitc...@andrew.cmu.edu> writes:
> I am trying to find some ways to programatically modify org-elements that > use fewer regexps and motion commands. It seems like org-dp ( > https://github.com/tj64/org-dp) was intended to do that but it is not clear > enough how you might use it, and it also doesn't seem to support > plain-lists yet. [...] > It works on some things, e.g. headlines, src blocks. I put the point on one > of those things, run this command, and then I can paste it somewhere to see > that it did indeed work. > > But, it does not work on plain-lists, or paragraphs. I either get an empty > string, or Wrong type argument: char-or-string-p, nil > > Is it possible to do what I am describing? Am I just missing how to get the > element data in the right form? You cannot change a non-terminal element without changing its contents. In particular plain-lists, tables and paragraphs are fully defined by their contents, i.e., they do not decorate contents like headlines. In this case, data returned by `org-element-context' is incomplete in this case. You probably need to parse the buffer between :begin and :end and modify structure recursively. Regards, -- Nicolas Goaziou