diff --git a/org_mode_samples/greater_element/plain_list/affiliated_keyword.org b/org_mode_samples/greater_element/plain_list/affiliated_keyword.org index 9b324d9a..ce8417bc 100644 --- a/org_mode_samples/greater_element/plain_list/affiliated_keyword.org +++ b/org_mode_samples/greater_element/plain_list/affiliated_keyword.org @@ -1,5 +1,5 @@ #+NAME: a -#+caption: b +#+caption: b *lorem* ipsum #+results: c #+headers: d #+header: e @@ -12,4 +12,18 @@ #+tblname: l #+attr_latex: m #+attr_html: n +#+NAME: aa +#+caption: bb *lorem* ipsum +#+results: cc +#+headers: dd +#+header: ee +#+label: ff +#+plot: gg +#+resname: hh +#+result: ii +#+source: jj +#+srcname: kk +#+tblname: ll +#+attr_latex: mm +#+attr_html: nn 1. bar diff --git a/src/compare/util.rs b/src/compare/util.rs index 4a4e684a..0706a5be 100644 --- a/src/compare/util.rs +++ b/src/compare/util.rs @@ -9,6 +9,7 @@ use crate::compare::diff::compare_ast_node; use crate::compare::sexp::unquote; use crate::types::AstNode; use crate::types::GetStandardProperties; +use crate::types::Keyword; use crate::types::StandardProperties; /// Check if the child string slice is a slice of the parent string slice. @@ -337,3 +338,29 @@ where } Ok(ComparePropertiesResult::NoChange) } + +// pub(crate) fn compare_affiliated_keywords<'b, 's, RK, RV, RI>( +// emacs: &'b Token<'s>, +// rust_children: RI, +// ) -> Result, Box> +// where +// RI: Iterator> + ExactSizeIterator, +// { +// for kw in rust_children { + +// } +// for (rust_key, rust_value) in rust_children { +// let rust_key = rust_key.as_ref(); +// let rust_value = rust_value.as_ref(); +// let emacs_value = get_property_quoted_string(emacs, rust_key)?; +// if Some(rust_value) != emacs_value.as_ref().map(String::as_str) { +// let this_status = DiffStatus::Bad; +// let message = Some(format!( +// "{} mismatch (emacs != rust) {:?} != {:?}", +// rust_key, emacs_value, rust_value +// )); +// return Ok(ComparePropertiesResult::SelfChange(this_status, message)); +// } +// } +// Ok(ComparePropertiesResult::NoChange) +// } diff --git a/src/context/global_settings.rs b/src/context/global_settings.rs index e8ba3d89..9b62c69b 100644 --- a/src/context/global_settings.rs +++ b/src/context/global_settings.rs @@ -71,6 +71,7 @@ pub struct EntityDefinition<'a> { impl<'g, 's> GlobalSettings<'g, 's> { fn new() -> GlobalSettings<'g, 's> { + debug_assert!(DEFAULT_ORG_ENTITIES.is_sorted_by(|a, b| b.name.len().partial_cmp(&a.name.len()))); GlobalSettings { radio_targets: Vec::new(), file_access: &LocalFileAccessInterface { diff --git a/src/lib.rs b/src/lib.rs index da35ff75..bb3a52cb 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,6 +1,7 @@ #![feature(exit_status_error)] #![feature(trait_alias)] #![feature(path_file_prefix)] +#![feature(is_sorted)] // TODO: #![warn(missing_docs)] #[cfg(feature = "compare")] diff --git a/src/types/greater_element.rs b/src/types/greater_element.rs index d2aeab4d..c66bfc1a 100644 --- a/src/types/greater_element.rs +++ b/src/types/greater_element.rs @@ -219,3 +219,13 @@ impl<'s> TableRow<'s> { } } } + +pub trait GetAffiliatedKeywords<'s> { + fn get_affiliated_keywords(&self) -> () { + // foo + } +} + +// impl<'s> GetAffiliatedKeywords for PlainList<'s> { + +// }