build: fix compilation when configured with --enable-tiny

And when configured with --enable-tiny --enable-nanorc.
master
Benno Schulenberg 2018-02-14 17:47:08 +01:00
parent 3e1fc6385b
commit 0cf455bc48
3 changed files with 10 additions and 0 deletions

View File

@ -318,9 +318,11 @@ void flip_newbuffer(void)
void discard_buffer(void) void discard_buffer(void)
{ {
} }
#ifdef ENABLE_NANORC
void implant(void) void implant(void)
{ {
} }
#endif
/* Add a function to the function list. */ /* Add a function to the function list. */
void add_to_funcs(void (*func)(void), int menus, const char *desc, const char *help, void add_to_funcs(void (*func)(void), int menus, const char *desc, const char *help,
@ -1385,11 +1387,13 @@ void set_spell_shortcuts(void)
/* Execute the function of the given shortcut. */ /* Execute the function of the given shortcut. */
void execute(const sc *shortcut) void execute(const sc *shortcut)
{ {
#ifdef ENABLE_NANORC
if (shortcut->scfunc == implant) if (shortcut->scfunc == implant)
/* Insert the corresponding string into the keyboard buffer. */ /* Insert the corresponding string into the keyboard buffer. */
for (int i = strlen(shortcut->expansion); i > 0; i--) for (int i = strlen(shortcut->expansion); i > 0; i--)
put_back(shortcut->expansion[i - 1]); put_back(shortcut->expansion[i - 1]);
else else
#endif
shortcut->scfunc(); shortcut->scfunc();
} }

View File

@ -439,6 +439,8 @@ typedef struct sc {
int ordinal; int ordinal;
/* The how-manieth toggle this is, in order to be able to /* The how-manieth toggle this is, in order to be able to
* keep them in sequence. */ * keep them in sequence. */
#endif
#ifdef ENABLE_NANORC
char *expansion; char *expansion;
/* The string of keycodes to which this shortcut is expanded. */ /* The string of keycodes to which this shortcut is expanded. */
#endif #endif

View File

@ -335,6 +335,8 @@ bool is_universal(void (*func)(void))
func == do_home || func == do_end || func == do_home || func == do_end ||
#ifndef NANO_TINY #ifndef NANO_TINY
func == do_prev_word_void || func == do_next_word_void || func == do_prev_word_void || func == do_next_word_void ||
#endif
#ifndef ENABLE_NANORC
func == implant || func == implant ||
#endif #endif
func == do_delete || func == do_backspace || func == do_delete || func == do_backspace ||
@ -420,7 +422,9 @@ void parse_binding(char *ptr, bool dobind)
newsc = nmalloc(sizeof(sc)); newsc = nmalloc(sizeof(sc));
newsc->scfunc = implant; newsc->scfunc = implant;
newsc->expansion = mallocstrcpy(NULL, funcptr + 1); newsc->expansion = mallocstrcpy(NULL, funcptr + 1);
#ifndef NANO_TINY
newsc->toggle = 0; newsc->toggle = 0;
#endif
} else } else
newsc = strtosc(funcptr); newsc = strtosc(funcptr);