Esempio n. 1
0
void
edit_select_rep::selection_set (string key, tree t, bool persistant) {
  selecting= shift_selecting= false;
  string mode= as_string (selection_get_env_value (MODE));
  string lan = as_string (selection_get_env_value (MODE_LANGUAGE (mode)));
  tree sel= tuple ("texmacs", t, mode, lan);
  /* TODO: add mode="graphics" somewhere in the context of the <graphics>
     tag. To be done when implementing the different embeddings for
     nicely copying graphics into text, text into graphics, etc. */
  string s;
  if (key == "primary" || key == "mouse") {
    if (selection_export == "verbatim") t= exec_verbatim (t, tp);
    if (selection_export == "html") t= exec_html (t, tp);
    if (selection_export == "latex") t= exec_latex (t, tp);
    if ((selection_export == "latex") && (mode == "math"))
      t= compound ("math", t);
    s= tree_to_generic (t, selection_export * "-snippet");
    s= selection_encode (lan, s);
  }
  if (::set_selection (key, sel, s, selection_export) && !persistant)
    selection_cancel ();
}
Esempio n. 2
0
tree
edit_typeset_rep::exec_latex (tree t) {
  return exec_latex (t, rp * 0);
}