Compare document path.
This commit is contained in:
parent
3fb2b5d31c
commit
f1e35e317b
@ -438,9 +438,31 @@ pub fn compare_document<'s>(
|
|||||||
Ok(_) => {}
|
Ok(_) => {}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Compare :path
|
// Compare :path
|
||||||
// :path is a quoted string to the absolute path of the document.
|
// :path is a quoted string to the absolute path of the document.
|
||||||
let document_path = get_property_quoted_string(emacs, ":path")?;
|
let document_path = get_property_quoted_string(emacs, ":path")?;
|
||||||
|
let rust_document_path = rust.path.as_ref().map(|p| p.to_str()).flatten();
|
||||||
|
match (
|
||||||
|
document_path.as_ref().map(|s| s.as_str()),
|
||||||
|
rust_document_path,
|
||||||
|
) {
|
||||||
|
(None, None) => {}
|
||||||
|
(None, Some(_)) | (Some(_), None) => {
|
||||||
|
this_status = DiffStatus::Bad;
|
||||||
|
message = Some(format!(
|
||||||
|
"Path mismatch (emacs != rust) {:?} != {:?}",
|
||||||
|
document_path, rust_document_path
|
||||||
|
));
|
||||||
|
}
|
||||||
|
(Some(e), Some(r)) if e != r => {
|
||||||
|
this_status = DiffStatus::Bad;
|
||||||
|
message = Some(format!(
|
||||||
|
"Path mismatch (emacs != rust) {:?} != {:?}",
|
||||||
|
document_path, rust_document_path
|
||||||
|
));
|
||||||
|
}
|
||||||
|
(Some(_), Some(_)) => {}
|
||||||
|
};
|
||||||
|
|
||||||
// Compare category
|
// Compare category
|
||||||
// :CATEGORY is specified either from "#+CATEGORY:" or it is the file name without the ".org" extension.
|
// :CATEGORY is specified either from "#+CATEGORY:" or it is the file name without the ".org" extension.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user