rcfile: add bindable function 'execute', for access to "Execute Command"

(This should have been added three weeks ago when ^T was rebound.)
master
Benno Schulenberg 2020-06-15 14:27:49 +02:00
parent fd28e5f36c
commit 7ff82aa5e2
3 changed files with 10 additions and 0 deletions

View File

@ -1284,6 +1284,10 @@ Shows the current cursor position: the line, column, and character positions.
@item wordcount @item wordcount
Counts the number of words, lines and characters in the current buffer. Counts the number of words, lines and characters in the current buffer.
@item execute
Prompts for a program to execute. The program's output will be inserted
into the current buffer (or into a new buffer when @kbd{M-F} is toggled).
@item speller @item speller
Invokes a spell-checking program, either the default @command{hunspell} Invokes a spell-checking program, either the default @command{hunspell}
or GNU @command{spell}, or the one defined by @option{--speller} or or GNU @command{spell}, or the one defined by @option{--speller} or

View File

@ -599,6 +599,10 @@ Shows the current cursor position: the line, column, and character positions.
.B wordcount .B wordcount
Counts the number of words, lines and characters in the current buffer. Counts the number of words, lines and characters in the current buffer.
.TP .TP
.B execute
Prompts for a program to execute. The program's output will be inserted
into the current buffer (or into a new buffer when \fBM-F\fR is toggled).
.TP
.B speller .B speller
Invokes a spell-checking program, either the default \fBhunspell\fR or GNU Invokes a spell-checking program, either the default \fBhunspell\fR or GNU
\fBspell\fR, or the one defined by \fB\-\-speller\fR or \fBset speller\fR. \fBspell\fR, or the one defined by \fB\-\-speller\fR or \fBset speller\fR.

View File

@ -256,6 +256,8 @@ keystruct *strtosc(const char *input)
else if (!strcmp(input, "paste")) else if (!strcmp(input, "paste"))
s->func = paste_text; s->func = paste_text;
#ifndef NANO_TINY #ifndef NANO_TINY
else if (!strcmp(input, "execute"))
s->func = do_execute;
else if (!strcmp(input, "cutrestoffile")) else if (!strcmp(input, "cutrestoffile"))
s->func = cut_till_eof; s->func = cut_till_eof;
else if (!strcmp(input, "copy")) else if (!strcmp(input, "copy"))