commit 8089f5ad54dd65fd50f68eba8b7a71e018bf1018
parent 2579b105da63d7ce71697e69a99694a897cc4950
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Sun, 24 May 2020 12:03:05 +0200
build: do not let --disable-speller exclude also the formatter code
In the past, when Speller and Linter and Formatter were all bound
to ^T (later ones taking priority), it was easier to exclude also
the formatter code when --disable-speller was used. But since the
formatter was reintroduced (in commit 34170611) and bound to its
own keystroke (M-F), this is no longer the case.
Diffstat:
3 files changed, 1 insertion(+), 11 deletions(-)
diff --git a/src/global.c b/src/global.c
@@ -721,11 +721,9 @@ void shortcut_init(void)
const char *lint_gist = N_("Invoke the linter, if available");
const char *prevlint_gist = N_("Go to previous linter msg");
const char *nextlint_gist = N_("Go to next linter msg");
-#ifdef ENABLE_SPELLER
const char *formatter_gist =
N_("Invoke a program to format/arrange/manipulate the buffer");
#endif
-#endif
#endif /* ENABLE_HELP */
#ifdef ENABLE_HELP
@@ -1043,13 +1041,11 @@ void shortcut_init(void)
if (!ISSET(RESTRICTED)) {
add_to_funcs(do_linter, MMAIN,
N_("Linter"), WITHORSANS(lint_gist), TOGETHER, NOVIEW);
-#ifdef ENABLE_SPELLER
add_to_funcs(do_formatter, MMAIN,
N_("Formatter"), WITHORSANS(formatter_gist), BLANKAFTER, NOVIEW);
-#endif
}
#endif
-#endif
+#endif /* NANO_TINY */
add_to_funcs(do_savefile, MMAIN,
N_("Save"), WITHORSANS(savefile_gist), BLANKAFTER, NOVIEW);
@@ -1168,10 +1164,8 @@ void shortcut_init(void)
#endif
#ifdef ENABLE_COLOR
add_to_sclist(MMAIN, "M-B", 0, do_linter, 0);
-#ifdef ENABLE_SPELLER
add_to_sclist(MMAIN, "M-F", 0, do_formatter, 0);
#endif
-#endif
add_to_sclist(MMAIN, "^C", 0, do_cursorpos_void, 0);
add_to_sclist(MMAIN, "^_", 0, do_gotolinecolumn_void, 0);
add_to_sclist(MMAIN, "M-G", 0, do_gotolinecolumn_void, 0);
diff --git a/src/rcfile.c b/src/rcfile.c
@@ -272,11 +272,9 @@ keystruct *strtosc(const char *input)
#ifdef ENABLE_COLOR
else if (!strcmp(input, "linter"))
s->func = do_linter;
-#ifdef ENABLE_SPELLER
else if (!strcmp(input, "formatter"))
s->func = do_formatter;
#endif
-#endif
else if (!strcmp(input, "curpos"))
s->func = do_cursorpos_void;
else if (!strcmp(input, "gotoline"))
diff --git a/src/text.c b/src/text.c
@@ -2870,7 +2870,6 @@ void do_linter(void)
titlebar(NULL);
}
-#ifdef ENABLE_SPELLER
/* Run a manipulation program on the contents of the buffer. */
void do_formatter(void)
{
@@ -2906,7 +2905,6 @@ void do_formatter(void)
unlink(temp_name);
free(temp_name);
}
-#endif /* ENABLE_SPELLER */
#endif /* ENABLE_COLOR */
#ifndef NANO_TINY