The R Project SVN R

Rev

Rev 37626 | Rev 38283 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 37626 Rev 37656
Line 473... Line 473...
473
	errorcall(call, _("invalid '%s' argument"), "file");
473
	errorcall(call, _("invalid '%s' argument"), "file");
474
    if (CharacterMode == RGui || (R_Interactive && CharacterMode == RTerm)) {
474
    if (CharacterMode == RGui || (R_Interactive && CharacterMode == RTerm)) {
475
	R_setupHistory(); /* re-read the history size */
475
	R_setupHistory(); /* re-read the history size */
476
	gl_savehistory(CHAR(STRING_ELT(sfile, 0)), R_HistorySize);
476
	gl_savehistory(CHAR(STRING_ELT(sfile, 0)), R_HistorySize);
477
    } else
477
    } else
478
	errorcall(call, _("savehistory can only be used in Rgui and Rterm"));
478
	errorcall(call, _("'savehistory' can only be used in Rgui and Rterm"));
479
    return R_NilValue;
479
    return R_NilValue;
480
}
480
}
481
 
481
 
482
SEXP do_loadhistory(SEXP call, SEXP op, SEXP args, SEXP env)
482
SEXP do_loadhistory(SEXP call, SEXP op, SEXP args, SEXP env)
483
{
483
{
Line 488... Line 488...
488
    if (!isString(sfile) || LENGTH(sfile) < 1)
488
    if (!isString(sfile) || LENGTH(sfile) < 1)
489
	errorcall(call, _("invalid '%s' argument"), "file");
489
	errorcall(call, _("invalid '%s' argument"), "file");
490
    if (CharacterMode == RGui || (R_Interactive && CharacterMode == RTerm))
490
    if (CharacterMode == RGui || (R_Interactive && CharacterMode == RTerm))
491
	gl_loadhistory(CHAR(STRING_ELT(sfile, 0)));
491
	gl_loadhistory(CHAR(STRING_ELT(sfile, 0)));
492
    else
492
    else
493
	errorcall(call, _("loadhistory can only be used in Rgui and Rterm"));
493
	errorcall(call, _("'loadhistory' can only be used in Rgui and Rterm"));
494
    return R_NilValue;
494
    return R_NilValue;
495
}
495
}
496
 
496
 
497
SEXP do_addhistory(SEXP call, SEXP op, SEXP args, SEXP env)
497
SEXP do_addhistory(SEXP call, SEXP op, SEXP args, SEXP env)
498
{
498
{
Line 522... Line 522...
522
	errorcall(call, _("invalid '%s' argument"), "file");
522
	errorcall(call, _("invalid '%s' argument"), "file");
523
    if (CharacterMode == RGui) {
523
    if (CharacterMode == RGui) {
524
    	getActive(&gui);
524
    	getActive(&gui);
525
	if (loadRconsole(&gui, (CHAR(STRING_ELT(sfile, 0))))) applyGUI(&gui);
525
	if (loadRconsole(&gui, (CHAR(STRING_ELT(sfile, 0))))) applyGUI(&gui);
526
    } else
526
    } else
527
	errorcall(call, _("loadRconsole can only be used in Rgui"));
527
	errorcall(call, _("'loadRconsole' can only be used in Rgui"));
528
    return R_NilValue;
528
    return R_NilValue;
529
}
529
}
530
    
530
    
531
#include <lmcons.h>
531
#include <lmcons.h>
532
 
532