tweaks: transform the token DISABLE_TABCOMP to ENABLE_TABCOMP
parent
00533854c0
commit
a05180ed2d
14
configure.ac
14
configure.ac
|
@ -213,8 +213,15 @@ fi
|
||||||
|
|
||||||
AC_ARG_ENABLE(tabcomp,
|
AC_ARG_ENABLE(tabcomp,
|
||||||
AS_HELP_STRING([--disable-tabcomp], [Disable the tab-completion functions]))
|
AS_HELP_STRING([--disable-tabcomp], [Disable the tab-completion functions]))
|
||||||
if test "x$enable_tabcomp" = xno; then
|
if test "x$enable_tiny" = xyes; then
|
||||||
AC_DEFINE(DISABLE_TABCOMP, 1, [Define this to disable the tab-completion functions for filenames and search strings.])
|
if test "x$enable_tabcomp" != xyes; then
|
||||||
|
enable_tabcomp=no
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
if test "x$disable_tabcomp" != xyes; then
|
||||||
|
if test "x$enable_tabcomp" != xno; then
|
||||||
|
AC_DEFINE(ENABLE_TABCOMP, 1, [Define this to have tab completion for filenames and search strings.])
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
AC_ARG_ENABLE(wordcomp,
|
AC_ARG_ENABLE(wordcomp,
|
||||||
|
@ -285,9 +292,6 @@ if test "x$enable_tiny" = xyes; then
|
||||||
if test "x$enable_speller" != xyes; then
|
if test "x$enable_speller" != xyes; then
|
||||||
AC_DEFINE(DISABLE_SPELLER, 1, [Define this to disable the spell-checker functions.])
|
AC_DEFINE(DISABLE_SPELLER, 1, [Define this to disable the spell-checker functions.])
|
||||||
fi
|
fi
|
||||||
if test "x$enable_tabcomp" != xyes; then
|
|
||||||
AC_DEFINE(DISABLE_TABCOMP, 1, [Define this to disable the tab-completion functions for files and search strings.])
|
|
||||||
fi
|
|
||||||
if test "x$enable_wrapping" != xyes; then
|
if test "x$enable_wrapping" != xyes; then
|
||||||
AC_DEFINE(DISABLE_WRAPPING, 1, [Define this to disable all text wrapping.])
|
AC_DEFINE(DISABLE_WRAPPING, 1, [Define this to disable all text wrapping.])
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -2385,7 +2385,7 @@ char *real_dir_from_tilde(const char *buf)
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !defined(DISABLE_TABCOMP) || defined(ENABLE_BROWSER)
|
#if defined(ENABLE_TABCOMP) || defined(ENABLE_BROWSER)
|
||||||
/* Our sort routine for file listings. Sort alphabetically and
|
/* Our sort routine for file listings. Sort alphabetically and
|
||||||
* case-insensitively, and sort directories before filenames. */
|
* case-insensitively, and sort directories before filenames. */
|
||||||
int diralphasort(const void *va, const void *vb)
|
int diralphasort(const void *va, const void *vb)
|
||||||
|
@ -2422,7 +2422,7 @@ void free_chararray(char **array, size_t len)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef DISABLE_TABCOMP
|
#ifdef ENABLE_TABCOMP
|
||||||
/* Is the given path a directory? */
|
/* Is the given path a directory? */
|
||||||
bool is_dir(const char *buf)
|
bool is_dir(const char *buf)
|
||||||
{
|
{
|
||||||
|
@ -2746,7 +2746,7 @@ char *input_tab(char *buf, bool allow_files, size_t *place,
|
||||||
|
|
||||||
return buf;
|
return buf;
|
||||||
}
|
}
|
||||||
#endif /* !DISABLE_TABCOMP */
|
#endif /* ENABLE_TABCOMP */
|
||||||
|
|
||||||
/* Return the filename part of the given path. */
|
/* Return the filename part of the given path. */
|
||||||
const char *tail(const char *path)
|
const char *tail(const char *path)
|
||||||
|
|
|
@ -955,7 +955,7 @@ void version(void)
|
||||||
#ifndef DISABLE_SPELLER
|
#ifndef DISABLE_SPELLER
|
||||||
printf(" --enable-speller");
|
printf(" --enable-speller");
|
||||||
#endif
|
#endif
|
||||||
#ifndef DISABLE_TABCOMP
|
#ifdef ENABLE_TABCOMP
|
||||||
printf(" --enable-tabcomp");
|
printf(" --enable-tabcomp");
|
||||||
#endif
|
#endif
|
||||||
#ifndef DISABLE_WRAPPING
|
#ifndef DISABLE_WRAPPING
|
||||||
|
@ -1004,7 +1004,7 @@ void version(void)
|
||||||
#ifdef DISABLE_SPELLER
|
#ifdef DISABLE_SPELLER
|
||||||
printf(" --disable-speller");
|
printf(" --disable-speller");
|
||||||
#endif
|
#endif
|
||||||
#ifdef DISABLE_TABCOMP
|
#ifndef ENABLE_TABCOMP
|
||||||
printf(" --disable-tabcomp");
|
printf(" --disable-tabcomp");
|
||||||
#endif
|
#endif
|
||||||
#ifndef ENABLE_WORDCOMPLETION
|
#ifndef ENABLE_WORDCOMPLETION
|
||||||
|
|
12
src/prompt.c
12
src/prompt.c
|
@ -431,7 +431,7 @@ functionptrtype acquire_an_answer(int *actual, bool allow_tabs,
|
||||||
int kbinput = ERR;
|
int kbinput = ERR;
|
||||||
bool ran_func, finished;
|
bool ran_func, finished;
|
||||||
functionptrtype func;
|
functionptrtype func;
|
||||||
#ifndef DISABLE_TABCOMP
|
#ifdef ENABLE_TABCOMP
|
||||||
bool tabbed = FALSE;
|
bool tabbed = FALSE;
|
||||||
/* Whether we've pressed Tab. */
|
/* Whether we've pressed Tab. */
|
||||||
#endif
|
#endif
|
||||||
|
@ -441,7 +441,7 @@ functionptrtype acquire_an_answer(int *actual, bool allow_tabs,
|
||||||
char *magichistory = NULL;
|
char *magichistory = NULL;
|
||||||
/* The temporary string typed at the bottom of the history, if
|
/* The temporary string typed at the bottom of the history, if
|
||||||
* any. */
|
* any. */
|
||||||
#ifndef DISABLE_TABCOMP
|
#ifdef ENABLE_TABCOMP
|
||||||
int last_kbinput = ERR;
|
int last_kbinput = ERR;
|
||||||
/* The key we pressed before the current key. */
|
/* The key we pressed before the current key. */
|
||||||
size_t complete_len = 0;
|
size_t complete_len = 0;
|
||||||
|
@ -482,7 +482,7 @@ functionptrtype acquire_an_answer(int *actual, bool allow_tabs,
|
||||||
if (func == do_cancel || func == do_enter)
|
if (func == do_cancel || func == do_enter)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
#ifndef DISABLE_TABCOMP
|
#ifdef ENABLE_TABCOMP
|
||||||
if (func != do_tab)
|
if (func != do_tab)
|
||||||
tabbed = FALSE;
|
tabbed = FALSE;
|
||||||
|
|
||||||
|
@ -503,7 +503,7 @@ functionptrtype acquire_an_answer(int *actual, bool allow_tabs,
|
||||||
answer = input_tab(answer, allow_files, &statusbar_x,
|
answer = input_tab(answer, allow_files, &statusbar_x,
|
||||||
&tabbed, refresh_func, listed);
|
&tabbed, refresh_func, listed);
|
||||||
} else
|
} else
|
||||||
#endif /* !DISABLE_TABCOMP */
|
#endif /* ENABLE_TABCOMP */
|
||||||
#ifndef DISABLE_HISTORIES
|
#ifndef DISABLE_HISTORIES
|
||||||
if (func == get_history_older_void) {
|
if (func == get_history_older_void) {
|
||||||
if (history_list != NULL) {
|
if (history_list != NULL) {
|
||||||
|
@ -567,7 +567,7 @@ functionptrtype acquire_an_answer(int *actual, bool allow_tabs,
|
||||||
|
|
||||||
update_the_statusbar();
|
update_the_statusbar();
|
||||||
|
|
||||||
#if !defined(DISABLE_HISTORIES) && !defined(DISABLE_TABCOMP)
|
#if !defined(DISABLE_HISTORIES) && defined(ENABLE_TABCOMP)
|
||||||
last_kbinput = kbinput;
|
last_kbinput = kbinput;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -658,7 +658,7 @@ int do_prompt(bool allow_tabs, bool allow_files,
|
||||||
fprintf(stderr, "answer = \"%s\"\n", answer);
|
fprintf(stderr, "answer = \"%s\"\n", answer);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef DISABLE_TABCOMP
|
#ifdef ENABLE_TABCOMP
|
||||||
/* If we've done tab completion, there might still be a list of
|
/* If we've done tab completion, there might still be a list of
|
||||||
* filename matches on the edit window. Clear them off. */
|
* filename matches on the edit window. Clear them off. */
|
||||||
if (listed)
|
if (listed)
|
||||||
|
|
|
@ -304,11 +304,11 @@ void do_writeout_void(void);
|
||||||
void do_savefile(void);
|
void do_savefile(void);
|
||||||
#endif
|
#endif
|
||||||
char *real_dir_from_tilde(const char *buf);
|
char *real_dir_from_tilde(const char *buf);
|
||||||
#if !defined(DISABLE_TABCOMP) || defined(ENABLE_BROWSER)
|
#if defined(ENABLE_TABCOMP) || defined(ENABLE_BROWSER)
|
||||||
int diralphasort(const void *va, const void *vb);
|
int diralphasort(const void *va, const void *vb);
|
||||||
void free_chararray(char **array, size_t len);
|
void free_chararray(char **array, size_t len);
|
||||||
#endif
|
#endif
|
||||||
#ifndef DISABLE_TABCOMP
|
#ifdef ENABLE_TABCOMP
|
||||||
char *input_tab(char *buf, bool allow_files, size_t *place,
|
char *input_tab(char *buf, bool allow_files, size_t *place,
|
||||||
bool *lastwastab, void (*refresh_func)(void), bool *listed);
|
bool *lastwastab, void (*refresh_func)(void), bool *listed);
|
||||||
#endif
|
#endif
|
||||||
|
@ -496,7 +496,7 @@ void do_gotolinecolumn(ssize_t line, ssize_t column, bool use_answer,
|
||||||
void do_gotolinecolumn_void(void);
|
void do_gotolinecolumn_void(void);
|
||||||
#ifndef NANO_TINY
|
#ifndef NANO_TINY
|
||||||
void do_find_bracket(void);
|
void do_find_bracket(void);
|
||||||
#ifndef DISABLE_TABCOMP
|
#ifdef ENABLE_TABCOMP
|
||||||
char *get_history_completion(filestruct **h, char *s, size_t len);
|
char *get_history_completion(filestruct **h, char *s, size_t len);
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1224,7 +1224,7 @@ void get_history_older_void(void)
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef DISABLE_TABCOMP
|
#ifdef ENABLE_TABCOMP
|
||||||
/* Move h to the next string that's a tab completion of the string s,
|
/* Move h to the next string that's a tab completion of the string s,
|
||||||
* looking at only the first len characters of s, and return that
|
* looking at only the first len characters of s, and return that
|
||||||
* string. If there isn't one, or if len is 0, don't move h and return
|
* string. If there isn't one, or if len is 0, don't move h and return
|
||||||
|
@ -1277,5 +1277,5 @@ char *get_history_completion(filestruct **h, char *s, size_t len)
|
||||||
* match, or len is 0. Return s. */
|
* match, or len is 0. Return s. */
|
||||||
return (char *)s;
|
return (char *)s;
|
||||||
}
|
}
|
||||||
#endif /* !DISABLE_TABCOMP */
|
#endif /* ENSABLE_TABCOMP */
|
||||||
#endif /* !DISABLE_HISTORIES */
|
#endif /* !DISABLE_HISTORIES */
|
||||||
|
|
Loading…
Reference in New Issue