Make the same changes we did for stdin compare to comparing files.

This commit is contained in:
Tom Alexander
2023-09-29 15:42:07 -04:00
parent 7a854838ef
commit 9a479b33e0
3 changed files with 50 additions and 37 deletions

View File

@@ -49,7 +49,10 @@ where
Ok(String::from_utf8(org_sexp)?)
}
pub fn emacs_parse_file_org_document<P>(file_path: P) -> Result<String, Box<dyn std::error::Error>>
pub(crate) fn emacs_parse_file_org_document<P>(
file_path: P,
global_settings: &GlobalSettings,
) -> Result<String, Box<dyn std::error::Error>>
where
P: AsRef<Path>,
{
@@ -62,9 +65,11 @@ where
r#"(progn
(require 'org)
(defun org-table-align () t)
{global_settings}
(org-mode)
(message "%s" (pp-to-string (org-element-parse-buffer)))
)"#
)"#,
global_settings = global_settings_elisp(global_settings)
);
let mut cmd = Command::new("emacs");
let cmd = cmd