From a997aa6d58e13d121b5d811779546e94838e23eb Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Wed, 26 Mar 2014 19:25:38 +0000 Subject: [PATCH] Allowing binding and unbinding of keys when colour is disabled. git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4685 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- ChangeLog | 1 + src/rcfile.c | 13 +++++++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5c8d330e..330106f5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -7,6 +7,7 @@ * nano.spec.in, doc/faq.html, doc/texinfo/nano.texi - Remove vestiges of the obsolete '--enable-all' configure flag. * src/rcfile.c - Fix compilation with --disable-color. + * src/rcfile.c - Allow (un)binding keys when colour is disabled. 2014-03-26 Mike Frysinger . * configure.ac - Clean up most of the --with/--enable flags: diff --git a/src/rcfile.c b/src/rcfile.c index c98d781b..2d00871e 100644 --- a/src/rcfile.c +++ b/src/rcfile.c @@ -446,6 +446,7 @@ void parse_magictype(char *ptr) } #endif /* HAVE_LIBMAGIC */ } +#endif /* ENABLE_COLOR */ int check_bad_binding(sc *s) @@ -617,6 +618,7 @@ void parse_unbinding(char *ptr) } +#ifdef ENABLE_COLOR /* Read and parse additional syntax files. */ void parse_include(char *ptr) { @@ -1094,22 +1096,21 @@ void parse_rcfile(FILE *rcstream endsyntax->desc); parse_syntax(ptr); } - else if (strcasecmp(keyword, "magic") == 0) { + else if (strcasecmp(keyword, "magic") == 0) parse_magictype(ptr); - } else if (strcasecmp(keyword, "header") == 0) + else if (strcasecmp(keyword, "header") == 0) parse_headers(ptr); else if (strcasecmp(keyword, "color") == 0) parse_colors(ptr, FALSE); else if (strcasecmp(keyword, "icolor") == 0) parse_colors(ptr, TRUE); + else if (strcasecmp(keyword, "linter") == 0) + parse_linter(ptr); +#endif /* ENABLE_COLOR */ else if (strcasecmp(keyword, "bind") == 0) parse_keybinding(ptr); else if (strcasecmp(keyword, "unbind") == 0) parse_unbinding(ptr); - else if (strcasecmp(keyword, "linter") == 0) { - parse_linter(ptr); - } -#endif /* ENABLE_COLOR */ else rcfile_error(N_("Command \"%s\" not understood"), keyword); -- 2.39.5