(** Document configuration from pre-scan. This module holds document-level settings extracted from file-local declarations such as #+TODO lines. These affect how the structural lexer and normalization interpret the document. *) type todo_sequence = { active : string list; done_ : string list } (** A TODO keyword sequence: active keywords followed by done keywords. *) type t = { todo_sequences : todo_sequence list; (** All TODO keyword sequences declared in the file. Default: one sequence with active=["TODO"] done_=["DONE"]. *) } (** Document configuration. *) (** The default configuration when no #+TODO declarations are present. *) let default = { todo_sequences = [ { active = [ "TODO" ]; done_ = [ "DONE" ] } ] } (** Return all TODO keywords (both active and done) from the config. *) let all_todo_keywords config = List.concat_map (fun seq -> seq.active @ seq.done_) config.todo_sequences (** Check if a word is a known TODO keyword. *) let is_todo_keyword config word = List.exists (fun seq -> List.mem word seq.active || List.mem word seq.done_) config.todo_sequences