[Winbash-checkins] CVS: winbash bashline.c,1.4,1.5
Brought to you by:
enricobrunetta,
xks
From: kevin s. <xk...@us...> - 2002-03-25 10:51:03
|
Update of /cvsroot/winbash/winbash In directory usw-pr-cvs1:/tmp/cvs-serv7748 Modified Files: bashline.c Log Message: changes for readline 4.2. some things still need resolution: * filename quoting * rl_vi_comment_begin (this doesn't exist in readline 4.2 - don't know if we even need/use it. * rl_hostname_completion_desired Index: bashline.c =================================================================== RCS file: /cvsroot/winbash/winbash/bashline.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- bashline.c 11 Mar 2002 14:32:12 -0000 1.4 +++ bashline.c 25 Mar 2002 10:50:59 -0000 1.5 @@ -89,7 +89,8 @@ extern char *current_prompt_string, *ps1_prompt; extern STRING_INT_ALIST word_token_alist[]; extern Function *rl_last_func; -extern int rl_filename_completion_desired,rl_hostname_completion_desired; +extern int rl_filename_completion_desired; +int rl_hostname_completion_desired =0; /* SPECIFIC_COMPLETION_FUNCTIONS specifies that we have individual completion functions which indicate what type of completion should be @@ -117,7 +118,7 @@ #if defined (VI_MODE) static void vi_edit_and_execute_command (); -extern char *rl_vi_comment_begin; +/* extern */ char *rl_vi_comment_begin; #endif static Function *old_rl_startup_hook = (Function *) NULL; @@ -141,6 +142,33 @@ #endif } +rl_quote_func_t *orig_quote_filename; +static char * +bash_quote_filename (s, rtype, qcp) + char *s; + int rtype; + char *qcp; +{ + char *r; + + r = xmalloc (strlen (s) + 3); + *r = *rl_completer_quote_characters; + strcpy (r + 1, s); + strcat(r, "\""); + if (qcp) + *qcp = *rl_completer_quote_characters; + return r; +} + +/* static char * */ +/* bash_dequote_filename(text, quote_char) */ +/* char *text; */ +/* int quote_char; */ +/* { */ +/* printf("bash_dequote_filename\n"); */ +/* return text; */ +/* } */ + /* Called once from parse.y if we are going to use readline. */ void initialize_readline () @@ -248,7 +276,12 @@ rl_bind_key_in_map ('v', vi_edit_and_execute_command, vi_movement_keymap); #endif - rl_completer_quote_characters = "'\""; + rl_completer_quote_characters = "\"'"; +/* orig_quote_filename = rl_filename_quoting_function; */ +/* rl_filename_quoting_function = bash_quote_filename; */ +/* rl_filename_dequoting_function = bash_dequote_filename; */ +/* rl_filename_quote_characters = " "; */ + /* Need to modify this from the default; `$', `{', `\', and ``' are not word break characters. */ rl_completer_word_break_characters = " \t\n\"'@><=;|&("; /**/ @@ -1984,7 +2017,7 @@ rl_attempted_completion_function = (CPPFunction *)NULL; rl_directory_completion_hook = (Function *)NULL; rl_completer_word_break_characters = " \t\n\"\'"; - + rl_complete_internal (what_to_do); rl_completion_entry_function = orig_func; |