tweaks: transform the token DISABLE_WRAPJUSTIFY to ENABLED_WRAPORJUSTIFY

master
Benno Schulenberg 2017-10-31 17:39:30 +01:00
parent db0b849f9b
commit f034992ed6
6 changed files with 16 additions and 16 deletions

View File

@ -84,7 +84,7 @@ int altleft, altright, altup, altdown;
int shiftaltleft, shiftaltright, shiftaltup, shiftaltdown; int shiftaltleft, shiftaltright, shiftaltup, shiftaltdown;
#endif #endif
#ifndef DISABLE_WRAPJUSTIFY #ifdef ENABLED_WRAPORJUSTIFY
ssize_t fill = 0; ssize_t fill = 0;
/* The column where we will wrap lines. */ /* The column where we will wrap lines. */
ssize_t wrap_at = -CHARS_FROM_EOL; ssize_t wrap_at = -CHARS_FROM_EOL;

View File

@ -721,7 +721,7 @@ void window_init(void)
keypad(bottomwin, TRUE); keypad(bottomwin, TRUE);
} }
#ifndef DISABLE_WRAPJUSTIFY #ifdef ENABLED_WRAPORJUSTIFY
/* Set up the wrapping point, accounting for screen width when negative. */ /* Set up the wrapping point, accounting for screen width when negative. */
fill = wrap_at; fill = wrap_at;
if (fill <= 0) if (fill <= 0)
@ -885,7 +885,7 @@ void usage(void)
print_opt("-q", "--quiet", print_opt("-q", "--quiet",
N_("Silently ignore startup issues like rc file errors")); N_("Silently ignore startup issues like rc file errors"));
#endif #endif
#ifndef DISABLE_WRAPJUSTIFY #ifdef ENABLED_WRAPORJUSTIFY
print_opt(_("-r <#cols>"), _("--fill=<#cols>"), print_opt(_("-r <#cols>"), _("--fill=<#cols>"),
N_("Set hard-wrapping point at column #cols")); N_("Set hard-wrapping point at column #cols"));
#endif #endif
@ -1893,7 +1893,7 @@ void do_output(char *output, size_t output_len, bool allow_cntrls)
int main(int argc, char **argv) int main(int argc, char **argv)
{ {
int optchr; int optchr;
#ifndef DISABLE_WRAPJUSTIFY #ifdef ENABLED_WRAPORJUSTIFY
bool fill_used = FALSE; bool fill_used = FALSE;
/* Was the fill option used on the command line? */ /* Was the fill option used on the command line? */
#ifdef ENABLE_WRAPPING #ifdef ENABLE_WRAPPING
@ -1945,7 +1945,7 @@ int main(int argc, char **argv)
#endif #endif
{"preserve", 0, NULL, 'p'}, {"preserve", 0, NULL, 'p'},
{"quiet", 0, NULL, 'q'}, {"quiet", 0, NULL, 'q'},
#ifndef DISABLE_WRAPJUSTIFY #ifdef ENABLED_WRAPORJUSTIFY
{"fill", 1, NULL, 'r'}, {"fill", 1, NULL, 'r'},
#endif #endif
#ifndef DISABLE_SPELLER #ifndef DISABLE_SPELLER
@ -2170,7 +2170,7 @@ int main(int argc, char **argv)
SET(QUIET); SET(QUIET);
break; break;
#endif #endif
#ifndef DISABLE_WRAPJUSTIFY #ifdef ENABLED_WRAPORJUSTIFY
case 'r': case 'r':
if (!parse_num(optarg, &wrap_at)) { if (!parse_num(optarg, &wrap_at)) {
fprintf(stderr, _("Requested fill size \"%s\" is invalid"), optarg); fprintf(stderr, _("Requested fill size \"%s\" is invalid"), optarg);
@ -2255,7 +2255,7 @@ int main(int argc, char **argv)
#ifdef ENABLE_OPERATINGDIR #ifdef ENABLE_OPERATINGDIR
char *operating_dir_cpy = operating_dir; char *operating_dir_cpy = operating_dir;
#endif #endif
#ifndef DISABLE_WRAPJUSTIFY #ifdef ENABLED_WRAPORJUSTIFY
ssize_t wrap_at_cpy = wrap_at; ssize_t wrap_at_cpy = wrap_at;
#endif #endif
#ifndef NANO_TINY #ifndef NANO_TINY
@ -2302,7 +2302,7 @@ int main(int argc, char **argv)
operating_dir = operating_dir_cpy; operating_dir = operating_dir_cpy;
} }
#endif #endif
#ifndef DISABLE_WRAPJUSTIFY #ifdef ENABLED_WRAPORJUSTIFY
if (fill_used) if (fill_used)
wrap_at = wrap_at_cpy; wrap_at = wrap_at_cpy;
#endif #endif

View File

@ -128,8 +128,8 @@
#undef ENABLE_MOUSE #undef ENABLE_MOUSE
#endif #endif
#if !defined(ENABLE_WRAPPING) && !defined(ENABLE_JUSTIFY) #if defined(ENABLE_WRAPPING) || defined(ENABLE_JUSTIFY)
#define DISABLE_WRAPJUSTIFY 1 #define ENABLED_WRAPORJUSTIFY 1
#endif #endif
#define BACKWARD FALSE #define BACKWARD FALSE

View File

@ -83,7 +83,7 @@ extern int shiftaltup;
extern int shiftaltdown; extern int shiftaltdown;
#endif #endif
#ifndef DISABLE_WRAPJUSTIFY #ifdef ENABLED_WRAPORJUSTIFY
extern ssize_t fill; extern ssize_t fill;
extern ssize_t wrap_at; extern ssize_t wrap_at;
#endif #endif
@ -551,7 +551,7 @@ void update_undo(undo_type action);
void wrap_reset(void); void wrap_reset(void);
bool do_wrap(filestruct *line); bool do_wrap(filestruct *line);
#endif #endif
#if defined(ENABLE_HELP) || !defined(DISABLE_WRAPJUSTIFY) #if defined(ENABLE_HELP) || defined(ENABLED_WRAPORJUSTIFY)
ssize_t break_line(const char *line, ssize_t goal, bool snap_at_nl); ssize_t break_line(const char *line, ssize_t goal, bool snap_at_nl);
#endif #endif
#if !defined(NANO_TINY) || defined(ENABLE_JUSTIFY) #if !defined(NANO_TINY) || defined(ENABLE_JUSTIFY)

View File

@ -44,7 +44,7 @@ static const rcoption rcopts[] = {
#endif #endif
{"const", CONSTANT_SHOW}, /* deprecated form, remove in 2018 */ {"const", CONSTANT_SHOW}, /* deprecated form, remove in 2018 */
{"constantshow", CONSTANT_SHOW}, {"constantshow", CONSTANT_SHOW},
#ifndef DISABLE_WRAPJUSTIFY #ifdef ENABLED_WRAPORJUSTIFY
{"fill", 0}, {"fill", 0},
#endif #endif
#ifdef ENABLE_HISTORIES #ifdef ENABLE_HISTORIES
@ -1106,7 +1106,7 @@ void parse_rcfile(FILE *rcstream, bool syntax_only)
operating_dir = option; operating_dir = option;
else else
#endif #endif
#ifndef DISABLE_WRAPJUSTIFY #ifdef ENABLED_WRAPORJUSTIFY
if (strcasecmp(rcopts[i].name, "fill") == 0) { if (strcasecmp(rcopts[i].name, "fill") == 0) {
if (!parse_num(option, &wrap_at)) { if (!parse_num(option, &wrap_at)) {
rcfile_error(N_("Requested fill size \"%s\" is invalid"), rcfile_error(N_("Requested fill size \"%s\" is invalid"),

View File

@ -1668,7 +1668,7 @@ bool do_wrap(filestruct *line)
} }
#endif /* ENABLE_WRAPPING */ #endif /* ENABLE_WRAPPING */
#if defined(ENABLE_HELP) || !defined(DISABLE_WRAPJUSTIFY) #if defined(ENABLE_HELP) || defined(ENABLED_WRAPORJUSTIFY)
/* We are trying to break a chunk off line. We find the last blank such /* We are trying to break a chunk off line. We find the last blank such
* that the display length to there is at most (goal + 1). If there is * that the display length to there is at most (goal + 1). If there is
* no such blank, then we find the first blank. We then take the last * no such blank, then we find the first blank. We then take the last
@ -1740,7 +1740,7 @@ ssize_t break_line(const char *line, ssize_t goal, bool snap_at_nl)
return lastblank; return lastblank;
} }
#endif /* ENABLE_HELP || !DISABLE_WRAPJUSTIFY */ #endif /* ENABLE_HELP || ENABLED_WRAPORJUSTIFY */
#if !defined(NANO_TINY) || defined(ENABLE_JUSTIFY) #if !defined(NANO_TINY) || defined(ENABLE_JUSTIFY)
/* The "indentation" of a line is the whitespace between the quote part /* The "indentation" of a line is the whitespace between the quote part