Skip to content

Org reader doesn't support parsing fast access TODO states #10792

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
RyanGibb opened this issue Apr 19, 2025 · 3 comments
Open

Org reader doesn't support parsing fast access TODO states #10792

RyanGibb opened this issue Apr 19, 2025 · 3 comments
Labels

Comments

@RyanGibb
Copy link

RyanGibb commented Apr 19, 2025

Relevant section of the org-mode manual: https://orgmode.org/manual/Fast-access-to-TODO-states.html

I.e. this isn't parsed as a keyword:

#+TODO: TODO(t) | DONE(d)
* TODO test
[ Header
    1
    ( "todo-test" , [] , [] )
    [ Str "TODO" , Space , Str "test" ]
]

But this is:

#+TODO: TODO(t) | DONE(d)
* TODO(t) test
[ Header
    1
    ( "test" , [] , [] )
    [ Span
        ( "" , [ "todo" , "TODO(t)" ] , [] ) [ Str "TODO(t)" ]
    , Space
    , Str "test"
    ]
]

I think this is where the omission is

todoKeyword :: Monad m => OrgParser m Text
todoKeyword = many1Char nonspaceChar <* skipSpaces
todoKeywords :: Monad m => OrgParser m [Text]
todoKeywords = try $
let endOfKeywords = todoDoneSep <|> void newline
in manyTill todoKeyword (lookAhead endOfKeywords)
doneKeywords :: Monad m => OrgParser m [Text]
doneKeywords = try $
manyTill (todoKeyword <* optional todoDoneSep) (lookAhead newline)

I'm on pandoc 3.1.11.1.

@RyanGibb RyanGibb added the bug label Apr 19, 2025
@jgm
Copy link
Owner

jgm commented Apr 21, 2025

This goes beyond my Org-mode knowledge, and the manual section you link to just describes modifying this in elisp, not the behavior of #+TODO: ....

@tarleb, who wrote this code, may be able to help.

@RyanGibb
Copy link
Author

Right! From my experiments org mode does support this with #+TODO: ..., as in the example above. I might be able to create a PR for this if there would be an appetite for it.

@tarleb
Copy link
Collaborator

tarleb commented May 15, 2025

@RyanGibb a PR would be most welcome. Please let us know if we can be of assistance there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants