Re: run_readline_command to avoid the bother of binding something
OK then please add dump-functions Print all of the functions and their key bindings to the read- line output stream. If a numeric argument is supplied, the out- put is formatted in such a way that it can be made part of an inputrc file. "See also bind -P, -p" dump-variables Print all of the settable readline variables and their values to the readline output stream. If a numeric argument is supplied, the output is formatted in such a way that it can be made part of an inputrc file. "See also bind -V, -v" dump-macros Print all of the readline key sequences bound to macros and the strings they output. If a numeric argument is supplied, the output is formatted in such a way that it can be made part of an inputrc file. "See also bind -M, -m" Also at Readline Variables Readline has variables that can be used to further customize its behav- ior. A variable may be set in the inputrc file with a statement of the form set variable-name value Except where noted, readline variables can take the values On or Off (without regard to case). Unrecognized variable names are ignored. When a variable value is read, empty or null values, "on" (case-insen- do remind the user (please yet) again that he can check their current value with bind -v, -V. And, as http://unix.stackexchange.com/questions/27471/setting-readline-variables-in-the-shell mentions also remind him, 'You can make bash execute readline commands through the bind builtin: bind "set var value"' i.e., inputrc is not the only choice. Thanks.
Re: run_readline_command to avoid the bother of binding something
On 9/17/16 11:56 PM, Dan Jacobson wrote: > Furthermore, one could finally do > $ run_readline_command dump-variables | grep bell > prefer-visible-bell is set to `on' > bell-style is set to `audible' > > which is rather impossible, even if one does bind unbound commands. I suppose it's a waste of time to point out that most of the readline commands that don't actually move the cursor around or modify the current command line are available as options to the bash `bind' builtin. For instance, you could have run bind -V | grep bell -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, UTech, CWRUc...@case.eduhttp://cnswww.cns.cwru.edu/~chet/
Re: run_readline_command to avoid the bother of binding something
On 9/17/16 11:34 PM, Dan Jacobson wrote: > "There is no way to run any of the commands that are not bound to a > keyboard sequence without binding them to a keyboard sequence." > > http://unix.stackexchange.com/questions/52578/execute-a-readline-function-without-keybinding > > Yes that is right, just to run e.g., > >dump-variables > Print all of the settable readline variables and their values to > the readline output stream. If a numeric argument is supplied, > the output is formatted in such a way that it can be made part > of an inputrc file. > > once, one has to bind it to a key. > > Why can't there be some > > $ run_readline_command dump-variables I would be happy to look at a donated implementation. Chet -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, UTech, CWRUc...@case.eduhttp://cnswww.cns.cwru.edu/~chet/
Re: run_readline_command to avoid the bother of binding something
Furthermore, one could finally do $ run_readline_command dump-variables | grep bell prefer-visible-bell is set to `on' bell-style is set to `audible' which is rather impossible, even if one does bind unbound commands. Currently one must probably use script(1), bind the key, and then exit and grep the typescript. Or one must be in X-windows, bind the key, and the copy the output of pushing the bound key into a file, and the grep that. So my proposal would save a rather large amount of work this time. (No, don't really call it exactly run_readline_command.)