Hello, > Well... the most important point for me is that it shouldn't choke on > these lines, but otherwise I'm open to suggestions.
In your case, I think that the problem really comes from a bad case matching: if SUBMITTED is a keyword, "** Submitted" shouldn't be matched. IOW, todo keywords are/ought to be case sensitive. > My rationale for doing it this way was: > > * The code I looked at assumes that the headline text is there, so > it's likely that it's the common assumption. > * It is clearly the case that todo keywords are optional. > * It is not so clear that the headline text is optional >From my point of view everything is optional but todo keywords and tags bind stronger than headline's text. I.e. ** TODO :work: is an empty headline with a TODO keyword and a "work" tag. > However: > > * The regular expression matches completely empty headlines, so maybe > the intention is to allow matching items with just a todo keyword? Yes, it is. Note that I'm not convinced by empty headlines nor do I use them, but as an outliner, Org should accept them nonetheless. The question is: how much of the code base shares this opinion? Regards, -- Nicolas Goaziou