Converting #ifdef ENABLE_NANORC to #ifndef DISABLE_NANORC.

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4765 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
master
Benno Schulenberg 2014-04-13 20:50:20 +00:00
parent b988132343
commit eea0908236
14 changed files with 70 additions and 62 deletions

View File

@ -9,6 +9,8 @@
* configure.ac, doc/texinfo/nano.texi: Make --enable-tiny disable * configure.ac, doc/texinfo/nano.texi: Make --enable-tiny disable
the use of libmagic, and document the --disable-libmagic flag. the use of libmagic, and document the --disable-libmagic flag.
* src/nano.c (version): Print the correct --enable/--disable option. * src/nano.c (version): Print the correct --enable/--disable option.
* configure.ac, src/*, doc/texinfo/nano.texi: Convert all occurrences
of #ifdef ENABLE_NANORC to #ifndef DISABLE_NANORC, and adapt for it.
2014-04-10 Benno Schulenberg <bensberg@justemail.net> 2014-04-10 Benno Schulenberg <bensberg@justemail.net>
* doc/syntax/Makefile.am: Add four recent syntaxes to the packlist. * doc/syntax/Makefile.am: Add four recent syntaxes to the packlist.

View File

@ -121,8 +121,9 @@ fi
AC_ARG_ENABLE(nanorc, AC_ARG_ENABLE(nanorc,
AS_HELP_STRING([--disable-nanorc], [Disable use of .nanorc files])) AS_HELP_STRING([--disable-nanorc], [Disable use of .nanorc files]))
if test "x$enable_nanorc" != xno; then if test "x$enable_nanorc" = xno; then
AC_DEFINE(ENABLE_NANORC, 1, [Define this to use .nanorc files.]) AC_DEFINE(DISABLE_NANORC, 1, [Define this to disable the use of .nanorc files.])
else
nanorc_support=yes nanorc_support=yes
fi fi
@ -193,6 +194,9 @@ if test "x$enable_tiny" = xyes; then
if test "x$enable_multibuffer" != xyes; then if test "x$enable_multibuffer" != xyes; then
AC_DEFINE(DISABLE_MULTIBUFFER, 1, [Define this to disable multiple file buffers.]) AC_DEFINE(DISABLE_MULTIBUFFER, 1, [Define this to disable multiple file buffers.])
fi fi
if test "x$enable_nanorc" != xyes; then
AC_DEFINE(DISABLE_NANORC, 1, [Define this to disable the use of .nanorc files.])
fi
if test "x$enable_operatingdir" != xyes; then if test "x$enable_operatingdir" != xyes; then
AC_DEFINE(DISABLE_OPERATINGDIR, 1, [Define this to disable the setting of the operating directory (chroot of sorts).]) AC_DEFINE(DISABLE_OPERATINGDIR, 1, [Define this to disable the setting of the operating directory (chroot of sorts).])
fi fi

View File

@ -872,6 +872,12 @@ command-line option, which enables the mouse functionality.
Disable support for opening multiple files at a time and switching Disable support for opening multiple files at a time and switching
between them on the fly. between them on the fly.
@item --disable-nanorc
Disable support for reading the nanorc files at startup. With such
support, you can store custom settings in a system-wide and a per-user
nanorc file rather than having to pass command-line options to get
the desired behavior. See @xref{Nanorc Files}, for more info.
@item --disable-operatingdir @item --disable-operatingdir
Disable setting the operating directory. This also eliminates the -o Disable setting the operating directory. This also eliminates the -o
command-line option, which sets the operating directory. command-line option, which sets the operating directory.
@ -896,12 +902,6 @@ code. It also disables the function toggles.
Enable support for runtime debug output. This can get pretty messy, so Enable support for runtime debug output. This can get pretty messy, so
chances are you only want this feature when you're working on the nano source. chances are you only want this feature when you're working on the nano source.
@item --enable-nanorc
Enable support for reading the nanorc file at startup. You can store
custom settings in the nanorc file rather than having to pass command
line options to get desired behavior. See @xref{Nanorc Files}, for
more info.
@item --disable-nls @item --disable-nls
Disables Native Language support. This will disable use of the Disables Native Language support. This will disable use of the
available GNU @code{nano} translations. available GNU @code{nano} translations.

View File

@ -891,7 +891,7 @@ char *mbrevstrpbrk(const char *s, const char *accept, const char
} }
#endif /* !NANO_TINY */ #endif /* !NANO_TINY */
#if defined(ENABLE_NANORC) && (!defined(NANO_TINY) || !defined(DISABLE_JUSTIFY)) #if !defined(DISABLE_NANORC) && (!defined(NANO_TINY) || !defined(DISABLE_JUSTIFY))
/* Return TRUE if the string s contains one or more blank characters, /* Return TRUE if the string s contains one or more blank characters,
* and FALSE otherwise. */ * and FALSE otherwise. */
bool has_blank_chars(const char *s) bool has_blank_chars(const char *s)
@ -933,7 +933,7 @@ bool has_blank_mbchars(const char *s)
#endif #endif
return has_blank_chars(s); return has_blank_chars(s);
} }
#endif /* ENABLE_NANORC && (!NANO_TINY || !DISABLE_JUSTIFY) */ #endif /* !DISABLE_NANORC && (!NANO_TINY || !DISABLE_JUSTIFY) */
#ifdef ENABLE_UTF8 #ifdef ENABLE_UTF8
/* Return TRUE if wc is valid Unicode, and FALSE otherwise. */ /* Return TRUE if wc is valid Unicode, and FALSE otherwise. */
@ -945,7 +945,7 @@ bool is_valid_unicode(wchar_t wc)
} }
#endif #endif
#ifdef ENABLE_NANORC #ifndef DISABLE_NANORC
/* Check if the string s is a valid multibyte string. Return TRUE if it /* Check if the string s is a valid multibyte string. Return TRUE if it
* is, and FALSE otherwise. */ * is, and FALSE otherwise. */
bool is_valid_mbstring(const char *s) bool is_valid_mbstring(const char *s)
@ -958,4 +958,4 @@ bool is_valid_mbstring(const char *s)
#endif #endif
TRUE; TRUE;
} }
#endif /* ENABLE_NANORC */ #endif /* !DISABLE_NANORC */

View File

@ -475,7 +475,7 @@ bool close_buffer(void)
if (openfile == openfile->next) if (openfile == openfile->next)
return FALSE; return FALSE;
#if !defined(NANO_TINY) && defined(ENABLE_NANORC) #if !defined(NANO_TINY) && !defined(DISABLE_NANORC)
update_poshistory(openfile->filename, openfile->current->lineno, xplustabs()+1); update_poshistory(openfile->filename, openfile->current->lineno, xplustabs()+1);
#endif #endif
@ -1185,7 +1185,7 @@ void do_insertfile(
} }
#endif #endif
#if !defined(DISABLE_MULTIBUFFER) && defined(ENABLE_NANORC) #if !defined(DISABLE_MULTIBUFFER) && !defined(DISABLE_NANORC)
if (ISSET(MULTIBUFFER)) { if (ISSET(MULTIBUFFER)) {
/* Update the screen to account for the current /* Update the screen to account for the current
* buffer. */ * buffer. */
@ -2891,7 +2891,7 @@ const char *tail(const char *foo)
return tmp; return tmp;
} }
#if !defined(NANO_TINY) && defined(ENABLE_NANORC) #if !defined(NANO_TINY) && !defined(DISABLE_NANORC)
/* Return the constructed dorfile path, or NULL if we can't find the home /* Return the constructed dorfile path, or NULL if we can't find the home
* directory. The string is dynamically allocated, and should be * directory. The string is dynamically allocated, and should be
* freed. */ * freed. */
@ -2939,7 +2939,6 @@ void history_error(const char *msg, ...)
fprintf(stderr, _("\nPress Enter to continue\n")); fprintf(stderr, _("\nPress Enter to continue\n"));
while (getchar() != '\n') while (getchar() != '\n')
; ;
} }
/* Now that we have more than one history file, let's just rely on a /* Now that we have more than one history file, let's just rely on a
@ -3158,7 +3157,7 @@ int check_poshistory(const char *file, ssize_t *line, ssize_t *column)
char *fullpath = get_full_path(file); char *fullpath = get_full_path(file);
if (fullpath == NULL) if (fullpath == NULL)
return 0; return 0;
for (posptr = poshistory; posptr != NULL; posptr = posptr->next) { for (posptr = poshistory; posptr != NULL; posptr = posptr->next) {
if (!strcmp(posptr->filename, fullpath)) { if (!strcmp(posptr->filename, fullpath)) {
@ -3232,4 +3231,4 @@ void load_poshistory(void)
} }
} }
#endif /* !NANO_TINY && ENABLE_NANORC */ #endif /* !NANO_TINY && !DISABLE_NANORC */

View File

@ -88,7 +88,7 @@ char *matchbrackets = NULL;
* searches. */ * searches. */
#endif #endif
#if !defined(NANO_TINY) && defined(ENABLE_NANORC) #if !defined(NANO_TINY) && !defined(DISABLE_NANORC)
char *whitespace = NULL; char *whitespace = NULL;
/* The characters used when displaying the first characters of /* The characters used when displaying the first characters of
* tabs and spaces. */ * tabs and spaces. */
@ -1593,7 +1593,7 @@ sc *strtosc(char *input)
return s; return s;
} }
#ifdef ENABLE_NANORC #ifndef DISABLE_NANORC
/* Same thing as above but for the menu. */ /* Same thing as above but for the menu. */
int strtomenu(char *input) int strtomenu(char *input)
{ {
@ -1729,7 +1729,7 @@ void thanks_for_all_the_fish(void)
if (replaceage != NULL) if (replaceage != NULL)
free_filestruct(replaceage); free_filestruct(replaceage);
#endif #endif
#ifdef ENABLE_NANORC #ifndef DISABLE_NANORC
if (homedir != NULL) if (homedir != NULL)
free(homedir); free(homedir);
#endif #endif

View File

@ -216,7 +216,7 @@ void help_init(void)
int scsfound = 0; int scsfound = 0;
#ifndef NANO_TINY #ifndef NANO_TINY
#ifdef ENABLE_NANORC #ifndef DISABLE_NANORC
bool old_whitespace = ISSET(WHITESPACE_DISPLAY); bool old_whitespace = ISSET(WHITESPACE_DISPLAY);
UNSET(WHITESPACE_DISPLAY); UNSET(WHITESPACE_DISPLAY);
@ -474,7 +474,7 @@ void help_init(void)
ptr += sprintf(ptr, "(%s)\t\t\t%s %s\n", ptr += sprintf(ptr, "(%s)\t\t\t%s %s\n",
s->keystr, _(flagtostr(s->toggle)), _("enable/disable")); s->keystr, _(flagtostr(s->toggle)), _("enable/disable"));
#ifdef ENABLE_NANORC #ifndef DISABLE_NANORC
if (old_whitespace) if (old_whitespace)
SET(WHITESPACE_DISPLAY); SET(WHITESPACE_DISPLAY);
#endif #endif

View File

@ -48,7 +48,7 @@
static int oldinterval = -1; static int oldinterval = -1;
/* Used to store the user's original mouse click interval. */ /* Used to store the user's original mouse click interval. */
#endif #endif
#ifdef ENABLE_NANORC #ifndef DISABLE_NANORC
static bool no_rcfiles = FALSE; static bool no_rcfiles = FALSE;
/* Should we ignore all rcfiles? */ /* Should we ignore all rcfiles? */
#endif #endif
@ -613,7 +613,7 @@ void finish(void)
/* Restore the old terminal settings. */ /* Restore the old terminal settings. */
tcsetattr(0, TCSANOW, &oldterm); tcsetattr(0, TCSANOW, &oldterm);
#if !defined(NANO_TINY) && defined(ENABLE_NANORC) #if !defined(NANO_TINY) && !defined(DISABLE_NANORC)
if (!no_rcfiles && ISSET(HISTORYLOG)) if (!no_rcfiles && ISSET(HISTORYLOG))
save_history(); save_history();
if (!no_rcfiles && ISSET(POS_HISTORY)) { if (!no_rcfiles && ISSET(POS_HISTORY)) {
@ -856,7 +856,7 @@ void usage(void)
#ifndef DISABLE_MULTIBUFFER #ifndef DISABLE_MULTIBUFFER
print_opt("-F", "--multibuffer", N_("Enable multiple file buffers")); print_opt("-F", "--multibuffer", N_("Enable multiple file buffers"));
#endif #endif
#ifdef ENABLE_NANORC #ifndef DISABLE_NANORC
#ifndef NANO_TINY #ifndef NANO_TINY
print_opt("-G", "--locking", print_opt("-G", "--locking",
N_("Use (vim-style) lock files")); N_("Use (vim-style) lock files"));
@ -992,6 +992,9 @@ void version(void)
#ifndef DISABLE_MOUSE #ifndef DISABLE_MOUSE
printf(" --enable-mouse"); printf(" --enable-mouse");
#endif #endif
#ifndef DISABLE_NANORC
printf(" --enable-nanorc");
#endif
#ifndef DISABLE_MULTIBUFFER #ifndef DISABLE_MULTIBUFFER
printf(" --enable-multibuffer"); printf(" --enable-multibuffer");
#endif #endif
@ -1032,6 +1035,9 @@ void version(void)
#ifdef DISABLE_MULTIBUFFER #ifdef DISABLE_MULTIBUFFER
printf(" --disable-multibuffer"); printf(" --disable-multibuffer");
#endif #endif
#ifdef DISABLE_NANORC
printf(" --disable-nanorc");
#endif
#ifdef DISABLE_OPERATINGDIR #ifdef DISABLE_OPERATINGDIR
printf(" --disable-operatingdir"); printf(" --disable-operatingdir");
#endif #endif
@ -1052,9 +1058,6 @@ void version(void)
#ifdef DEBUG #ifdef DEBUG
printf(" --enable-debug"); printf(" --enable-debug");
#endif #endif
#ifdef ENABLE_NANORC
printf(" --enable-nanorc");
#endif
#ifndef ENABLE_NLS #ifndef ENABLE_NLS
printf(" --disable-nls"); printf(" --disable-nls");
#endif #endif
@ -1428,7 +1431,7 @@ void do_toggle(int flag)
case SUSPEND: case SUSPEND:
signal_init(); signal_init();
break; break;
#ifdef ENABLE_NANORC #ifndef DISABLE_NANORC
case WHITESPACE_DISPLAY: case WHITESPACE_DISPLAY:
titlebar(NULL); titlebar(NULL);
edit_refresh(); edit_refresh();
@ -2107,7 +2110,7 @@ int main(int argc, char **argv)
#ifndef DISABLE_MULTIBUFFER #ifndef DISABLE_MULTIBUFFER
{"multibuffer", 0, NULL, 'F'}, {"multibuffer", 0, NULL, 'F'},
#endif #endif
#ifdef ENABLE_NANORC #ifndef DISABLE_NANORC
{"ignorercfiles", 0, NULL, 'I'}, {"ignorercfiles", 0, NULL, 'I'},
#endif #endif
{"rebindkeypad", 0, NULL, 'K'}, {"rebindkeypad", 0, NULL, 'K'},
@ -2191,7 +2194,7 @@ int main(int argc, char **argv)
textdomain(PACKAGE); textdomain(PACKAGE);
#endif #endif
#if !defined(ENABLE_NANORC) && defined(DISABLE_ROOTWRAPPING) #if defined(DISABLE_NANORC) && defined(DISABLE_ROOTWRAPPING)
/* If we don't have rcfile support, --disable-wrapping-as-root is /* If we don't have rcfile support, --disable-wrapping-as-root is
* used, and we're root, turn wrapping off. */ * used, and we're root, turn wrapping off. */
if (geteuid() == NANO_ROOT_UID) if (geteuid() == NANO_ROOT_UID)
@ -2241,7 +2244,7 @@ int main(int argc, char **argv)
SET(MULTIBUFFER); SET(MULTIBUFFER);
break; break;
#endif #endif
#ifdef ENABLE_NANORC #ifndef DISABLE_NANORC
#ifndef NANO_TINY #ifndef NANO_TINY
case 'G': case 'G':
SET(LOCKING); SET(LOCKING);
@ -2408,7 +2411,7 @@ int main(int argc, char **argv)
if (ISSET(RESTRICTED)) { if (ISSET(RESTRICTED)) {
UNSET(SUSPEND); UNSET(SUSPEND);
UNSET(BACKUP_FILE); UNSET(BACKUP_FILE);
#ifdef ENABLE_NANORC #ifndef DISABLE_NANORC
no_rcfiles = TRUE; no_rcfiles = TRUE;
#endif #endif
} }
@ -2420,7 +2423,7 @@ int main(int argc, char **argv)
/* We've read through the command line options. Now back up the flags /* We've read through the command line options. Now back up the flags
* and values that are set, and read the rcfile(s). If the values * and values that are set, and read the rcfile(s). If the values
* haven't changed afterward, restore the backed-up values. */ * haven't changed afterward, restore the backed-up values. */
#ifdef ENABLE_NANORC #ifndef DISABLE_NANORC
if (!no_rcfiles) { if (!no_rcfiles) {
#ifndef DISABLE_OPERATINGDIR #ifndef DISABLE_OPERATINGDIR
char *operating_dir_cpy = operating_dir; char *operating_dir_cpy = operating_dir;
@ -2503,7 +2506,7 @@ int main(int argc, char **argv)
else if (geteuid() == NANO_ROOT_UID) else if (geteuid() == NANO_ROOT_UID)
SET(NO_WRAP); SET(NO_WRAP);
#endif #endif
#endif /* ENABLE_NANORC */ #endif /* !DISABLE_NANORC */
#ifndef DISABLE_WRAPPING #ifndef DISABLE_WRAPPING
/* Overwrite an rcfile "set nowrap" or --disable-wrapping-as-root /* Overwrite an rcfile "set nowrap" or --disable-wrapping-as-root
@ -2520,7 +2523,7 @@ int main(int argc, char **argv)
#ifndef NANO_TINY #ifndef NANO_TINY
/* Set up the search/replace history. */ /* Set up the search/replace history. */
history_init(); history_init();
#ifdef ENABLE_NANORC #ifndef DISABLE_NANORC
if (!no_rcfiles) { if (!no_rcfiles) {
if (ISSET(HISTORYLOG) || ISSET(POS_HISTORY)) { if (ISSET(HISTORYLOG) || ISSET(POS_HISTORY)) {
if (check_dotnano() == 0) { if (check_dotnano() == 0) {
@ -2533,7 +2536,7 @@ int main(int argc, char **argv)
if (ISSET(POS_HISTORY)) if (ISSET(POS_HISTORY))
load_poshistory(); load_poshistory();
} }
#endif /* ENABLE_NANORC */ #endif /* !DISABLE_NANORC */
/* Set up the backup directory (unless we're using restricted mode, /* Set up the backup directory (unless we're using restricted mode,
* in which case backups are disabled, since they would allow * in which case backups are disabled, since they would allow
@ -2604,7 +2607,7 @@ int main(int argc, char **argv)
if (matchbrackets == NULL) if (matchbrackets == NULL)
matchbrackets = mallocstrcpy(NULL, "(<[{)>]}"); matchbrackets = mallocstrcpy(NULL, "(<[{)>]}");
#ifdef ENABLE_NANORC #ifndef DISABLE_NANORC
/* If whitespace wasn't specified, set its default value. If we're /* If whitespace wasn't specified, set its default value. If we're
* using UTF-8, it's Unicode 00BB (Right-Pointing Double Angle * using UTF-8, it's Unicode 00BB (Right-Pointing Double Angle
* Quotation Mark) and Unicode 00B7 (Middle Dot). Otherwise, it's * Quotation Mark) and Unicode 00B7 (Middle Dot). Otherwise, it's
@ -2623,7 +2626,7 @@ int main(int argc, char **argv)
whitespace_len[1] = 1; whitespace_len[1] = 1;
} }
} }
#endif /* ENABLE_NANORC */ #endif /* !DISABLE_NANORC */
#endif /* !NANO_TINY */ #endif /* !NANO_TINY */
/* If tabsize wasn't specified, set its default value. */ /* If tabsize wasn't specified, set its default value. */
@ -2703,7 +2706,7 @@ int main(int argc, char **argv)
iline = 1; iline = 1;
icol = 1; icol = 1;
} }
#if !defined(NANO_TINY) && defined(ENABLE_NANORC) #if !defined(NANO_TINY) && !defined(DISABLE_NANORC)
else { else {
/* See if we have a POS history to use if we haven't overridden it. */ /* See if we have a POS history to use if we haven't overridden it. */
ssize_t savedposline, savedposcol; ssize_t savedposline, savedposcol;
@ -2750,7 +2753,7 @@ int main(int argc, char **argv)
if (startline > 1 || startcol > 1) if (startline > 1 || startcol > 1)
do_gotolinecolumn(startline, startcol, FALSE, FALSE, FALSE, do_gotolinecolumn(startline, startcol, FALSE, FALSE, FALSE,
FALSE); FALSE);
#if !defined(NANO_TINY) && defined(ENABLE_NANORC) #if !defined(NANO_TINY) && !defined(DISABLE_NANORC)
else { else {
/* See if we have a POS history to use if we haven't overridden it. */ /* See if we have a POS history to use if we haven't overridden it. */
ssize_t savedposline, savedposcol; ssize_t savedposline, savedposcol;

View File

@ -438,7 +438,7 @@ typedef struct shortcut {
/* Next shortcut. */ /* Next shortcut. */
} shortcut; } shortcut;
#ifdef ENABLE_NANORC #ifndef DISABLE_NANORC
typedef struct rcoption { typedef struct rcoption {
const char *name; const char *name;
/* The name of the rcfile option. */ /* The name of the rcfile option. */

View File

@ -60,7 +60,7 @@ extern openfilestruct *openfile;
extern char *matchbrackets; extern char *matchbrackets;
#endif #endif
#if !defined(NANO_TINY) && defined(ENABLE_NANORC) #if !defined(NANO_TINY) && !defined(DISABLE_NANORC)
extern char *whitespace; extern char *whitespace;
extern int whitespace_len[2]; extern int whitespace_len[2];
extern undo_type last_action; extern undo_type last_action;
@ -221,14 +221,14 @@ char *revstrpbrk(const char *s, const char *accept, const char
char *mbrevstrpbrk(const char *s, const char *accept, const char char *mbrevstrpbrk(const char *s, const char *accept, const char
*rev_start); *rev_start);
#endif #endif
#if defined(ENABLE_NANORC) && (!defined(NANO_TINY) || !defined(DISABLE_JUSTIFY)) #if !defined(DISABLE_NANORC) && (!defined(NANO_TINY) || !defined(DISABLE_JUSTIFY))
bool has_blank_chars(const char *s); bool has_blank_chars(const char *s);
bool has_blank_mbchars(const char *s); bool has_blank_mbchars(const char *s);
#endif #endif
#ifdef ENABLE_UTF8 #ifdef ENABLE_UTF8
bool is_valid_unicode(wchar_t wc); bool is_valid_unicode(wchar_t wc);
#endif #endif
#ifdef ENABLE_NANORC #ifndef DISABLE_NANORC
bool is_valid_mbstring(const char *s); bool is_valid_mbstring(const char *s);
#endif #endif
@ -325,7 +325,7 @@ char *input_tab(char *buf, bool allow_files, size_t *place, bool
*lastwastab, void (*refresh_func)(void), bool *list); *lastwastab, void (*refresh_func)(void), bool *list);
#endif #endif
const char *tail(const char *foo); const char *tail(const char *foo);
#if !defined(NANO_TINY) && defined(ENABLE_NANORC) #if !defined(NANO_TINY) && !defined(DISABLE_NANORC)
char *histfilename(void); char *histfilename(void);
void load_history(void); void load_history(void);
bool writehist(FILE *hist, filestruct *histhead); bool writehist(FILE *hist, filestruct *histhead);
@ -551,7 +551,7 @@ void do_prompt_abort(void);
int do_yesno_prompt(bool all, const char *msg); int do_yesno_prompt(bool all, const char *msg);
/* All functions in rcfile.c. */ /* All functions in rcfile.c. */
#ifdef ENABLE_NANORC #ifndef DISABLE_NANORC
void rcfile_error(const char *msg, ...); void rcfile_error(const char *msg, ...);
char *parse_next_word(char *ptr); char *parse_next_word(char *ptr);
char *parse_argument(char *ptr); char *parse_argument(char *ptr);
@ -615,7 +615,7 @@ void do_gotopos(ssize_t pos_line, size_t pos_x, ssize_t pos_y, size_t
#ifndef NANO_TINY #ifndef NANO_TINY
bool find_bracket_match(bool reverse, const char *bracket_set); bool find_bracket_match(bool reverse, const char *bracket_set);
void do_find_bracket(void); void do_find_bracket(void);
#ifdef ENABLE_NANORC #ifndef DISABLE_NANORC
bool history_has_changed(void); bool history_has_changed(void);
#endif #endif
void history_init(void); void history_init(void);
@ -701,7 +701,7 @@ void align(char **str);
void null_at(char **data, size_t index); void null_at(char **data, size_t index);
void unsunder(char *str, size_t true_len); void unsunder(char *str, size_t true_len);
void sunder(char *str); void sunder(char *str);
#if !defined(NANO_TINY) && defined(ENABLE_NANORC) #if !defined(NANO_TINY) && !defined(DISABLE_NANORC)
#ifndef HAVE_GETLINE #ifndef HAVE_GETLINE
ssize_t ngetline(char **lineptr, size_t *n, FILE *stream); ssize_t ngetline(char **lineptr, size_t *n, FILE *stream);
#endif #endif

View File

@ -31,7 +31,7 @@
#include <unistd.h> #include <unistd.h>
#include <ctype.h> #include <ctype.h>
#ifdef ENABLE_NANORC #ifndef DISABLE_NANORC
static const rcoption rcopts[] = { static const rcoption rcopts[] = {
{"boldtext", BOLD_TEXT}, {"boldtext", BOLD_TEXT},
@ -1356,4 +1356,4 @@ void do_rcfile(void)
#endif #endif
} }
#endif /* ENABLE_NANORC */ #endif /* !DISABLE_NANORC */

View File

@ -32,7 +32,7 @@
static bool search_last_line = FALSE; static bool search_last_line = FALSE;
/* Have we gone past the last line while searching? */ /* Have we gone past the last line while searching? */
#if !defined(NANO_TINY) && defined(ENABLE_NANORC) #if !defined(NANO_TINY) && !defined(DISABLE_NANORC)
static bool history_changed = FALSE; static bool history_changed = FALSE;
/* Have any of the history lists changed? */ /* Have any of the history lists changed? */
#endif #endif
@ -1292,7 +1292,7 @@ void do_find_bracket(void)
free(found_ch); free(found_ch);
} }
#ifdef ENABLE_NANORC #ifndef DISABLE_NANORC
/* Indicate whether any of the history lists have changed. */ /* Indicate whether any of the history lists have changed. */
bool history_has_changed(void) bool history_has_changed(void)
{ {
@ -1395,7 +1395,7 @@ void update_history(filestruct **h, const char *s)
*hbot = (*hbot)->next; *hbot = (*hbot)->next;
(*hbot)->data = mallocstrcpy(NULL, ""); (*hbot)->data = mallocstrcpy(NULL, "");
#ifdef ENABLE_NANORC #ifndef DISABLE_NANORC
/* Indicate that the history's been changed. */ /* Indicate that the history's been changed. */
history_changed = TRUE; history_changed = TRUE;
#endif #endif

View File

@ -187,7 +187,7 @@ void sunder(char *str)
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301, USA. */ * 02110-1301, USA. */
#ifdef ENABLE_NANORC #ifndef DISABLE_NANORC
#ifndef HAVE_GETDELIM #ifndef HAVE_GETDELIM
/* This function is equivalent to getdelim(). */ /* This function is equivalent to getdelim(). */
@ -247,7 +247,7 @@ ssize_t ngetline(char **lineptr, size_t *n, FILE *stream)
return getdelim(lineptr, n, '\n', stream); return getdelim(lineptr, n, '\n', stream);
} }
#endif #endif
#endif /* ENABLE_NANORC */ #endif /* !DISABLE_NANORC */
#ifdef HAVE_REGEX_H #ifdef HAVE_REGEX_H
/* Do the compiled regex in preg and the regex in string match the /* Do the compiled regex in preg and the regex in string match the

View File

@ -1995,7 +1995,7 @@ char *display_string(const char *buf, size_t start_col, size_t len, bool
/* If buf contains a tab character, interpret it. */ /* If buf contains a tab character, interpret it. */
if (*buf_mb == '\t') { if (*buf_mb == '\t') {
#if !defined(NANO_TINY) && defined(ENABLE_NANORC) #if !defined(NANO_TINY) && !defined(DISABLE_NANORC)
if (ISSET(WHITESPACE_DISPLAY)) { if (ISSET(WHITESPACE_DISPLAY)) {
int i; int i;
@ -2030,7 +2030,7 @@ char *display_string(const char *buf, size_t start_col, size_t len, bool
free(ctrl_buf_mb); free(ctrl_buf_mb);
/* If buf contains a space character, interpret it. */ /* If buf contains a space character, interpret it. */
} else if (*buf_mb == ' ') { } else if (*buf_mb == ' ') {
#if !defined(NANO_TINY) && defined(ENABLE_NANORC) #if !defined(NANO_TINY) && !defined(DISABLE_NANORC)
if (ISSET(WHITESPACE_DISPLAY)) { if (ISSET(WHITESPACE_DISPLAY)) {
int i; int i;
@ -2278,7 +2278,7 @@ void statusbar(const char *msg, ...)
va_list ap; va_list ap;
char *bar, *foo; char *bar, *foo;
size_t start_x, foo_len; size_t start_x, foo_len;
#if !defined(NANO_TINY) && defined(ENABLE_NANORC) #if !defined(NANO_TINY) && !defined(DISABLE_NANORC)
bool old_whitespace; bool old_whitespace;
#endif #endif
@ -2294,7 +2294,7 @@ void statusbar(const char *msg, ...)
blank_statusbar(); blank_statusbar();
#if !defined(NANO_TINY) && defined(ENABLE_NANORC) #if !defined(NANO_TINY) && !defined(DISABLE_NANORC)
old_whitespace = ISSET(WHITESPACE_DISPLAY); old_whitespace = ISSET(WHITESPACE_DISPLAY);
UNSET(WHITESPACE_DISPLAY); UNSET(WHITESPACE_DISPLAY);
#endif #endif
@ -2302,7 +2302,7 @@ void statusbar(const char *msg, ...)
vsnprintf(bar, mb_cur_max() * (COLS - 3), msg, ap); vsnprintf(bar, mb_cur_max() * (COLS - 3), msg, ap);
va_end(ap); va_end(ap);
foo = display_string(bar, 0, COLS - 4, FALSE); foo = display_string(bar, 0, COLS - 4, FALSE);
#if !defined(NANO_TINY) && defined(ENABLE_NANORC) #if !defined(NANO_TINY) && !defined(DISABLE_NANORC)
if (old_whitespace) if (old_whitespace)
SET(WHITESPACE_DISPLAY); SET(WHITESPACE_DISPLAY);
#endif #endif