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

Improving a debugging message, fixing a translator comment, and tweaking others.

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4667 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
No related merge requests found
Showing with 14 additions and 15 deletions
+14 -15
2014-03-23 Benno Schulenberg <bensberg@justemail.net>
* src/rcfile.c (parse_keybinding, parse_unbinding) - Improve a
debugging message, fix a translator comment, and tweak others.
2014-03-22 Benno Schulenberg <bensberg@justemail.net> 2014-03-22 Benno Schulenberg <bensberg@justemail.net>
* THANKS - Add some missing translator names, and tweak others. * THANKS - Add some missing translator names, and tweak others.
......
...@@ -447,6 +447,7 @@ void parse_magictype(char *ptr) ...@@ -447,6 +447,7 @@ void parse_magictype(char *ptr)
#endif /* HAVE_LIBMAGIC */ #endif /* HAVE_LIBMAGIC */
} }
int check_bad_binding(sc *s) int check_bad_binding(sc *s)
{ {
#define BADLISTLEN 1 #define BADLISTLEN 1
...@@ -482,7 +483,7 @@ void parse_keybinding(char *ptr) ...@@ -482,7 +483,7 @@ void parse_keybinding(char *ptr)
if (keycopy[0] != 'M' && keycopy[0] != '^' && keycopy[0] != 'F' && keycopy[0] != 'K') { if (keycopy[0] != 'M' && keycopy[0] != '^' && keycopy[0] != 'F' && keycopy[0] != 'K') {
rcfile_error( rcfile_error(
N_("keybindings must begin with \"^\", \"M\", or \"F\"")); N_("Keybindings must begin with \"^\", \"M\", or \"F\""));
return; return;
} }
...@@ -500,8 +501,7 @@ void parse_keybinding(char *ptr) ...@@ -500,8 +501,7 @@ void parse_keybinding(char *ptr)
if (!strcmp(menuptr, "")) { if (!strcmp(menuptr, "")) {
rcfile_error( rcfile_error(
/* Note to translators, do not translate the word "all" /* TRANSLATORS: do not translate the word "all". */
in the sentence below, everything else is fine */
N_("Must specify menu to bind key to (or \"all\")")); N_("Must specify menu to bind key to (or \"all\")"));
return; return;
} }
...@@ -520,13 +520,11 @@ void parse_keybinding(char *ptr) ...@@ -520,13 +520,11 @@ void parse_keybinding(char *ptr)
return; return;
} }
#ifdef DEBUG #ifdef DEBUG
fprintf(stderr, "newsc now address %d, menu func assigned = %d, menu = %d\n", fprintf(stderr, "newsc now address %d, menu func assigned = %d, menu = %d\n",
&newsc, newsc->scfunc, menu); &newsc, newsc->scfunc, menu);
#endif #endif
newsc->keystr = keycopy; newsc->keystr = keycopy;
newsc->menu = menu; newsc->menu = menu;
newsc->type = strtokeytype(newsc->keystr); newsc->type = strtokeytype(newsc->keystr);
...@@ -542,9 +540,8 @@ void parse_keybinding(char *ptr) ...@@ -542,9 +540,8 @@ void parse_keybinding(char *ptr)
return; return;
} }
/* now let's have some fun. Try and delete the other entries /* Now let's have some fun. Try and delete the other entries
we found for the same menu, then make this new new we found for the same menu, then make this the new beginning. */
beginning */
for (s = sclist; s != NULL; s = s->next) { for (s = sclist; s != NULL; s = s->next) {
if (((s->menu & newsc->menu)) && s->seq == newsc->seq) { if (((s->menu & newsc->menu)) && s->seq == newsc->seq) {
s->menu &= ~newsc->menu; s->menu &= ~newsc->menu;
...@@ -557,7 +554,7 @@ void parse_keybinding(char *ptr) ...@@ -557,7 +554,7 @@ void parse_keybinding(char *ptr)
sclist = newsc; sclist = newsc;
} }
/* Let user unbind a sequence from a given (or all) menus */ /* Let the user unbind a sequence from a given (or all) menus. */
void parse_unbinding(char *ptr) void parse_unbinding(char *ptr)
{ {
char *keyptr = NULL, *keycopy = NULL, *menuptr = NULL; char *keyptr = NULL, *keycopy = NULL, *menuptr = NULL;
...@@ -578,12 +575,12 @@ void parse_unbinding(char *ptr) ...@@ -578,12 +575,12 @@ void parse_unbinding(char *ptr)
keycopy[i] = toupper(keycopy[i]); keycopy[i] = toupper(keycopy[i]);
#ifdef DEBUG #ifdef DEBUG
fprintf(stderr, "Starting unbinding code"); fprintf(stderr, "Starting the unbinding code...\n");
#endif #endif
if (keycopy[0] != 'M' && keycopy[0] != '^' && keycopy[0] != 'F' && keycopy[0] != 'K') { if (keycopy[0] != 'M' && keycopy[0] != '^' && keycopy[0] != 'F' && keycopy[0] != 'K') {
rcfile_error( rcfile_error(
N_("keybindings must begin with \"^\", \"M\", or \"F\"")); N_("Keybindings must begin with \"^\", \"M\", or \"F\""));
return; return;
} }
...@@ -592,8 +589,7 @@ void parse_unbinding(char *ptr) ...@@ -592,8 +589,7 @@ void parse_unbinding(char *ptr)
if (!strcmp(menuptr, "")) { if (!strcmp(menuptr, "")) {
rcfile_error( rcfile_error(
/* Note to translators, do not translate the word "all" /* TRANSLATORS: do not translate the word "all". */
in the sentence below, everything else is fine */
N_("Must specify menu to bind key to (or \"all\")")); N_("Must specify menu to bind key to (or \"all\")"));
return; return;
} }
...@@ -605,12 +601,11 @@ void parse_unbinding(char *ptr) ...@@ -605,12 +601,11 @@ void parse_unbinding(char *ptr)
return; return;
} }
#ifdef DEBUG #ifdef DEBUG
fprintf(stderr, "unbinding \"%s\" from menu = %d\n", keycopy, menu); fprintf(stderr, "unbinding \"%s\" from menu = %d\n", keycopy, menu);
#endif #endif
/* Now find the apropriate entries in the menu to delete */ /* Now find the appropriate entries in the menu to delete. */
for (s = sclist; s != NULL; s = s->next) { for (s = sclist; s != NULL; s = s->next) {
if (((s->menu & menu)) && !strcmp(s->keystr,keycopy)) { if (((s->menu & menu)) && !strcmp(s->keystr,keycopy)) {
s->menu &= ~menu; s->menu &= ~menu;
......
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