Back to index

texmacs  1.0.7.15
Functions
edit_select.cpp File Reference
#include "Replace/edit_select.hpp"
#include "Interface/edit_interface.hpp"
#include "convert.hpp"
#include "packrat.hpp"
#include "tree_select.hpp"
#include "drd_mode.hpp"

Go to the source code of this file.

Functions

string selection_encode (string lan, string s)
string selection_decode (string lan, string s)
static int breaking_force (char c)
bool incomplete_script_selection (tree t, path lp, path rp)
static bool stop_enlarge_environmental (tree t)
static path table_search_format (tree t, path p)
static void table_search_coordinates (tree t, path p, int &row, int &col)
static path table_search_cell (tree t, int row, int col)

Function Documentation

static int breaking_force ( char  c) [static]

Definition at line 217 of file edit_select.cpp.

                        {
  if (c == ' ') return 3;
  if (is_punctuation (c)) return 2;
  if (is_iso_alpha (c) || is_digit (c)) return 0;
  return 1;
}

Here is the call graph for this function:

Here is the caller graph for this function:

bool incomplete_script_selection ( tree  t,
path  lp,
path  rp 
)

Definition at line 269 of file edit_select.cpp.

                                                       {
  if (!is_func (t, CONCAT)) return false;
  if (N(lp) < 2 || N(rp) < 2) return false;
  int l= lp->item, r= rp->item;
  if (is_func (t[l], RSUB) || is_func (t[l], RSUP)) return true;
  if (is_func (t[r], LSUB) || is_func (t[r], LSUP)) return true;
  if (l  >0    && (is_func (t[l-1], LSUB) || is_func (t[l-1], LSUP))) return true;
  if (r+1<N(t) && (is_func (t[r+1], RSUB) || is_func (t[r+1], RSUP))) return true;
  return false;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 40 of file edit_select.cpp.

                                        {
  if ((lan == "czech") || (lan == "hungarian") ||
      (lan == "polish") || (lan == "slovene"))
    return il2_to_cork (s);
  else if ((lan == "bulgarian") || (lan == "russian"))
    return iso_to_koi8 (s);
  else if (lan == "ukrainian")
    return iso_to_koi8uk (s);
  else if (lan == "spanish")
    return ispanish_to_spanish (s);
  else if (lan == "german")
    return igerman_to_german (s);
  else return s;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 24 of file edit_select.cpp.

                                        {
  if ((lan == "czech") || (lan == "hungarian") ||
      (lan == "polish") || (lan == "slovene"))
    return cork_to_il2 (s);
  else if ((lan == "bulgarian") || (lan == "russian"))
    return koi8_to_iso (s);
  else if (lan == "ukrainian")
    return koi8uk_to_iso (s);
  else if (lan == "spanish")
    return spanish_to_ispanish (s);
  else if (lan == "german")
    return german_to_igerman (s);
  else return s;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static bool stop_enlarge_environmental ( tree  t) [static]

Definition at line 327 of file edit_select.cpp.

                                    {
  if (is_func (t, WITH, 3) && (t[0] == MODE) && (t[1] == "math")) return true;
  if (!is_extension (t)) return false;
  if (is_multi_paragraph (t)) return true;
  string s= as_string (L(t));
  return
    (s == "part") ||
    (s == "chapter") ||
    (s == "section") ||
    (s == "subsection") ||
    (s == "subsubsection") ||
    (s == "paragraph") ||
    (s == "subparagraph");
}

Here is the call graph for this function:

Here is the caller graph for this function:

static path table_search_cell ( tree  t,
int  row,
int  col 
) [static]

Definition at line 425 of file edit_select.cpp.

                                             {
  path p;
  while (is_func (t, TFORMAT)) {
    p= p * (N(t)-1);
    t= t [N(t)-1];
  }
  p= p * row;
  t= t [row];
  while (is_func (t, TFORMAT)) {
    p= p * (N(t)-1);
    t= t [N(t)-1];
  }
  p= p * col;
  t= t [col];
  while (is_func (t, TFORMAT)) {
    p= p * (N(t)-1);
    t= t [N(t)-1];
  }
  return p;
}

Here is the call graph for this function:

static void table_search_coordinates ( tree  t,
path  p,
int &  row,
int &  col 
) [static]

Definition at line 409 of file edit_select.cpp.

                                                              {
  row= col= 0;
  while (true) {
    if (is_nil (p)) p= path (1);
    if (p == path (0)) p= path (0, 0);
    if (p == path (1)) p= path (N(t)-1, 1);
    if (is_func (t, TFORMAT));
    else if (is_func (t, TABLE)) row= p->item;
    else if (is_func (t, ROW)) col= p->item;
    else return;
    t= t [p->item];
    p= p->next;
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

static path table_search_format ( tree  t,
path  p 
) [static]

Definition at line 399 of file edit_select.cpp.

                                     {
  tree st= subtree (t, p);
  if (is_func (st, TFORMAT) && is_func (st[N(st)-1], TABLE)) return p;
  while ((!is_nil (p)) && (!is_func (subtree (t, p), TABLE))) p= path_up (p);
  if ((!is_nil (p)) && (is_func (subtree (t, path_up (p)), TFORMAT)))
    p= path_up (p);
  return p;
}

Here is the call graph for this function:

Here is the caller graph for this function: