Customized readline macro's can be created for "specific" programs
inside the ~/.inputrc file by use of $if <name>
If newlisp would have defined -> char * rl_readline_name <-
***
This variable is set to a unique name by each application using
Readline. The value allows conditional parsing of the inputrc file
(see Conditional Init Constructs.).
***
People can create readline macro's inside their ~/.inputrc specificly
for newlisp only! So they wont work outside the newlisp shell i.e.
inside bash..
$if newlisp
# Quote the current or previous word
"\C-nq": "\eb\(\ef\)"
$endif
like this in newlisp.c ->
(checked and works)
Code: Select all
#ifdef READLINE
if(isTTY)
{
rl_readline_name = "newlisp";
errnoSave = errno;
if((cmd = readline(prompt())) == NULL) exit(0);
errno = errnoSave; /* reset errno, set by readline() */
if(strlen(cmd) > 0) add_history(cmd);
executeCommandLine(cmd, OUT_CONSOLE, &cmdStream);
free(cmd);
continue;
}
if(IOchannel != stdin || forcePromptMode)
varPrintf(OUT_CONSOLE, prompt());
#endif