From: Benno Schulenberg Date: Fri, 9 May 2014 15:14:29 +0000 (+0000) Subject: Defining a shortcut for the linter when the speller is disabled, X-Git-Tag: v2.3.3~80 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=387b20969da89c28da11167d501dda4fb0ed471f;p=nano.git Defining a shortcut for the linter when the speller is disabled, and fixing compilation with --disable-speller. git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4850 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- diff --git a/ChangeLog b/ChangeLog index 04191ef3..d088ac3d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,8 @@ again correctly. This fixes the second part of Savannah bug #42093. * src/global.c (shortcut_init, strtosc): Do not define nor accept shortcuts for functions that are disabled. + * src/global.c (shortcut_init, strtosc): Define shortcut for the linter + when speller is disabled, and fix compilation with --disable-speller. 2014-05-06 Benno Schulenberg * doc/texinfo/nano.texi: Let makeinfo figure out the node pointers. diff --git a/src/global.c b/src/global.c index 6740b69d..52f787e7 100644 --- a/src/global.c +++ b/src/global.c @@ -742,9 +742,6 @@ void shortcut_init(void) nano_justify_msg, FALSE, NOVIEW); #endif - /* If we're using restricted mode, spell checking is disabled - * because it allows reading from or writing to files not specified - * on the command line. */ #ifndef DISABLE_SPELLER add_to_funcs(do_spell, MMAIN, spell_tag, IFSCHELP(nano_spell_msg), FALSE, NOVIEW); @@ -1012,6 +1009,11 @@ void shortcut_init(void) #ifndef DISABLE_SPELLER add_to_sclist(MMAIN, "^T", do_spell, 0, TRUE); add_to_sclist(MMAIN, "F12", do_spell, 0, TRUE); +#else +#ifndef DISABLE_COLOR + add_to_sclist(MMAIN, "^T", do_linter, 0, TRUE); + add_to_sclist(MMAIN, "F12", do_linter, 0, TRUE); +#endif #endif add_to_sclist(MMAIN, "^C", do_cursorpos_void, 0, TRUE); add_to_sclist(MMAIN, "F11", do_cursorpos_void, 0, TRUE); @@ -1292,6 +1294,8 @@ sc *strtosc(char *input) s->scfunc = do_copy_text; else if (!strcasecmp(input, "mark")) s->scfunc = do_mark; +#endif +#ifndef DISABLE_SPELLER else if (!strcasecmp(input, "tospell") || !strcasecmp(input, "speller")) s->scfunc = do_spell;