commit 00389928d428b31908ac0445f95654915670403c
parent 61bba1de8ea5ea8a3ad0cb0e887ddf83cb5ddcb2
Author: Benno Schulenberg <bensberg@justemail.net>
Date: Fri, 4 Apr 2014 11:59:03 +0000
Converting #ifdef ENABLE_COLOR to #ifndef DISABLE_COLOR.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4719 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
Diffstat:
14 files changed, 88 insertions(+), 88 deletions(-)
diff --git a/ChangeLog b/ChangeLog
@@ -5,6 +5,8 @@
* src/rcfile.c (check_vitals_mapped): Do not allow 'set quiet'
to suppress a fatal-error message, make sure the user sees it.
* src/color.c: Comment tweaks.
+ * src/{*.h,*.c}, configure.ac:Convert all occurrences of
+ #ifdef ENABLE_COLOR to #ifndef DISABLE_COLOR.⏎
2014-04-03 Benno Schulenberg <bensberg@justemail.net>
* configure.ac: Remove unused '*_support' variables.
diff --git a/configure.ac b/configure.ac
@@ -96,20 +96,21 @@ if test "x$enable_nanorc" = xno; then
if test "x$enable_color" = xyes; then
AC_MSG_ERROR([--enable-color cannot work with --disable-nanorc])
else
+ # Disabling nanorc silently disables color support.
enable_color=no
fi
fi
-if test "x$enable_color" != xno; then
- if test x$ac_cv_header_regex_h = xyes; then
- enable_nanorc=yes
- AC_DEFINE(ENABLE_COLOR, 1, [Define this to have syntax highlighting, requires regex.h and ENABLE_NANORC too!])
- color_support=yes
- elif test "x$enable_color" = xyes; then
+if test "x$enable_color" = xno; then
+ AC_DEFINE(DISABLE_COLOR, 1, [Define this to disable syntax highlighting.])
+else
+ if test x$ac_cv_header_regex_h != xyes; then
AC_MSG_ERROR([
-*** The header file regex.h was not found. If you wish to use color
-*** support this header file is required. Please either install C
-*** libraries that include the regex.h file or call the configure
-*** script with --disable-color.])
+*** The header file regex.h was not found. If you wish to have
+*** color support, this header file is required. Please either
+*** install C libraries that include the regex.h file, or call
+*** the configure script with --disable-color.])
+ else
+ color_support=yes
fi
fi
diff --git a/src/color.c b/src/color.c
@@ -31,7 +31,7 @@
#include <magic.h>
#endif
-#ifdef ENABLE_COLOR
+#ifndef DISABLE_COLOR
/* For each syntax list entry, go through the list of colors and assign
* the color pairs. */
@@ -421,4 +421,5 @@ void reset_multis(filestruct *fileptr, bool force)
reset_multis_for_id(fileptr, tmpcolor->id);
}
}
-#endif /* ENABLE_COLOR */
+
+#endif /* !DISABLE_COLOR */
diff --git a/src/cut.c b/src/cut.c
@@ -216,7 +216,7 @@ void do_cut_text(
/* Update the screen. */
edit_refresh_needed = TRUE;
-#ifdef ENABLE_COLOR
+#ifndef DISABLE_COLOR
reset_multis(openfile->current, FALSE);
#endif
@@ -281,7 +281,7 @@ void do_uncut_text(void)
/* Update the screen. */
edit_refresh_needed = TRUE;
-#ifdef ENABLE_COLOR
+#ifndef DISABLE_COLOR
reset_multis(openfile->current, FALSE);
#endif
diff --git a/src/files.c b/src/files.c
@@ -80,7 +80,7 @@ void initialize_buffer(void)
openfile->current_undo = NULL;
openfile->lock_filename = NULL;
#endif
-#ifdef ENABLE_COLOR
+#ifndef DISABLE_COLOR
openfile->colorstrings = NULL;
#endif
}
@@ -98,7 +98,7 @@ void initialize_buffer_text(void)
openfile->edittop = openfile->fileage;
openfile->current = openfile->fileage;
-#ifdef ENABLE_COLOR
+#ifndef DISABLE_COLOR
openfile->fileage->multidata = NULL;
#endif
@@ -367,7 +367,7 @@ void open_buffer(const char *filename, bool undoable)
openfile->placewewant = 0;
}
-#ifdef ENABLE_COLOR
+#ifndef DISABLE_COLOR
/* If we're loading into a new buffer, update the colors to account
* for it, if applicable. */
if (new_buffer)
@@ -414,7 +414,7 @@ void display_buffer(void)
/* Update the titlebar, since the filename may have changed. */
titlebar(NULL);
-#ifdef ENABLE_COLOR
+#ifndef DISABLE_COLOR
/* Make sure we're using the buffer's associated colors, if
* applicable. */
color_init();
@@ -564,7 +564,7 @@ filestruct *read_line(char *buf, filestruct *prevnode, bool
fileptr->data[buf_len - 1] = '\0';
#endif
-#ifdef ENABLE_COLOR
+#ifndef DISABLE_COLOR
fileptr->multidata = NULL;
#endif
@@ -2123,7 +2123,7 @@ bool write_file(const char *name, FILE *f_open, bool tmp, append_type
if (!nonamechange) {
openfile->filename = mallocstrcpy(openfile->filename,
realname);
-#ifdef ENABLE_COLOR
+#ifndef DISABLE_COLOR
/* We might have changed the filename, so update the colors
* to account for it, and then make sure we're using
* them. */
diff --git a/src/global.c b/src/global.c
@@ -149,7 +149,7 @@ char *alt_speller = NULL;
/* The command to use for the alternate spell checker. */
#endif
-#ifdef ENABLE_COLOR
+#ifndef DISABLE_COLOR
syntaxtype *syntaxes = NULL;
/* The global list of color syntaxes. */
char *syntaxstr = NULL;
@@ -580,7 +580,7 @@ void shortcut_init(bool unjustify)
#ifndef DISABLE_SPELLER
const char *spell_msg = N_("To Spell");
#endif
-#ifdef ENABLE_COLOR
+#ifndef DISABLE_COLOR
const char *lint_msg = N_("To Linter");
const char *prev_lint_msg = N_("Prev Lint Msg");
const char *next_lint_msg = N_("Next Lint Msg");
@@ -736,7 +736,7 @@ void shortcut_init(bool unjustify)
const char *nano_backfile_msg = N_("Go to the previous file in the list");
const char *nano_gotodir_msg = N_("Go to directory");
#endif
-#ifdef ENABLE_COLOR
+#ifndef DISABLE_COLOR
const char *nano_lint_msg = N_("Invoke the linter, if available");
const char *nano_prevlint_msg = N_("Go to previous linter msg");
const char *nano_nextlint_msg = N_("Go to next linter msg");
@@ -814,7 +814,7 @@ void shortcut_init(bool unjustify)
add_to_funcs(do_page_down, MMAIN|MHELP|MBROWSER,
next_page_msg, IFSCHELP(nano_nextpage_msg), TRUE, VIEW);
-#ifdef ENABLE_COLOR
+#ifndef DISABLE_COLOR
add_to_funcs(do_page_up, MLINTER,
prev_lint_msg, IFSCHELP(nano_prevlint_msg), FALSE, VIEW);
add_to_funcs(do_page_down, MLINTER,
@@ -849,7 +849,7 @@ void shortcut_init(bool unjustify)
TRUE, NOVIEW);
#endif
-#ifdef ENABLE_COLOR
+#ifndef DISABLE_COLOR
add_to_funcs(do_linter, MMAIN, lint_msg, IFSCHELP(nano_lint_msg),
TRUE, NOVIEW);
#endif
@@ -1287,7 +1287,7 @@ void shortcut_init(bool unjustify)
#endif
}
-#ifdef ENABLE_COLOR
+#ifndef DISABLE_COLOR
void set_lint_shortcuts(void)
{
#ifndef DISABLE_SPELLER
@@ -1702,7 +1702,7 @@ void thanks_for_all_the_fish(void)
/* Free the memory associated with each open file buffer. */
if (openfile != NULL)
free_openfilestruct(openfile);
-#ifdef ENABLE_COLOR
+#ifndef DISABLE_COLOR
if (syntaxstr != NULL)
free(syntaxstr);
while (syntaxes != NULL) {
@@ -1740,7 +1740,7 @@ void thanks_for_all_the_fish(void)
syntaxes = syntaxes->next;
free(bill);
}
-#endif /* ENABLE_COLOR */
+#endif /* !DISABLE_COLOR */
#ifndef NANO_TINY
/* Free the search and replace history lists. */
if (searchage != NULL)
diff --git a/src/nano.c b/src/nano.c
@@ -68,7 +68,7 @@ filestruct *make_new_node(filestruct *prevnode)
newnode->next = NULL;
newnode->lineno = (prevnode != NULL) ? prevnode->lineno + 1 : 1;
-#ifdef ENABLE_COLOR
+#ifndef DISABLE_COLOR
newnode->multidata = NULL;
#endif
@@ -88,7 +88,7 @@ filestruct *copy_node(const filestruct *src)
dst->next = src->next;
dst->prev = src->prev;
dst->lineno = src->lineno;
-#ifdef ENABLE_COLOR
+#ifndef DISABLE_COLOR
dst->multidata = NULL;
#endif
@@ -127,7 +127,7 @@ void delete_node(filestruct *fileptr)
if (fileptr->data != NULL)
free(fileptr->data);
-#ifdef ENABLE_COLOR
+#ifndef DISABLE_COLOR
if (fileptr->multidata)
free(fileptr->multidata);
#endif
@@ -372,7 +372,7 @@ void move_to_filestruct(filestruct **file_top, filestruct **file_bot,
openfile->fileage->data = mallocstrcpy(NULL, "");
openfile->filebot = openfile->fileage;
-#ifdef ENABLE_COLOR
+#ifndef DISABLE_COLOR
openfile->fileage->multidata = NULL;
#endif
@@ -899,7 +899,7 @@ void usage(void)
print_opt("-W", "--wordbounds",
N_("Detect word boundaries more accurately"));
#endif
-#ifdef ENABLE_COLOR
+#ifndef DISABLE_COLOR
print_opt(_("-Y <str>"), _("--syntax=<str>"),
N_("Syntax definition to use for coloring"));
#endif
@@ -1004,7 +1004,7 @@ void version(void)
#ifdef DISABLE_ROOTWRAPPING
printf(" --disable-wrapping-as-root");
#endif
-#ifdef ENABLE_COLOR
+#ifndef DISABLE_COLOR
printf(" --enable-color");
#endif
#ifdef DEBUG
@@ -1391,7 +1391,7 @@ void do_toggle(int flag)
edit_refresh();
break;
#endif
-#ifdef ENABLE_COLOR
+#ifndef DISABLE_COLOR
case NO_COLOR_SYNTAX:
edit_refresh();
break;
@@ -1407,7 +1407,7 @@ void do_toggle(int flag)
#ifndef DISABLE_WRAPPING
|| flag == NO_WRAP
#endif
-#ifdef ENABLE_COLOR
+#ifndef DISABLE_COLOR
|| flag == NO_COLOR_SYNTAX
#endif
)
@@ -1674,7 +1674,7 @@ int do_input(bool *meta_key, bool *func_key, bool *s_or_t, bool
{
#endif
s->scfunc();
-#ifdef ENABLE_COLOR
+#ifndef DISABLE_COLOR
if (f && !f->viewok && openfile->syntax != NULL
&& openfile->syntax->nmultis > 0) {
reset_multis(openfile->current, FALSE);
@@ -1797,7 +1797,7 @@ int do_mouse(void)
}
#endif /* !DISABLE_MOUSE */
-#ifdef ENABLE_COLOR
+#ifndef DISABLE_COLOR
void alloc_multidata_if_needed(filestruct *fileptr)
{
if (!fileptr->multidata)
@@ -1931,7 +1931,7 @@ void precalc_multicolorinfo(void)
precalc_cleanup:
nodelay(edit, FALSE);
}
-#endif /* ENABLE_COLOR */
+#endif /* !DISABLE_COLOR */
/* The user typed output_len multibyte characters. Add them to the edit
* buffer, filtering out all ASCII control characters if allow_cntrls is
@@ -2015,7 +2015,7 @@ void do_output(char *output, size_t output_len, bool allow_cntrls)
edit_refresh_needed = TRUE;
#endif
-#ifdef ENABLE_COLOR
+#ifndef DISABLE_COLOR
/* If color syntaxes are available and turned on, we need to
* call edit_refresh(). */
if (openfile->colorstrings != NULL && !ISSET(NO_COLOR_SYNTAX))
@@ -2033,7 +2033,7 @@ void do_output(char *output, size_t output_len, bool allow_cntrls)
openfile->placewewant = xplustabs();
-#ifdef ENABLE_COLOR
+#ifndef DISABLE_COLOR
reset_multis(openfile->current, FALSE);
#endif
if (edit_refresh_needed == TRUE) {
@@ -2078,7 +2078,7 @@ int main(int argc, char **argv)
{"restricted", 0, NULL, 'R'},
{"tabsize", 1, NULL, 'T'},
{"version", 0, NULL, 'V'},
-#ifdef ENABLE_COLOR
+#ifndef DISABLE_COLOR
{"syntax", 1, NULL, 'Y'},
#endif
{"const", 0, NULL, 'c'},
@@ -2264,7 +2264,7 @@ int main(int argc, char **argv)
SET(WORD_BOUNDS);
break;
#endif
-#ifdef ENABLE_COLOR
+#ifndef DISABLE_COLOR
case 'Y':
syntaxstr = mallocstrcpy(syntaxstr, optarg);
break;
@@ -2695,7 +2695,7 @@ int main(int argc, char **argv)
fprintf(stderr, "Main: top and bottom win\n");
#endif
-#ifdef ENABLE_COLOR
+#ifndef DISABLE_COLOR
if (openfile->syntax)
if (openfile->syntax->nmultis > 0)
precalc_multicolorinfo();
diff --git a/src/nano.h b/src/nano.h
@@ -191,7 +191,7 @@ typedef enum {
ADD, DEL, REPLACE, SPLIT, UNSPLIT, CUT, UNCUT, ENTER, INSERT, OTHER
} undo_type;
-#ifdef ENABLE_COLOR
+#ifndef DISABLE_COLOR
typedef struct colortype {
short fg;
/* This syntax's foreground color. */
@@ -275,7 +275,7 @@ typedef struct lintstruct {
#define CWTF (1<<6)
/* Something else */
-#endif /* ENABLE_COLOR */
+#endif /* !DISABLE_COLOR */
/* Structure types. */
@@ -288,7 +288,7 @@ typedef struct filestruct {
/* Next node. */
struct filestruct *prev;
/* Previous node. */
-#ifdef ENABLE_COLOR
+#ifndef DISABLE_COLOR
short *multidata; /* Array of which multi-line regexes apply to this line */
#endif
} filestruct;
@@ -396,7 +396,7 @@ typedef struct openfilestruct {
const char *lock_filename;
/* The path of the lockfile, if we created one */
#endif
-#ifdef ENABLE_COLOR
+#ifndef DISABLE_COLOR
syntaxtype *syntax;
/* The syntax struct for this file, if any */
colortype *colorstrings;
diff --git a/src/proto.h b/src/proto.h
@@ -99,7 +99,7 @@ extern char *alt_speller;
extern sc *sclist;
extern subnfunc *allfuncs;
-#ifdef ENABLE_COLOR
+#ifndef DISABLE_COLOR
extern syntaxtype *syntaxes;
extern char *syntaxstr;
#endif
@@ -230,7 +230,7 @@ bool is_valid_mbstring(const char *s);
#endif
/* All functions in color.c. */
-#ifdef ENABLE_COLOR
+#ifndef DISABLE_COLOR
void set_colorpairs(void);
void color_init(void);
void color_update(void);
@@ -332,7 +332,7 @@ void load_poshistory(void);
void save_poshistory(void);
int check_poshistory(const char *file, ssize_t *line, ssize_t *column);
#endif
-#ifdef ENABLE_COLOR
+#ifndef DISABLE_COLOR
void do_linter(void);
void set_lint_shortcuts(void);
void set_spell_shortcuts(void);
@@ -552,7 +552,7 @@ int do_yesno_prompt(bool all, const char *msg);
void rcfile_error(const char *msg, ...);
char *parse_next_word(char *ptr);
char *parse_argument(char *ptr);
-#ifdef ENABLE_COLOR
+#ifndef DISABLE_COLOR
char *parse_next_regex(char *ptr);
bool nregcomp(const char *regex, int eflags);
void parse_syntax(char *ptr);
@@ -564,7 +564,7 @@ void reset_multis(filestruct *fileptr, bool force);
void alloc_multidata_if_needed(filestruct *fileptr);
#endif
void parse_rcfile(FILE *rcstream
-#ifdef ENABLE_COLOR
+#ifndef DISABLE_COLOR
, bool syntax_only
#endif
);
diff --git a/src/rcfile.c b/src/rcfile.c
@@ -109,14 +109,13 @@ static size_t lineno = 0;
/* If we did, the line number where the last error occurred. */
static char *nanorc = NULL;
/* The path to the rcfile we're parsing. */
-#ifdef ENABLE_COLOR
+#ifndef DISABLE_COLOR
static syntaxtype *endsyntax = NULL;
/* The end of the list of syntaxes. */
static exttype *endheader = NULL;
/* End of header list */
static colortype *endcolor = NULL;
/* The end of the color list for the current syntax. */
-
#endif
/* We have an error in some part of the rcfile. Print the error message
@@ -198,7 +197,7 @@ char *parse_argument(char *ptr)
return ptr;
}
-#ifdef ENABLE_COLOR
+#ifndef DISABLE_COLOR
/* Parse the next regex string from the line at ptr, and return it. */
char *parse_next_regex(char *ptr)
{
@@ -376,7 +375,6 @@ void parse_syntax(char *ptr)
} else
free(newext);
}
-
}
@@ -447,7 +445,7 @@ void parse_magictype(char *ptr)
}
#endif /* HAVE_LIBMAGIC */
}
-#endif /* ENABLE_COLOR */
+#endif /* !DISABLE_COLOR */
int check_bad_binding(sc *s)
@@ -619,7 +617,7 @@ void parse_unbinding(char *ptr)
}
-#ifdef ENABLE_COLOR
+#ifndef DISABLE_COLOR
/* Read and parse additional syntax files. */
static void _parse_include(char *file)
{
@@ -656,7 +654,7 @@ static void _parse_include(char *file)
#endif
parse_rcfile(rcstream
-#ifdef ENABLE_COLOR
+#ifndef DISABLE_COLOR
, TRUE
#endif
);
@@ -952,7 +950,6 @@ void parse_headers(char *ptr)
endheader = newheader;
} else
free(newheader);
-
}
}
@@ -982,12 +979,11 @@ void parse_linter(char *ptr)
else
endsyntax->linter = mallocstrcpy(syntaxes->linter, ptr);
}
-#endif /* ENABLE_COLOR */
-
+#endif /* !DISABLE_COLOR */
/* Check whether the user has unmapped every shortcut for a
-sequence we consider 'vital', like the exit function */
+ * sequence we consider 'vital', like the exit function. */
static void check_vitals_mapped(void)
{
subnfunc *f;
@@ -1017,7 +1013,7 @@ static void check_vitals_mapped(void)
* and close it afterwards. If syntax_only is TRUE, only allow the file
* to contain color syntax commands: syntax, color, and icolor. */
void parse_rcfile(FILE *rcstream
-#ifdef ENABLE_COLOR
+#ifndef DISABLE_COLOR
, bool syntax_only
#endif
)
@@ -1025,7 +1021,7 @@ void parse_rcfile(FILE *rcstream
char *buf = NULL;
ssize_t len;
size_t n = 0;
-#ifdef ENABLE_COLOR
+#ifndef DISABLE_COLOR
syntaxtype *end_syn_save = NULL;
#endif
@@ -1053,7 +1049,7 @@ void parse_rcfile(FILE *rcstream
ptr = parse_next_word(ptr);
-#ifdef ENABLE_COLOR
+#ifndef DISABLE_COLOR
/* Handle extending first... */
if (strcasecmp(keyword, "extendsyntax") == 0) {
char *syntaxname = ptr;
@@ -1078,7 +1074,7 @@ void parse_rcfile(FILE *rcstream
/* Try to parse the keyword. */
if (strcasecmp(keyword, "set") == 0) {
-#ifdef ENABLE_COLOR
+#ifndef DISABLE_COLOR
if (syntax_only)
rcfile_error(
N_("Command \"%s\" not allowed in included file"),
@@ -1087,7 +1083,7 @@ void parse_rcfile(FILE *rcstream
#endif
set = 1;
} else if (strcasecmp(keyword, "unset") == 0) {
-#ifdef ENABLE_COLOR
+#ifndef DISABLE_COLOR
if (syntax_only)
rcfile_error(
N_("Command \"%s\" not allowed in included file"),
@@ -1096,7 +1092,7 @@ void parse_rcfile(FILE *rcstream
#endif
set = -1;
}
-#ifdef ENABLE_COLOR
+#ifndef DISABLE_COLOR
else if (strcasecmp(keyword, "include") == 0) {
if (syntax_only)
rcfile_error(
@@ -1120,7 +1116,7 @@ void parse_rcfile(FILE *rcstream
parse_colors(ptr, TRUE);
else if (strcasecmp(keyword, "linter") == 0)
parse_linter(ptr);
-#endif /* ENABLE_COLOR */
+#endif /* !DISABLE_COLOR */
else if (strcasecmp(keyword, "bind") == 0)
parse_keybinding(ptr);
else if (strcasecmp(keyword, "unbind") == 0)
@@ -1128,9 +1124,9 @@ void parse_rcfile(FILE *rcstream
else
rcfile_error(N_("Command \"%s\" not understood"), keyword);
-#ifdef ENABLE_COLOR
- /* If we temporarily reset emdsyntax to allow extending, reset
- the value here */
+#ifndef DISABLE_COLOR
+ /* If we temporarily reset endsyntax to allow extending,
+ * restore the value here. */
if (end_syn_save != NULL) {
endsyntax = end_syn_save;
end_syn_save = NULL;
@@ -1295,7 +1291,7 @@ void parse_rcfile(FILE *rcstream
rcfile_error(N_("Unknown flag \"%s\""), option);
}
-#ifdef ENABLE_COLOR
+#ifndef DISABLE_COLOR
if (endsyntax != NULL && endcolor == NULL)
rcfile_error(N_("Syntax \"%s\" has no color commands"),
endsyntax->desc);
@@ -1335,7 +1331,7 @@ void do_rcfile(void)
rcstream = fopen(nanorc, "rb");
if (rcstream != NULL)
parse_rcfile(rcstream
-#ifdef ENABLE_COLOR
+#ifndef DISABLE_COLOR
, FALSE
#endif
);
@@ -1377,7 +1373,7 @@ void do_rcfile(void)
strerror(errno));
} else
parse_rcfile(rcstream
-#ifdef ENABLE_COLOR
+#ifndef DISABLE_COLOR
, FALSE
#endif
);
@@ -1394,7 +1390,7 @@ void do_rcfile(void)
;
}
-#ifdef ENABLE_COLOR
+#ifndef DISABLE_COLOR
set_colorpairs();
#endif
}
diff --git a/src/search.c b/src/search.c
@@ -719,7 +719,7 @@ ssize_t do_replace_loop(
filepart = partition_filestruct(top, top_x, bot, bot_x);
openfile->edittop = openfile->fileage;
openfile->mark_set = FALSE;
-#ifdef ENABLE_COLOR
+#ifndef DISABLE_COLOR
reset_multis(openfile->current, TRUE);
#endif
edit_refresh();
@@ -866,12 +866,12 @@ ssize_t do_replace_loop(
free(openfile->current->data);
openfile->current->data = copy;
-#ifdef ENABLE_COLOR
+#ifndef DISABLE_COLOR
reset_multis(openfile->current, TRUE);
#endif
edit_refresh();
if (!replaceall) {
-#ifdef ENABLE_COLOR
+#ifndef DISABLE_COLOR
/* If color syntaxes are available and turned on, we
* need to call edit_refresh(). */
if (openfile->colorstrings != NULL &&
diff --git a/src/text.c b/src/text.c
@@ -2976,7 +2976,7 @@ void do_spell(void)
}
#endif /* !DISABLE_SPELLER */
-#ifdef ENABLE_COLOR
+#ifndef DISABLE_COLOR
/* Run linter. Based on alt-speller code. Return NULL for normal
* termination, and the error string otherwise. */
void do_linter(void)
@@ -3272,7 +3272,7 @@ void do_linter(void)
currmenu = MMAIN;
display_main_list();
}
-#endif /* ENABLE_COLOR */
+#endif /* !DISABLE_COLOR */
#ifndef NANO_TINY
/* Our own version of "wc". Note that its character counts are in
diff --git a/src/utils.c b/src/utils.c
@@ -546,7 +546,7 @@ void new_magicline(void)
openfile->filebot->next->prev = openfile->filebot;
openfile->filebot->next->next = NULL;
openfile->filebot->next->lineno = openfile->filebot->lineno + 1;
-#ifdef ENABLE_COLOR
+#ifndef DISABLE_COLOR
openfile->filebot->next->multidata = NULL;
#endif
openfile->filebot = openfile->filebot->next;
diff --git a/src/winio.c b/src/winio.c
@@ -2479,7 +2479,7 @@ void reset_cursor(void)
void edit_draw(filestruct *fileptr, const char *converted, int
line, size_t start)
{
-#if !defined(NANO_TINY) || defined(ENABLE_COLOR)
+#if !defined(NANO_TINY) || !defined(DISABLE_COLOR)
size_t startpos = actual_x(fileptr->data, start);
/* The position in fileptr->data of the leftmost character
* that displays at least partially on the window. */
@@ -2498,7 +2498,7 @@ void edit_draw(filestruct *fileptr, const char *converted, int
* just the text that needs it). */
mvwaddstr(edit, line, 0, converted);
-#ifdef ENABLE_COLOR
+#ifndef DISABLE_COLOR
/* If color syntaxes are available and turned on, we need to display
* them. */
if (openfile->colorstrings != NULL && !ISSET(NO_COLOR_SYNTAX)) {
@@ -2763,7 +2763,7 @@ void edit_draw(filestruct *fileptr, const char *converted, int
wattroff(edit, COLOR_PAIR(tmpcolor->pairnum));
}
}
-#endif /* ENABLE_COLOR */
+#endif /* !DISABLE_COLOR */
#ifndef NANO_TINY
/* If the mark is on, we need to display it. */
@@ -3296,7 +3296,7 @@ void total_refresh(void)
* portion of the window. */
void display_main_list(void)
{
-#ifdef ENABLE_COLOR
+#ifndef DISABLE_COLOR
if (openfile->syntax && openfile->syntax->linter)
set_lint_shortcuts();
else