Printing menu numbers for debugging in hex.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4675 35c25a1d-7b9e-4130-9fde-d3aeb78583b8master
parent
eaff14f320
commit
18c252d5e7
|
@ -13,6 +13,8 @@
|
||||||
before trying the legacy ways. Patch by Mike Frysinger.
|
before trying the legacy ways. Patch by Mike Frysinger.
|
||||||
* configure.ac - Add a configure flag to disable the use of the
|
* configure.ac - Add a configure flag to disable the use of the
|
||||||
fattening libmagic. Patch by Mike Frysinger.
|
fattening libmagic. Patch by Mike Frysinger.
|
||||||
|
* src/{global,rcfile,winio}.c - Print menu numbers for debugging
|
||||||
|
in hex, and tweak a few of those debugging messages.
|
||||||
|
|
||||||
2014-03-23 Benno Schulenberg <bensberg@justemail.net>
|
2014-03-23 Benno Schulenberg <bensberg@justemail.net>
|
||||||
* src/rcfile.c (parse_keybinding, parse_unbinding) - Improve a
|
* src/rcfile.c (parse_keybinding, parse_unbinding) - Improve a
|
||||||
|
|
|
@ -354,7 +354,7 @@ const sc *first_sc_for(int menu, void (*func)(void))
|
||||||
return rawsc;
|
return rawsc;
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
fprintf(stderr, "Whoops, returning null given func %ld in menu %d\n", (long) func, menu);
|
fprintf(stderr, "Whoops, returning null given func %ld in menu %x\n", (long) func, menu);
|
||||||
#endif
|
#endif
|
||||||
/* Otherwise... */
|
/* Otherwise... */
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -395,8 +395,7 @@ void add_to_sclist(int menu, const char *scstring, void (*func)(void), int toggl
|
||||||
assign_keyinfo(s);
|
assign_keyinfo(s);
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
fprintf(stderr, "list val = %d\n", (int) s->menu);
|
fprintf(stderr, "Setting sequence to %d for shortcut \"%s\" in menu %x\n", s->seq, scstring, (int) s->menu);
|
||||||
fprintf(stderr, "Hey, set sequence to %d for shortcut \"%s\"\n", s->seq, scstring);
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -490,7 +489,7 @@ void print_sclist(void)
|
||||||
for (s = sclist; s->next != NULL; s = s->next) {
|
for (s = sclist; s->next != NULL; s = s->next) {
|
||||||
f = sctofunc(s);
|
f = sctofunc(s);
|
||||||
if (f)
|
if (f)
|
||||||
fprintf(stderr, "Shortcut \"%s\", function: %s, menus %d\n", s->keystr, f->desc, f->menus);
|
fprintf(stderr, "Shortcut \"%s\", function: %s, menus %x\n", s->keystr, f->desc, f->menus);
|
||||||
else
|
else
|
||||||
fprintf(stderr, "Hmm, didnt find a func for \"%s\"\n", s->keystr);
|
fprintf(stderr, "Hmm, didnt find a func for \"%s\"\n", s->keystr);
|
||||||
}
|
}
|
||||||
|
|
12
src/rcfile.c
12
src/rcfile.c
|
@ -521,7 +521,7 @@ void parse_keybinding(char *ptr)
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
fprintf(stderr, "newsc now address %d, menu func assigned = %d, menu = %d\n",
|
fprintf(stderr, "newsc now address %d, func assigned = %d, menu = %x\n",
|
||||||
&newsc, newsc->scfunc, menu);
|
&newsc, newsc->scfunc, menu);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -544,10 +544,10 @@ void parse_keybinding(char *ptr)
|
||||||
we found for the same menu, then make this the new beginning. */
|
we found for the same menu, then make this the new 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;
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
fprintf(stderr, "replaced menu entry %d\n", s->menu);
|
fprintf(stderr, "replacing entry in menu %x\n", s->menu);
|
||||||
#endif
|
#endif
|
||||||
|
s->menu &= ~newsc->menu;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
newsc->next = sclist;
|
newsc->next = sclist;
|
||||||
|
@ -602,16 +602,16 @@ void parse_unbinding(char *ptr)
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
fprintf(stderr, "unbinding \"%s\" from menu = %d\n", keycopy, menu);
|
fprintf(stderr, "unbinding \"%s\" from menu %x\n", keycopy, menu);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Now find the appropriate 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;
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
fprintf(stderr, "deleted menu entry %d\n", s->menu);
|
fprintf(stderr, "deleting entry from menu %x\n", s->menu);
|
||||||
#endif
|
#endif
|
||||||
|
s->menu &= ~menu;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1786,13 +1786,13 @@ const sc *get_shortcut(int menu, int *kbinput, bool
|
||||||
&& ((s->type == META && *meta_key == TRUE && *kbinput == s->seq)
|
&& ((s->type == META && *meta_key == TRUE && *kbinput == s->seq)
|
||||||
|| (s->type != META && *kbinput == s->seq))) {
|
|| (s->type != META && *kbinput == s->seq))) {
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
fprintf (stderr, "matched seq \"%s\" and btw meta was %d (menus %d = %d)\n", s->keystr, *meta_key, menu, s->menu);
|
fprintf (stderr, "matched seq \"%s\", and btw meta was %d (menus %x = %x)\n", s->keystr, *meta_key, menu, s->menu);
|
||||||
#endif
|
#endif
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
fprintf (stderr, "matched nothing btw meta was %d\n", *meta_key);
|
fprintf (stderr, "matched nothing, btw meta was %d\n", *meta_key);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -2387,7 +2387,7 @@ void bottombars(int menu)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
fprintf(stderr, "found one! f->menus = %d, desc = \"%s\"\n", f->menus, f->desc);
|
fprintf(stderr, "found one! f->menus = %x, desc = \"%s\"\n", f->menus, f->desc);
|
||||||
#endif
|
#endif
|
||||||
s = first_sc_for(menu, f->scfunc);
|
s = first_sc_for(menu, f->scfunc);
|
||||||
if (s == NULL) {
|
if (s == NULL) {
|
||||||
|
|
Loading…
Reference in New Issue