Back to index

texmacs  1.0.7.15
Functions | Variables
boot.hpp File Reference
#include "url.hpp"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

string get_setting (string var, string def="")
void set_setting (string var, string val)
void get_old_settings (string s)
void init_upgrade ()
void init_texmacs ()
void init_plugins ()
void setup_texmacs ()
scheme_tree plugin_list ()

Variables

tree texmacs_settings
int install_status
bool use_which
bool use_locate

Function Documentation

void get_old_settings ( string  s)

Definition at line 34 of file init_upgrade.cpp.

                            {
  int i= 0, j;
  while (i<N(s)) {
    string l= line_read (s, i);
    for (j=0; j<N(l); j++)
      if (l[j] == '=') {
       string left = l (0, j);
       while ((j<N(l)) && ((l[j]=='=') || (l[j]==' '))) j++;
       string right= l (j, N(l));
       set_setting (left, right);
      }
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

string get_setting ( string  var,
string  def = "" 
)

Definition at line 314 of file init_texmacs.cpp.

                                     {
  int i, n= N (texmacs_settings);
  for (i=0; i<n; i++)
    if (is_tuple (texmacs_settings[i], var, 1)) {
      return scm_unquote (as_string (texmacs_settings[i][1]));
    }
  return def;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void init_plugins ( )

Definition at line 387 of file init_texmacs.cpp.

                {
  install_status= 0;
  url old_settings= "$TEXMACS_HOME_PATH/system/TEX_PATHS";
  url new_settings= "$TEXMACS_HOME_PATH/system/settings.scm";
  string s;
  if (load_string (new_settings, s, false)) {
    if (load_string (old_settings, s, false)) {
      setup_texmacs ();
      install_status= 1;
    }
    else get_old_settings (s);
  }
  else texmacs_settings= block_to_scheme_tree (s);
  if (get_setting ("VERSION") != TEXMACS_VERSION) {
    init_upgrade ();
    url ch ("$TEXMACS_HOME_PATH/doc/about/changes/changes-recent.en.tm");
    install_status= exists (ch)? 2: 0;
  }
  init_tex ();
}

Here is the call graph for this function:

Here is the caller graph for this function:

void init_texmacs ( )

Definition at line 371 of file init_texmacs.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void init_upgrade ( )

Definition at line 133 of file init_upgrade.cpp.

                {
  string install_version= get_setting ("VERSION");

  cerr << HRULE;
  cerr << "Your disk contains a configuration file for TeXmacs-";
  cerr << install_version << ".\n";
  cerr << "I will now perform the upgrade to version " TEXMACS_VERSION "\n";
  cerr << HRULE;

  url old_settings= "$TEXMACS_HOME_PATH/system" * url_wildcard ("TEX_PATHS*");
  url new_settings= "$TEXMACS_HOME_PATH/system/settings.scm";
  remove (old_settings);
  remove (new_settings);

  setup_texmacs ();
  init_upgrade_scheme ();
  init_upgrade_doc (install_version);

  remove (url ("$TEXMACS_HOME_PATH/system/setup.scm"));
  remove (url ("$TEXMACS_HOME_PATH/system/cache") * url_wildcard ("__*"));
  remove (url ("$TEXMACS_HOME_PATH/system/cache/dir_cache.scm"));
  remove (url ("$TEXMACS_HOME_PATH/system/cache/doc_cache"));
  remove (url ("$TEXMACS_HOME_PATH/system/cache/file_cache"));
  remove (url ("$TEXMACS_HOME_PATH/system/cache/stat_cache.scm"));
  cache_refresh ();
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 63 of file init_texmacs.cpp.

               {
  bool flag;
  array<string> a= read_directory ("$TEXMACS_PATH/plugins", flag);
  a << read_directory ("/etc/TeXmacs/plugins", flag);
  a << read_directory ("$TEXMACS_HOME_PATH/plugins", flag);
  a << read_directory ("/usr/share/TeXmacs/plugins", flag);
  merge_sort (a);
  int i, n= N(a);
  tree t (TUPLE);
  for (i=0; i<n; i++)
    if ((a[i] != ".") && (a[i] != "..") && ((i==0) || (a[i] != a[i-1])))
      t << a[i];
  return t;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void set_setting ( string  var,
string  val 
)

Definition at line 324 of file init_texmacs.cpp.

                                     {
  int i, n= N (texmacs_settings);
  for (i=0; i<n; i++)
    if (is_tuple (texmacs_settings[i], var, 1)) {
      texmacs_settings[i][1]= scm_quote (val);
      return;
    }
  texmacs_settings << tuple (var, scm_quote (val));
}

Here is the call graph for this function:

Here is the caller graph for this function:

void setup_texmacs ( )

Definition at line 339 of file init_texmacs.cpp.

                 {
  url settings_file= "$TEXMACS_HOME_PATH/system/settings.scm";
  cerr << "Welcome to TeXmacs " TEXMACS_VERSION "\n";
  cerr << HRULE;

  set_setting ("VERSION", TEXMACS_VERSION);
  setup_tex ();
  
  string s= scheme_tree_to_block (texmacs_settings);
  //cout << "settings_t= " << texmacs_settings << "\n";
  //cout << "settings_s= " << s << "\n";
  if (save_string (settings_file, s) || load_string (settings_file, s, false)) {
    cerr << HRULE;
    cerr << "I could not save or reload the file\n\n";
    cerr << "\t" << settings_file << "\n\n";
    cerr << "Please give me full access control over this file and\n";
    cerr << "rerun 'TeXmacs'.\n";
    cerr << HRULE;
    FAILED ("unable to write settings");
  }
  
  cerr << HRULE;
  cerr << "Installation completed successfully !\n";
  cerr << "I will now start up the editor\n";
  cerr << HRULE;
}

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

Definition at line 22 of file init_texmacs.cpp.

Definition at line 21 of file init_texmacs.cpp.

bool use_locate

Definition at line 24 of file init_texmacs.cpp.

bool use_which

Definition at line 23 of file init_texmacs.cpp.