Commit e15abc9c authored by Benno Schulenberg's avatar Benno Schulenberg
Browse files

Improving two error messages, and complaining about

wrong menu names after wrong function names.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4799 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
parent 94b1d01b
Showing with 10 additions and 8 deletions
+10 -8
...@@ -18,6 +18,8 @@ ...@@ -18,6 +18,8 @@
* src/rcfile.c (parse_binding): K-keys no longer exist. * src/rcfile.c (parse_binding): K-keys no longer exist.
* src/global.c, src/rcfile.c, doc/nanorc.sample.in: Allow the * src/global.c, src/rcfile.c, doc/nanorc.sample.in: Allow the
codes from the Ins and Del keys to be rebound. codes from the Ins and Del keys to be rebound.
* src/rcfile.c (parse_binding): Improve two error messages, and
complain about wrong menu names after wrong function names.
2014-04-16 Benno Schulenberg <bensberg@justemail.net> 2014-04-16 Benno Schulenberg <bensberg@justemail.net>
* src/winio.c (get_mouseinput): Properly find also the zeroeth * src/winio.c (get_mouseinput): Properly find also the zeroeth
......
...@@ -513,7 +513,7 @@ void parse_binding(char *ptr, bool dobind) ...@@ -513,7 +513,7 @@ void parse_binding(char *ptr, bool dobind)
ptr = parse_next_word(ptr); ptr = parse_next_word(ptr);
if (!strcmp(funcptr, "")) { if (!strcmp(funcptr, "")) {
rcfile_error(N_("Must specify function to bind key to")); rcfile_error(N_("Must specify a function to bind the key to"));
return; return;
} }
} }
...@@ -523,13 +523,7 @@ void parse_binding(char *ptr, bool dobind) ...@@ -523,13 +523,7 @@ void parse_binding(char *ptr, bool dobind)
if (!strcmp(menuptr, "")) { if (!strcmp(menuptr, "")) {
/* TRANSLATORS: Do not translate the word "all". */ /* TRANSLATORS: Do not translate the word "all". */
rcfile_error(N_("Must specify menu in which to bind/unbind key (or \"all\")")); rcfile_error(N_("Must specify a menu (or \"all\") in which to bind/unbind the key"));
return;
}
menu = strtomenu(menuptr);
if (menu < 1) {
rcfile_error(N_("Cannot map name \"%s\" to a menu"), menuptr);
return; return;
} }
...@@ -541,6 +535,12 @@ void parse_binding(char *ptr, bool dobind) ...@@ -541,6 +535,12 @@ void parse_binding(char *ptr, bool dobind)
} }
} }
menu = strtomenu(menuptr);
if (menu < 1) {
rcfile_error(N_("Cannot map name \"%s\" to a menu"), menuptr);
return;
}
#ifdef DEBUG #ifdef DEBUG
if (dobind) if (dobind)
fprintf(stderr, "newsc address is now %ld, assigned func = %ld, menu = %x\n", fprintf(stderr, "newsc address is now %ld, assigned func = %ld, menu = %x\n",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment