mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-28 16:00:22 +02:00
* read.c, read.h (history-length, history-file): New read options.
(scm_read_options): Stifle history to history length.
This commit is contained in:
parent
64921cdd76
commit
ad382b2dcc
2 changed files with 20 additions and 0 deletions
|
@ -67,8 +67,19 @@ scm_option scm_read_opts[] = {
|
||||||
"Convert symbols to lower case."},
|
"Convert symbols to lower case."},
|
||||||
{ SCM_OPTION_SCM, "keywords", SCM_BOOL_F,
|
{ SCM_OPTION_SCM, "keywords", SCM_BOOL_F,
|
||||||
"Style of keyword recognition: #f or 'prefix"}
|
"Style of keyword recognition: #f or 'prefix"}
|
||||||
|
#ifdef HAVE_RL_GETC_FUNCTION
|
||||||
|
,
|
||||||
|
{ SCM_OPTION_BOOLEAN, "history-file", 1,
|
||||||
|
"Use history file." },
|
||||||
|
{ SCM_OPTION_INTEGER, "history-length", 200,
|
||||||
|
"History length." }
|
||||||
|
#endif /* HAVE_RL_GETC_FUNCTION */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#ifdef HAVE_RL_GETC_FUNCTION
|
||||||
|
extern void stifle_history (int max);
|
||||||
|
#endif
|
||||||
|
|
||||||
SCM_PROC (s_read_options, "read-options-interface", 0, 1, 0, scm_read_options);
|
SCM_PROC (s_read_options, "read-options-interface", 0, 1, 0, scm_read_options);
|
||||||
|
|
||||||
SCM
|
SCM
|
||||||
|
@ -81,6 +92,9 @@ scm_read_options (setting)
|
||||||
s_read_options);
|
s_read_options);
|
||||||
if (SCM_COPY_SOURCE_P)
|
if (SCM_COPY_SOURCE_P)
|
||||||
SCM_RECORD_POSITIONS_P = 1;
|
SCM_RECORD_POSITIONS_P = 1;
|
||||||
|
#ifdef HAVE_RL_GETC_FUNCTION
|
||||||
|
stifle_history (SCM_HISTORY_LENGTH);
|
||||||
|
#endif
|
||||||
return ans;
|
return ans;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -73,7 +73,13 @@ extern scm_option scm_read_opts[];
|
||||||
#define SCM_RECORD_POSITIONS_P scm_read_opts[1].val
|
#define SCM_RECORD_POSITIONS_P scm_read_opts[1].val
|
||||||
#define SCM_CASE_INSENSITIVE_P scm_read_opts[2].val
|
#define SCM_CASE_INSENSITIVE_P scm_read_opts[2].val
|
||||||
#define SCM_KEYWORD_STYLE scm_read_opts[3].val
|
#define SCM_KEYWORD_STYLE scm_read_opts[3].val
|
||||||
|
#ifndef HAVE_RL_GETC_FUNCTION
|
||||||
#define SCM_N_READ_OPTIONS 4
|
#define SCM_N_READ_OPTIONS 4
|
||||||
|
#else
|
||||||
|
#define SCM_HISTORY_FILE_P scm_read_opts[4].val
|
||||||
|
#define SCM_HISTORY_LENGTH scm_read_opts[5].val
|
||||||
|
#define SCM_N_READ_OPTIONS 6
|
||||||
|
#endif /* HAVE_RL_GETC_FUNCTION */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue