261
261
url in ("$PWD", argv[i-1]);
262
262
url out ("$PWD", argv[ i ]);
263
263
my_init_cmds= my_init_cmds * " " *
264
"(texmacs-load-buffer " * scm_quote (as_string (in)) *
265
" \"generic\" 0 #f) " *
264
"(load-buffer " * scm_quote (as_string (in)) * " :strict) " *
266
265
"(export-buffer " * scm_quote (as_string (out)) * ")";
327
326
// (see as_double() in string.cpp)
328
327
setlocale(LC_NUMERIC, "C");
330
330
for (i=1; i<argc; i++) {
331
331
if (argv[i] == NULL) break;
332
332
string s= argv[i];
333
333
if ((N(s)>=2) && (s(0,2)=="--")) s= s (1, N(s));
334
334
if ((s[0] != '-') && (s[0] != '+')) {
335
335
if (DEBUG_STD) cout << "TeXmacs] Loading " << s << "...\n";
336
load_buffer (url_system (s), "generic", 1);
336
url u= url_system (s);
337
if (!is_rooted (u)) u= resolve (url_pwd (), "") * u;
338
string b= scm_quote (as_string (u));
339
string cmd= "(load-buffer " * b * " " * where * ")";
340
where= " :new-window";
341
exec_delayed (scheme_cmd (cmd));
338
if ((s == "-b") || (s == "-initialize-buffer") ||
339
(s == "-c") || (s == "-convert") ||
340
(s == "-fn") || (s == "-font") ||
341
(s == "-i") || (s == "-initialize") ||
342
(s == "-g") || (s == "-geometry") ||
343
(s == "-x") || (s == "-execute") ||
344
(s == "-log-file")) i++;
343
if ((s == "-c") || (s == "-convert")) i+=2;
344
else if ((s == "-b") || (s == "-initialize-buffer") ||
345
(s == "-fn") || (s == "-font") ||
346
(s == "-i") || (s == "-initialize") ||
347
(s == "-g") || (s == "-geometry") ||
348
(s == "-x") || (s == "-execute") ||
349
(s == "-log-file")) i++;
346
351
if (install_status == 1) {
347
352
if (DEBUG_STD) cout << "TeXmacs] Loading welcome message...\n";
348
load_buffer ("$TEXMACS_PATH/doc/about/welcome/first.en.tm", "help", 1);
353
url u= "tmfs://help/plain/tm/doc/about/welcome/first.en.tm";
354
string b= scm_quote (as_string (u));
355
string cmd= "(load-buffer " * b * " " * where * ")";
356
where= " :new-window";
357
exec_delayed (scheme_cmd (cmd));
350
359
else if (install_status == 2) {
351
360
if (DEBUG_STD) cout << "TeXmacs] Loading upgrade message...\n";
353
"$TEXMACS_HOME_PATH/doc/about/changes/changes-recent.en.tm", "help", 1);
361
url u= "tmfs://help/plain/tm/doc/about/changes/changes-recent.en.tm";
362
string b= scm_quote (as_string (u));
363
string cmd= "(load-buffer " * b * " " * where * ")";
364
where= " :new-window";
365
exec_delayed (scheme_cmd (cmd));
367
if (number_buffers () == 0) {
356
368
if (DEBUG_STD) cout << "TeXmacs] Creating 'no name' buffer...\n";