--- readline.c 2007-01-22 14:10:27.000000000 -0200 +++ ../../Python-2.5.1-modif/Modules/readline.c 2008-01-06 12:55:04.000000000 -0200 @@ -291,6 +291,29 @@ "set_completer_delims(string) -> None\n\ set the readline word delimiters for tab-completion"); +/* Set the list of characters which can be used to quote a substring of the line */ + +static PyObject * +set_completer_quote_delims(PyObject *self, PyObject *args) +{ + char *break_chars; + + if(!PyArg_ParseTuple(args, "s:set_completer_quote_delims", &break_chars)) { + return NULL; + } + if (rl_completer_quote_characters != NULL) { + free((void*)rl_completer_quote_characters); + } + rl_completer_quote_characters = strdup(break_chars); + Py_INCREF(Py_None); + return Py_None; +} + +PyDoc_STRVAR(doc_set_completer_quote_delims, +"set_completer_delims(string) -> None\n\ +set the readline quote chars or tab-completion"); + + static PyObject * py_remove_history(PyObject *self, PyObject *args) { @@ -395,6 +418,19 @@ "get_completer_delims() -> string\n\ get the readline word delimiters for tab-completion"); +static PyObject * +get_completer_quote_delims(PyObject *self, PyObject *noarg) +{ + if (rl_completer_quote_characters == NULL) { + return PyString_FromString(""); + } else { + return PyString_FromString(rl_completer_quote_characters); + } +} + +PyDoc_STRVAR(doc_get_completer_quote_delims, +"get_completer_delims() -> string\n\ +get the readline quote chars for tab-completion"); /* Set the completer function */ @@ -560,12 +596,15 @@ {"set_completer_delims", set_completer_delims, METH_VARARGS, doc_set_completer_delims}, + {"set_completer_quote_delims", set_completer_quote_delims, + METH_VARARGS, doc_set_completer_quote_delims}, {"add_history", py_add_history, METH_VARARGS, doc_add_history}, {"remove_history_item", py_remove_history, METH_VARARGS, doc_remove_history}, {"replace_history_item", py_replace_history, METH_VARARGS, doc_replace_history}, {"get_completer_delims", get_completer_delims, METH_NOARGS, doc_get_completer_delims}, - + {"get_completer_quote_delims", get_completer_quote_delims, + METH_NOARGS, doc_get_completer_quote_delims}, {"set_startup_hook", set_startup_hook, METH_VARARGS, doc_set_startup_hook}, #ifdef HAVE_RL_PRE_INPUT_HOOK