Add org-link-parameters to the GlobalSettings.

This commit is contained in:
Tom Alexander 2023-10-06 19:14:11 -04:00
parent 7cf1f7b7bb
commit f220fd63e5
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE
1 changed files with 32 additions and 0 deletions

View File

@ -37,6 +37,11 @@ pub struct GlobalSettings<'g, 's> {
///
/// Corresponds to org-coderef-label-format elisp variable.
pub coderef_label_format: &'g str,
/// The allowed protocols for links (for example, the "https" in "https://foo.bar/").
///
/// COrresponds to org-link-parameters elisp variable.
pub org_link_parameters: &'g [&'g str],
}
pub const DEFAULT_TAB_WIDTH: IndentationLevel = 8;
@ -55,6 +60,7 @@ impl<'g, 's> GlobalSettings<'g, 's> {
odd_levels_only: HeadlineLevelFilter::default(),
footnote_section: "Footnotes",
coderef_label_format: "(ref:%s)",
org_link_parameters: &ORG_LINK_PARAMETERS,
}
}
}
@ -76,3 +82,29 @@ impl Default for HeadlineLevelFilter {
HeadlineLevelFilter::OddEven
}
}
const ORG_LINK_PARAMETERS: [&'static str; 23] = [
"id",
"eww",
"rmail",
"mhe",
"irc",
"info",
"gnus",
"docview",
"bibtex",
"bbdb",
"w3m",
"doi",
"file+sys",
"file+emacs",
"shell",
"news",
"mailto",
"https",
"http",
"ftp",
"help",
"file",
"elisp",
];