Allowing the toggle between Read File and Execute Command to be rebound.

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4941 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
This commit is contained in:
Benno Schulenberg 2014-06-04 19:15:16 +00:00
parent 95592ce5df
commit 04a38da312
6 changed files with 24 additions and 6 deletions

View File

@ -1,3 +1,10 @@
2014-06-04 Benno Schulenberg <bensberg@justemail.net>
* src/global.c (shortcut_init), src/files.c (do_insertfile): Rename
'ext_cmd_void' to 'flip_execute_void' to better match what it does.
* src/global.c (strtosc), doc/man/nanorc.5, doc/texinfo/nano.texi:
Add function name 'flipexecute' to enable rebinding ^X in the menus
Read File and Execute Command.
2014-06-04 David Lawrence Ramsey <pooka109@gmail.com> 2014-06-04 David Lawrence Ramsey <pooka109@gmail.com>
* src/*.c: Adjustments of whitespace and comments. * src/*.c: Adjustments of whitespace and comments.
* doc/nanorc.sample.in: Interpunction tweaks. * doc/nanorc.sample.in: Interpunction tweaks.

View File

@ -520,6 +520,9 @@ Shows the next history entry in the prompt menus (e.g. search).
.B dontreplace .B dontreplace
Switches back to searching instead of replacing. Switches back to searching instead of replacing.
.TP .TP
.B flipexecute
Toggles between inserting a file and executing a command.
.TP
.B gototext .B gototext
Searches for files matching a string in the file browser (reading or writing files). Searches for files matching a string in the file browser (reading or writing files).
.TP .TP

View File

@ -1048,6 +1048,9 @@ Shows the next history entry in the prompt menus (e.g. search).
@item dontreplace @item dontreplace
Switches back to searching instead of replacing. Switches back to searching instead of replacing.
@item flipexecute
Toggles between inserting a file and executing a command.
@item gototext @item gototext
Searches for files matching a string in the file browser (reading or writing files). Searches for files matching a string in the file browser (reading or writing files).

View File

@ -1084,7 +1084,7 @@ void do_insertfile(
continue; continue;
} else } else
#endif #endif
if (s && s->scfunc == ext_cmd_void) { if (s && s->scfunc == flip_execute_void) {
execute = !execute; execute = !execute;
continue; continue;
} }

View File

@ -274,7 +274,7 @@ void new_buffer_void(void)
void no_replace_void(void) void no_replace_void(void)
{ {
} }
void ext_cmd_void(void) void flip_execute_void(void)
{ {
} }
@ -936,10 +936,10 @@ void shortcut_init(void)
/* If we're using restricted mode, file insertion is disabled, and /* If we're using restricted mode, file insertion is disabled, and
* thus command execution and the multibuffer toggle have no place. */ * thus command execution and the multibuffer toggle have no place. */
if (!ISSET(RESTRICTED)) { if (!ISSET(RESTRICTED)) {
add_to_funcs(ext_cmd_void, MINSERTFILE, add_to_funcs(flip_execute_void, MINSERTFILE,
N_("Execute Command"), IFSCHELP(nano_execute_msg), FALSE, NOVIEW); N_("Execute Command"), IFSCHELP(nano_execute_msg), FALSE, NOVIEW);
add_to_funcs(ext_cmd_void, MEXTCMD, add_to_funcs(flip_execute_void, MEXTCMD,
read_file_tag, IFSCHELP(nano_insert_msg), FALSE, NOVIEW); read_file_tag, IFSCHELP(nano_insert_msg), FALSE, NOVIEW);
#ifndef DISABLE_MULTIBUFFER #ifndef DISABLE_MULTIBUFFER
@ -1158,7 +1158,7 @@ void shortcut_init(void)
#ifndef DISABLE_BROWSER #ifndef DISABLE_BROWSER
add_to_sclist(MWRITEFILE|MINSERTFILE, "^T", to_files_void, 0, FALSE); add_to_sclist(MWRITEFILE|MINSERTFILE, "^T", to_files_void, 0, FALSE);
#endif #endif
add_to_sclist(MINSERTFILE|MEXTCMD, "^X", ext_cmd_void, 0, FALSE); add_to_sclist(MINSERTFILE|MEXTCMD, "^X", flip_execute_void, 0, FALSE);
add_to_sclist(MINSERTFILE|MEXTCMD, "M-F", new_buffer_void, 0, FALSE); add_to_sclist(MINSERTFILE|MEXTCMD, "M-F", new_buffer_void, 0, FALSE);
add_to_sclist(MHELP|MBROWSER, "^C", do_exit, 0, TRUE); add_to_sclist(MHELP|MBROWSER, "^C", do_exit, 0, TRUE);
#ifndef DISABLE_HELP #ifndef DISABLE_HELP
@ -1506,6 +1506,11 @@ sc *strtosc(char *input)
} else if (!strcasecmp(input, "backup")) { } else if (!strcasecmp(input, "backup")) {
s->scfunc = backup_file_void; s->scfunc = backup_file_void;
s->execute = FALSE; s->execute = FALSE;
#ifndef ENABLE_TINY
} else if (!strcasecmp(input, "flipexecute")) {
s->scfunc = flip_execute_void;
s->execute = FALSE;
#endif
#ifndef DISABLE_MULTIBUFFER #ifndef DISABLE_MULTIBUFFER
} else if (!strcasecmp(input, "newbuffer")) { } else if (!strcasecmp(input, "newbuffer")) {
s->scfunc = new_buffer_void; s->scfunc = new_buffer_void;

View File

@ -837,6 +837,6 @@ void new_buffer_void(void);
void backwards_void(void); void backwards_void(void);
void goto_dir_void(void); void goto_dir_void(void);
void no_replace_void(void); void no_replace_void(void);
void ext_cmd_void(void); void flip_execute_void(void);
#endif /* !PROTO_H */ #endif /* !PROTO_H */