Compare headline level.

This commit is contained in:
Tom Alexander 2023-08-29 22:11:56 -04:00
parent 58aca53144
commit 7944659802
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE

View File

@ -399,6 +399,16 @@ fn compare_heading<'s>(
};
// Compare level
let level = get_property(emacs, ":level")?
.ok_or("Level should not be nil")?
.as_atom()?;
if rust.stars.to_string() != level {
this_status = DiffStatus::Bad;
message = Some(format!(
"Headline level do not much (emacs != rust): {} != {}",
level, rust.stars
))
}
// Compare tags
let emacs_tags = get_tags_from_heading(emacs)?;
@ -436,7 +446,7 @@ fn compare_heading<'s>(
child_status.push(compare_object(source, emacs_child, rust_child)?);
}
// TODO: Compare todo-type, level, priority
// TODO: Compare todo-type, priority, :footnote-section-p, :archivedp, :commentedp
// Compare section
for (emacs_child, rust_child) in children.iter().skip(2).zip(rust.children.iter()) {