tweaks: transform the token DISABLE_JUSTIFY to ENABLE_JUSTIFY
Этот коммит содержится в:
родитель
c4d2a92d4c
Коммит
db0b849f9b
12
configure.ac
12
configure.ac
@ -144,8 +144,13 @@ fi
|
|||||||
|
|
||||||
AC_ARG_ENABLE(justify,
|
AC_ARG_ENABLE(justify,
|
||||||
AS_HELP_STRING([--disable-justify], [Disable the justify/unjustify functions]))
|
AS_HELP_STRING([--disable-justify], [Disable the justify/unjustify functions]))
|
||||||
if test "x$enable_justify" = xno; then
|
if test "x$enable_tiny" = xyes; then
|
||||||
AC_DEFINE(DISABLE_JUSTIFY, 1, [Define this to disable the justify routines.])
|
if test "x$enable_justify" != xyes; then
|
||||||
|
enable_justify=no
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
if test "x$enable_justify" != xno; then
|
||||||
|
AC_DEFINE(ENABLE_JUSTIFY, 1, [Define this to have the routines for justifying.])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
AC_ARG_ENABLE(libmagic,
|
AC_ARG_ENABLE(libmagic,
|
||||||
@ -277,9 +282,6 @@ if test "x$enable_tiny" = xyes; then
|
|||||||
if test "x$enable_extra" != xyes; then
|
if test "x$enable_extra" != xyes; then
|
||||||
AC_DEFINE(DISABLE_EXTRA, 1, [Define this to disable extra stuff.])
|
AC_DEFINE(DISABLE_EXTRA, 1, [Define this to disable extra stuff.])
|
||||||
fi
|
fi
|
||||||
if test "x$enable_justify" != xyes; then
|
|
||||||
AC_DEFINE(DISABLE_JUSTIFY, 1, [Define this to disable the justify routines.])
|
|
||||||
fi
|
|
||||||
if test "x$enable_libmagic" != xyes; then
|
if test "x$enable_libmagic" != xyes; then
|
||||||
enable_libmagic=no
|
enable_libmagic=no
|
||||||
fi
|
fi
|
||||||
|
@ -579,7 +579,7 @@ size_t mbstrnlen(const char *s, size_t maxlen)
|
|||||||
return strnlen(s, maxlen);
|
return strnlen(s, maxlen);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !defined(NANO_TINY) || !defined(DISABLE_JUSTIFY)
|
#if !defined(NANO_TINY) || defined(ENABLE_JUSTIFY)
|
||||||
/* This function is equivalent to strchr() for multibyte strings. */
|
/* This function is equivalent to strchr() for multibyte strings. */
|
||||||
char *mbstrchr(const char *s, const char *c)
|
char *mbstrchr(const char *s, const char *c)
|
||||||
{
|
{
|
||||||
@ -620,7 +620,7 @@ char *mbstrchr(const char *s, const char *c)
|
|||||||
#endif
|
#endif
|
||||||
return (char *) strchr(s, *c);
|
return (char *) strchr(s, *c);
|
||||||
}
|
}
|
||||||
#endif /* !NANO_TINY || !DISABLE_JUSTIFY */
|
#endif /* !NANO_TINY || ENABLE_JUSTIFY */
|
||||||
|
|
||||||
#ifndef NANO_TINY
|
#ifndef NANO_TINY
|
||||||
/* This function is equivalent to strpbrk() for multibyte strings. */
|
/* This function is equivalent to strpbrk() for multibyte strings. */
|
||||||
@ -686,7 +686,7 @@ char *mbrevstrpbrk(const char *head, const char *accept, const char *pointer)
|
|||||||
}
|
}
|
||||||
#endif /* !NANO_TINY */
|
#endif /* !NANO_TINY */
|
||||||
|
|
||||||
#if defined(ENABLE_NANORC) && (!defined(NANO_TINY) || !defined(DISABLE_JUSTIFY))
|
#if defined(ENABLE_NANORC) && (!defined(NANO_TINY) || defined(ENABLE_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)
|
||||||
@ -719,7 +719,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 /* ENABLE_NANORC && (!NANO_TINY || ENABLE_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. */
|
||||||
|
46
src/global.c
46
src/global.c
@ -135,7 +135,7 @@ int whitespace_len[2];
|
|||||||
/* The length in bytes of these characters. */
|
/* The length in bytes of these characters. */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef DISABLE_JUSTIFY
|
#ifdef ENABLE_JUSTIFY
|
||||||
char *punct = NULL;
|
char *punct = NULL;
|
||||||
/* The closing punctuation that can end sentences. */
|
/* The closing punctuation that can end sentences. */
|
||||||
char *brackets = NULL;
|
char *brackets = NULL;
|
||||||
@ -149,7 +149,7 @@ int quoterc;
|
|||||||
/* Whether it was compiled successfully. */
|
/* Whether it was compiled successfully. */
|
||||||
char *quoteerr = NULL;
|
char *quoteerr = NULL;
|
||||||
/* The error message, if it didn't. */
|
/* The error message, if it didn't. */
|
||||||
#endif /* !DISABLE_JUSTIFY */
|
#endif
|
||||||
|
|
||||||
char *word_chars = NULL;
|
char *word_chars = NULL;
|
||||||
/* Nonalphanumeric characters that also form words. */
|
/* Nonalphanumeric characters that also form words. */
|
||||||
@ -493,7 +493,7 @@ void print_sclist(void)
|
|||||||
const char *exit_tag = N_("Exit");
|
const char *exit_tag = N_("Exit");
|
||||||
const char *close_tag = N_("Close");
|
const char *close_tag = N_("Close");
|
||||||
const char *uncut_tag = N_("Uncut Text");
|
const char *uncut_tag = N_("Uncut Text");
|
||||||
#ifndef DISABLE_JUSTIFY
|
#ifdef ENABLE_JUSTIFY
|
||||||
const char *unjust_tag = N_("Unjustify");
|
const char *unjust_tag = N_("Unjustify");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -508,7 +508,7 @@ void shortcut_init(void)
|
|||||||
const char *nextline_tag = N_("Next Line");
|
const char *nextline_tag = N_("Next Line");
|
||||||
const char *prevpage_tag = N_("Prev Page");
|
const char *prevpage_tag = N_("Prev Page");
|
||||||
const char *nextpage_tag = N_("Next Page");
|
const char *nextpage_tag = N_("Next Page");
|
||||||
#ifndef DISABLE_JUSTIFY
|
#ifdef ENABLE_JUSTIFY
|
||||||
const char *justify_tag = N_("Justify");
|
const char *justify_tag = N_("Justify");
|
||||||
const char *fulljustify_tag = N_("FullJstify");
|
const char *fulljustify_tag = N_("FullJstify");
|
||||||
#endif
|
#endif
|
||||||
@ -578,7 +578,7 @@ void shortcut_init(void)
|
|||||||
const char *end_gist = N_("Go to end of current line");
|
const char *end_gist = N_("Go to end of current line");
|
||||||
const char *prevblock_gist = N_("Go to previous block of text");
|
const char *prevblock_gist = N_("Go to previous block of text");
|
||||||
const char *nextblock_gist = N_("Go to next block of text");
|
const char *nextblock_gist = N_("Go to next block of text");
|
||||||
#ifndef DISABLE_JUSTIFY
|
#ifdef ENABLE_JUSTIFY
|
||||||
const char *parabegin_gist =
|
const char *parabegin_gist =
|
||||||
N_("Go to beginning of paragraph; then of previous paragraph");
|
N_("Go to beginning of paragraph; then of previous paragraph");
|
||||||
const char *paraend_gist =
|
const char *paraend_gist =
|
||||||
@ -611,7 +611,7 @@ void shortcut_init(void)
|
|||||||
const char *cuttilleof_gist =
|
const char *cuttilleof_gist =
|
||||||
N_("Cut from the cursor position to the end of the file");
|
N_("Cut from the cursor position to the end of the file");
|
||||||
#endif
|
#endif
|
||||||
#ifndef DISABLE_JUSTIFY
|
#ifdef ENABLE_JUSTIFY
|
||||||
const char *justify_gist = N_("Justify the current paragraph");
|
const char *justify_gist = N_("Justify the current paragraph");
|
||||||
const char *fulljustify_gist = N_("Justify the entire file");
|
const char *fulljustify_gist = N_("Justify the entire file");
|
||||||
#endif
|
#endif
|
||||||
@ -708,7 +708,7 @@ void shortcut_init(void)
|
|||||||
add_to_funcs(do_writeout_void, MMAIN,
|
add_to_funcs(do_writeout_void, MMAIN,
|
||||||
N_("Write Out"), WITHORSANS(writeout_gist), TOGETHER, NOVIEW);
|
N_("Write Out"), WITHORSANS(writeout_gist), TOGETHER, NOVIEW);
|
||||||
|
|
||||||
#ifndef DISABLE_JUSTIFY
|
#ifdef ENABLE_JUSTIFY
|
||||||
if (!ISSET(RESTRICTED)) {
|
if (!ISSET(RESTRICTED)) {
|
||||||
#else
|
#else
|
||||||
/* If we can't replace Insert with Justify, show Insert anyway, to
|
/* If we can't replace Insert with Justify, show Insert anyway, to
|
||||||
@ -725,7 +725,7 @@ void shortcut_init(void)
|
|||||||
NOVIEW);
|
NOVIEW);
|
||||||
#endif
|
#endif
|
||||||
} else {
|
} else {
|
||||||
#ifndef DISABLE_JUSTIFY
|
#ifdef ENABLE_JUSTIFY
|
||||||
add_to_funcs(do_justify_void, MMAIN,
|
add_to_funcs(do_justify_void, MMAIN,
|
||||||
justify_tag, WITHORSANS(justify_gist), BLANKAFTER, NOVIEW);
|
justify_tag, WITHORSANS(justify_gist), BLANKAFTER, NOVIEW);
|
||||||
#endif
|
#endif
|
||||||
@ -770,7 +770,7 @@ void shortcut_init(void)
|
|||||||
uncutfunc = tailfunc;
|
uncutfunc = tailfunc;
|
||||||
|
|
||||||
if (!ISSET(RESTRICTED)) {
|
if (!ISSET(RESTRICTED)) {
|
||||||
#ifndef DISABLE_JUSTIFY
|
#ifdef ENABLE_JUSTIFY
|
||||||
add_to_funcs(do_justify_void, MMAIN,
|
add_to_funcs(do_justify_void, MMAIN,
|
||||||
justify_tag, WITHORSANS(justify_gist), TOGETHER, NOVIEW);
|
justify_tag, WITHORSANS(justify_gist), TOGETHER, NOVIEW);
|
||||||
#endif
|
#endif
|
||||||
@ -792,8 +792,8 @@ void shortcut_init(void)
|
|||||||
add_to_funcs(do_cursorpos_void, MMAIN,
|
add_to_funcs(do_cursorpos_void, MMAIN,
|
||||||
N_("Cur Pos"), WITHORSANS(cursorpos_gist), TOGETHER, VIEW);
|
N_("Cur Pos"), WITHORSANS(cursorpos_gist), TOGETHER, VIEW);
|
||||||
|
|
||||||
#if (!defined(DISABLE_JUSTIFY) && (!defined(DISABLE_SPELLER) || !defined(DISABLE_COLOR)) || \
|
#if (defined(ENABLE_JUSTIFY) && (!defined(DISABLE_SPELLER) || !defined(DISABLE_COLOR)) || \
|
||||||
defined(DISABLE_JUSTIFY) && defined(DISABLE_SPELLER) && defined(DISABLE_COLOR))
|
!defined(ENABLE_JUSTIFY) && defined(DISABLE_SPELLER) && defined(DISABLE_COLOR))
|
||||||
/* Conditionally placing this one here or further on, to keep the
|
/* Conditionally placing this one here or further on, to keep the
|
||||||
* help items nicely paired in most conditions. */
|
* help items nicely paired in most conditions. */
|
||||||
add_to_funcs(do_gotolinecolumn_void, MMAIN,
|
add_to_funcs(do_gotolinecolumn_void, MMAIN,
|
||||||
@ -825,7 +825,7 @@ void shortcut_init(void)
|
|||||||
add_to_funcs(flip_replace, MREPLACE,
|
add_to_funcs(flip_replace, MREPLACE,
|
||||||
N_("No Replace"), WITHORSANS(whereis_gist), BLANKAFTER, VIEW);
|
N_("No Replace"), WITHORSANS(whereis_gist), BLANKAFTER, VIEW);
|
||||||
|
|
||||||
#ifndef DISABLE_JUSTIFY
|
#ifdef ENABLE_JUSTIFY
|
||||||
add_to_funcs(do_full_justify, MWHEREIS,
|
add_to_funcs(do_full_justify, MWHEREIS,
|
||||||
fulljustify_tag, WITHORSANS(fulljustify_gist), TOGETHER, NOVIEW);
|
fulljustify_tag, WITHORSANS(fulljustify_gist), TOGETHER, NOVIEW);
|
||||||
|
|
||||||
@ -882,7 +882,7 @@ void shortcut_init(void)
|
|||||||
N_("Prev Block"), WITHORSANS(prevblock_gist), TOGETHER, VIEW);
|
N_("Prev Block"), WITHORSANS(prevblock_gist), TOGETHER, VIEW);
|
||||||
add_to_funcs(do_next_block, MMAIN,
|
add_to_funcs(do_next_block, MMAIN,
|
||||||
N_("Next Block"), WITHORSANS(nextblock_gist), TOGETHER, VIEW);
|
N_("Next Block"), WITHORSANS(nextblock_gist), TOGETHER, VIEW);
|
||||||
#ifndef DISABLE_JUSTIFY
|
#ifdef ENABLE_JUSTIFY
|
||||||
add_to_funcs(do_para_begin_void, MMAIN|MWHEREIS,
|
add_to_funcs(do_para_begin_void, MMAIN|MWHEREIS,
|
||||||
N_("Beg of Par"), WITHORSANS(parabegin_gist), TOGETHER, VIEW);
|
N_("Beg of Par"), WITHORSANS(parabegin_gist), TOGETHER, VIEW);
|
||||||
add_to_funcs(do_para_end_void, MMAIN|MWHEREIS,
|
add_to_funcs(do_para_end_void, MMAIN|MWHEREIS,
|
||||||
@ -906,8 +906,8 @@ void shortcut_init(void)
|
|||||||
N_("Next File"), WITHORSANS(nextfile_gist), BLANKAFTER, VIEW);
|
N_("Next File"), WITHORSANS(nextfile_gist), BLANKAFTER, VIEW);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if (defined(DISABLE_JUSTIFY) && (!defined(DISABLE_SPELLER) || !defined(DISABLE_COLOR)) || \
|
#if (!defined(ENABLE_JUSTIFY) && (!defined(DISABLE_SPELLER) || !defined(DISABLE_COLOR)) || \
|
||||||
!defined(DISABLE_JUSTIFY) && defined(DISABLE_SPELLER) && defined(DISABLE_COLOR))
|
defined(ENABLE_JUSTIFY) && defined(DISABLE_SPELLER) && defined(DISABLE_COLOR))
|
||||||
add_to_funcs(do_gotolinecolumn_void, MMAIN,
|
add_to_funcs(do_gotolinecolumn_void, MMAIN,
|
||||||
gotoline_tag, WITHORSANS(gotoline_gist), BLANKAFTER, VIEW);
|
gotoline_tag, WITHORSANS(gotoline_gist), BLANKAFTER, VIEW);
|
||||||
#endif
|
#endif
|
||||||
@ -944,7 +944,7 @@ void shortcut_init(void)
|
|||||||
N_("CutTillEnd"), WITHORSANS(cuttilleof_gist), BLANKAFTER, NOVIEW);
|
N_("CutTillEnd"), WITHORSANS(cuttilleof_gist), BLANKAFTER, NOVIEW);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef DISABLE_JUSTIFY
|
#ifdef ENABLE_JUSTIFY
|
||||||
add_to_funcs(do_full_justify, MMAIN,
|
add_to_funcs(do_full_justify, MMAIN,
|
||||||
fulljustify_tag, WITHORSANS(fulljustify_gist), TOGETHER, NOVIEW);
|
fulljustify_tag, WITHORSANS(fulljustify_gist), TOGETHER, NOVIEW);
|
||||||
#endif
|
#endif
|
||||||
@ -999,7 +999,7 @@ void shortcut_init(void)
|
|||||||
N_("NextHstory"), WITHORSANS(nexthistory_gist), BLANKAFTER, VIEW);
|
N_("NextHstory"), WITHORSANS(nexthistory_gist), BLANKAFTER, VIEW);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef DISABLE_JUSTIFY
|
#ifndef ENABLE_JUSTIFY
|
||||||
add_to_funcs(do_gotolinecolumn_void, MWHEREIS,
|
add_to_funcs(do_gotolinecolumn_void, MWHEREIS,
|
||||||
gotoline_tag, WITHORSANS(gotoline_gist), BLANKAFTER, VIEW);
|
gotoline_tag, WITHORSANS(gotoline_gist), BLANKAFTER, VIEW);
|
||||||
#endif
|
#endif
|
||||||
@ -1102,7 +1102,7 @@ void shortcut_init(void)
|
|||||||
add_to_sclist(MMOST, "F9", 0, do_cut_text_void, 0);
|
add_to_sclist(MMOST, "F9", 0, do_cut_text_void, 0);
|
||||||
add_to_sclist(MMOST, "^U", 0, do_uncut_text, 0);
|
add_to_sclist(MMOST, "^U", 0, do_uncut_text, 0);
|
||||||
add_to_sclist(MMOST, "F10", 0, do_uncut_text, 0);
|
add_to_sclist(MMOST, "F10", 0, do_uncut_text, 0);
|
||||||
#ifndef DISABLE_JUSTIFY
|
#ifdef ENABLE_JUSTIFY
|
||||||
add_to_sclist(MMAIN, "^J", 0, do_justify_void, 0);
|
add_to_sclist(MMAIN, "^J", 0, do_justify_void, 0);
|
||||||
add_to_sclist(MMAIN, "F4", 0, do_justify_void, 0);
|
add_to_sclist(MMAIN, "F4", 0, do_justify_void, 0);
|
||||||
#endif
|
#endif
|
||||||
@ -1204,7 +1204,7 @@ void shortcut_init(void)
|
|||||||
}
|
}
|
||||||
add_to_sclist(MMAIN, "M-7", 0, do_prev_block, 0);
|
add_to_sclist(MMAIN, "M-7", 0, do_prev_block, 0);
|
||||||
add_to_sclist(MMAIN, "M-8", 0, do_next_block, 0);
|
add_to_sclist(MMAIN, "M-8", 0, do_next_block, 0);
|
||||||
#ifndef DISABLE_JUSTIFY
|
#ifdef ENABLE_JUSTIFY
|
||||||
add_to_sclist(MMAIN, "M-(", 0, do_para_begin_void, 0);
|
add_to_sclist(MMAIN, "M-(", 0, do_para_begin_void, 0);
|
||||||
add_to_sclist(MMAIN, "M-9", 0, do_para_begin_void, 0);
|
add_to_sclist(MMAIN, "M-9", 0, do_para_begin_void, 0);
|
||||||
add_to_sclist(MMAIN, "M-)", 0, do_para_end_void, 0);
|
add_to_sclist(MMAIN, "M-)", 0, do_para_end_void, 0);
|
||||||
@ -1227,7 +1227,7 @@ void shortcut_init(void)
|
|||||||
add_to_sclist(MMAIN, "M-T", 0, do_cut_till_eof, 0);
|
add_to_sclist(MMAIN, "M-T", 0, do_cut_till_eof, 0);
|
||||||
add_to_sclist(MMAIN, "M-D", 0, do_wordlinechar_count, 0);
|
add_to_sclist(MMAIN, "M-D", 0, do_wordlinechar_count, 0);
|
||||||
#endif
|
#endif
|
||||||
#ifndef DISABLE_JUSTIFY
|
#ifdef ENABLE_JUSTIFY
|
||||||
add_to_sclist(MMAIN|MWHEREIS, "M-J", 0, do_full_justify, 0);
|
add_to_sclist(MMAIN|MWHEREIS, "M-J", 0, do_full_justify, 0);
|
||||||
#endif
|
#endif
|
||||||
add_to_sclist(MMAIN|MHELP, "^L", 0, total_refresh, 0);
|
add_to_sclist(MMAIN|MHELP, "^L", 0, total_refresh, 0);
|
||||||
@ -1277,7 +1277,7 @@ void shortcut_init(void)
|
|||||||
add_to_sclist(MWHEREIS|MREPLACE, "^R", 0, flip_replace, 0);
|
add_to_sclist(MWHEREIS|MREPLACE, "^R", 0, flip_replace, 0);
|
||||||
add_to_sclist(MWHEREIS|MREPLACE|MREPLACEWITH|MGOTOLINE|MFINDINHELP, "^Y", 0, do_first_line, 0);
|
add_to_sclist(MWHEREIS|MREPLACE|MREPLACEWITH|MGOTOLINE|MFINDINHELP, "^Y", 0, do_first_line, 0);
|
||||||
add_to_sclist(MWHEREIS|MREPLACE|MREPLACEWITH|MGOTOLINE|MFINDINHELP, "^V", 0, do_last_line, 0);
|
add_to_sclist(MWHEREIS|MREPLACE|MREPLACEWITH|MGOTOLINE|MFINDINHELP, "^V", 0, do_last_line, 0);
|
||||||
#ifndef DISABLE_JUSTIFY
|
#ifdef ENABLE_JUSTIFY
|
||||||
add_to_sclist(MWHEREIS|MREPLACE|MREPLACEWITH, "^W", 0, do_para_begin_void, 0);
|
add_to_sclist(MWHEREIS|MREPLACE|MREPLACEWITH, "^W", 0, do_para_begin_void, 0);
|
||||||
add_to_sclist(MWHEREIS|MREPLACE|MREPLACEWITH, "^O", 0, do_para_end_void, 0);
|
add_to_sclist(MWHEREIS|MREPLACE|MREPLACEWITH, "^O", 0, do_para_end_void, 0);
|
||||||
#endif
|
#endif
|
||||||
@ -1516,7 +1516,7 @@ sc *strtosc(const char *input)
|
|||||||
s->scfunc = do_cursorpos_void;
|
s->scfunc = do_cursorpos_void;
|
||||||
else if (!strcasecmp(input, "gotoline"))
|
else if (!strcasecmp(input, "gotoline"))
|
||||||
s->scfunc = do_gotolinecolumn_void;
|
s->scfunc = do_gotolinecolumn_void;
|
||||||
#ifndef DISABLE_JUSTIFY
|
#ifdef ENABLE_JUSTIFY
|
||||||
else if (!strcasecmp(input, "justify"))
|
else if (!strcasecmp(input, "justify"))
|
||||||
s->scfunc = do_justify_void;
|
s->scfunc = do_justify_void;
|
||||||
else if (!strcasecmp(input, "fulljustify"))
|
else if (!strcasecmp(input, "fulljustify"))
|
||||||
@ -1777,7 +1777,7 @@ void thanks_for_all_the_fish(void)
|
|||||||
delwin(bottomwin);
|
delwin(bottomwin);
|
||||||
|
|
||||||
free(word_chars);
|
free(word_chars);
|
||||||
#ifndef DISABLE_JUSTIFY
|
#ifdef ENABLE_JUSTIFY
|
||||||
free(quotestr);
|
free(quotestr);
|
||||||
regfree("ereg);
|
regfree("ereg);
|
||||||
free(quoteerr);
|
free(quoteerr);
|
||||||
|
@ -169,7 +169,7 @@ void do_page_down(void)
|
|||||||
refresh_needed = TRUE;
|
refresh_needed = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef DISABLE_JUSTIFY
|
#ifdef ENABLE_JUSTIFY
|
||||||
/* Move to the beginning of the last beginning-of-paragraph line before the
|
/* Move to the beginning of the last beginning-of-paragraph line before the
|
||||||
* current line. If update_screen is TRUE, update the screen afterwards. */
|
* current line. If update_screen is TRUE, update the screen afterwards. */
|
||||||
void do_para_begin(bool update_screen)
|
void do_para_begin(bool update_screen)
|
||||||
@ -229,7 +229,7 @@ void do_para_end_void(void)
|
|||||||
{
|
{
|
||||||
do_para_end(TRUE);
|
do_para_end(TRUE);
|
||||||
}
|
}
|
||||||
#endif /* !DISABLE_JUSTIFY */
|
#endif /* ENABLE_JUSTIFY */
|
||||||
|
|
||||||
/* Move to the preceding block of text. */
|
/* Move to the preceding block of text. */
|
||||||
void do_prev_block(void)
|
void do_prev_block(void)
|
||||||
|
20
src/nano.c
20
src/nano.c
@ -830,7 +830,7 @@ void usage(void)
|
|||||||
print_opt("-P", "--positionlog",
|
print_opt("-P", "--positionlog",
|
||||||
N_("Log & read location of cursor position"));
|
N_("Log & read location of cursor position"));
|
||||||
#endif
|
#endif
|
||||||
#ifndef DISABLE_JUSTIFY
|
#ifdef ENABLE_JUSTIFY
|
||||||
print_opt(_("-Q <str>"), _("--quotestr=<str>"), N_("Quoting string"));
|
print_opt(_("-Q <str>"), _("--quotestr=<str>"), N_("Quoting string"));
|
||||||
#endif
|
#endif
|
||||||
if (!ISSET(RESTRICTED))
|
if (!ISSET(RESTRICTED))
|
||||||
@ -942,7 +942,7 @@ void version(void)
|
|||||||
#ifdef ENABLE_HISTORIES
|
#ifdef ENABLE_HISTORIES
|
||||||
printf(" --enable-histories");
|
printf(" --enable-histories");
|
||||||
#endif
|
#endif
|
||||||
#ifndef DISABLE_JUSTIFY
|
#ifdef ENABLE_JUSTIFY
|
||||||
printf(" --enable-justify");
|
printf(" --enable-justify");
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_LIBMAGIC
|
#ifdef HAVE_LIBMAGIC
|
||||||
@ -991,7 +991,7 @@ void version(void)
|
|||||||
#ifndef ENABLE_HISTORIES
|
#ifndef ENABLE_HISTORIES
|
||||||
printf(" --disable-histories");
|
printf(" --disable-histories");
|
||||||
#endif
|
#endif
|
||||||
#ifdef DISABLE_JUSTIFY
|
#ifndef ENABLE_JUSTIFY
|
||||||
printf(" --disable-justify");
|
printf(" --disable-justify");
|
||||||
#endif
|
#endif
|
||||||
#ifndef HAVE_LIBMAGIC
|
#ifndef HAVE_LIBMAGIC
|
||||||
@ -1917,7 +1917,7 @@ int main(int argc, char **argv)
|
|||||||
{"rebindkeypad", 0, NULL, 'K'},
|
{"rebindkeypad", 0, NULL, 'K'},
|
||||||
{"nonewlines", 0, NULL, 'L'},
|
{"nonewlines", 0, NULL, 'L'},
|
||||||
{"morespace", 0, NULL, 'O'},
|
{"morespace", 0, NULL, 'O'},
|
||||||
#ifndef DISABLE_JUSTIFY
|
#ifdef ENABLE_JUSTIFY
|
||||||
{"quotestr", 1, NULL, 'Q'},
|
{"quotestr", 1, NULL, 'Q'},
|
||||||
#endif
|
#endif
|
||||||
{"restricted", 0, NULL, 'R'},
|
{"restricted", 0, NULL, 'R'},
|
||||||
@ -2088,7 +2088,7 @@ int main(int argc, char **argv)
|
|||||||
SET(POS_HISTORY);
|
SET(POS_HISTORY);
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
#ifndef DISABLE_JUSTIFY
|
#ifdef ENABLE_JUSTIFY
|
||||||
case 'Q':
|
case 'Q':
|
||||||
quotestr = mallocstrcpy(quotestr, optarg);
|
quotestr = mallocstrcpy(quotestr, optarg);
|
||||||
break;
|
break;
|
||||||
@ -2262,7 +2262,7 @@ int main(int argc, char **argv)
|
|||||||
char *backup_dir_cpy = backup_dir;
|
char *backup_dir_cpy = backup_dir;
|
||||||
char *word_chars_cpy = word_chars;
|
char *word_chars_cpy = word_chars;
|
||||||
#endif
|
#endif
|
||||||
#ifndef DISABLE_JUSTIFY
|
#ifdef ENABLE_JUSTIFY
|
||||||
char *quotestr_cpy = quotestr;
|
char *quotestr_cpy = quotestr;
|
||||||
#endif
|
#endif
|
||||||
#ifndef DISABLE_SPELLER
|
#ifndef DISABLE_SPELLER
|
||||||
@ -2281,7 +2281,7 @@ int main(int argc, char **argv)
|
|||||||
backup_dir = NULL;
|
backup_dir = NULL;
|
||||||
word_chars = NULL;
|
word_chars = NULL;
|
||||||
#endif
|
#endif
|
||||||
#ifndef DISABLE_JUSTIFY
|
#ifdef ENABLE_JUSTIFY
|
||||||
quotestr = NULL;
|
quotestr = NULL;
|
||||||
#endif
|
#endif
|
||||||
#ifndef DISABLE_SPELLER
|
#ifndef DISABLE_SPELLER
|
||||||
@ -2316,7 +2316,7 @@ int main(int argc, char **argv)
|
|||||||
word_chars = word_chars_cpy;
|
word_chars = word_chars_cpy;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#ifndef DISABLE_JUSTIFY
|
#ifdef ENABLE_JUSTIFY
|
||||||
if (quotestr_cpy != NULL) {
|
if (quotestr_cpy != NULL) {
|
||||||
free(quotestr);
|
free(quotestr);
|
||||||
quotestr = quotestr_cpy;
|
quotestr = quotestr_cpy;
|
||||||
@ -2390,7 +2390,7 @@ int main(int argc, char **argv)
|
|||||||
init_operating_dir();
|
init_operating_dir();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef DISABLE_JUSTIFY
|
#ifdef ENABLE_JUSTIFY
|
||||||
/* If punct wasn't specified, set its default value. */
|
/* If punct wasn't specified, set its default value. */
|
||||||
if (punct == NULL)
|
if (punct == NULL)
|
||||||
punct = mallocstrcpy(NULL, "!.?");
|
punct = mallocstrcpy(NULL, "!.?");
|
||||||
@ -2414,7 +2414,7 @@ int main(int argc, char **argv)
|
|||||||
quoteerr = charalloc(size);
|
quoteerr = charalloc(size);
|
||||||
regerror(quoterc, "ereg, quoteerr, size);
|
regerror(quoterc, "ereg, quoteerr, size);
|
||||||
}
|
}
|
||||||
#endif /* !DISABLE_JUSTIFY */
|
#endif /* ENABLE_JUSTIFY */
|
||||||
|
|
||||||
#ifndef DISABLE_SPELLER
|
#ifndef DISABLE_SPELLER
|
||||||
/* If we don't have an alternative spell checker after reading the
|
/* If we don't have an alternative spell checker after reading the
|
||||||
|
@ -128,7 +128,7 @@
|
|||||||
#undef ENABLE_MOUSE
|
#undef ENABLE_MOUSE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(ENABLE_WRAPPING) && defined(DISABLE_JUSTIFY)
|
#if !defined(ENABLE_WRAPPING) && !defined(ENABLE_JUSTIFY)
|
||||||
#define DISABLE_WRAPJUSTIFY 1
|
#define DISABLE_WRAPJUSTIFY 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
14
src/proto.h
14
src/proto.h
@ -116,7 +116,7 @@ extern int whitespace_len[2];
|
|||||||
extern const char *exit_tag;
|
extern const char *exit_tag;
|
||||||
extern const char *close_tag;
|
extern const char *close_tag;
|
||||||
extern const char *uncut_tag;
|
extern const char *uncut_tag;
|
||||||
#ifndef DISABLE_JUSTIFY
|
#ifdef ENABLE_JUSTIFY
|
||||||
extern const char *unjust_tag;
|
extern const char *unjust_tag;
|
||||||
extern char *punct;
|
extern char *punct;
|
||||||
extern char *brackets;
|
extern char *brackets;
|
||||||
@ -124,7 +124,7 @@ extern char *quotestr;
|
|||||||
extern regex_t quotereg;
|
extern regex_t quotereg;
|
||||||
extern int quoterc;
|
extern int quoterc;
|
||||||
extern char *quoteerr;
|
extern char *quoteerr;
|
||||||
#endif /* !DISABLE_JUSTIFY */
|
#endif /* !ENABLE_JUSTIFY */
|
||||||
|
|
||||||
extern char *word_chars;
|
extern char *word_chars;
|
||||||
|
|
||||||
@ -226,7 +226,7 @@ char *mbrevstrcasestr(const char *haystack, const char *needle,
|
|||||||
const char *index);
|
const char *index);
|
||||||
size_t mbstrlen(const char *s);
|
size_t mbstrlen(const char *s);
|
||||||
size_t mbstrnlen(const char *s, size_t maxlen);
|
size_t mbstrnlen(const char *s, size_t maxlen);
|
||||||
#if !defined(NANO_TINY) || !defined(DISABLE_JUSTIFY)
|
#if !defined(NANO_TINY) || defined(ENABLE_JUSTIFY)
|
||||||
char *mbstrchr(const char *s, const char *c);
|
char *mbstrchr(const char *s, const char *c);
|
||||||
#endif
|
#endif
|
||||||
#ifndef NANO_TINY
|
#ifndef NANO_TINY
|
||||||
@ -234,7 +234,7 @@ char *mbstrpbrk(const char *s, const char *accept);
|
|||||||
char *revstrpbrk(const char *head, const char *accept, const char *index);
|
char *revstrpbrk(const char *head, const char *accept, const char *index);
|
||||||
char *mbrevstrpbrk(const char *head, const char *accept, const char *index);
|
char *mbrevstrpbrk(const char *head, const char *accept, const char *index);
|
||||||
#endif
|
#endif
|
||||||
#if defined(ENABLE_NANORC) && (!defined(NANO_TINY) || !defined(DISABLE_JUSTIFY))
|
#if defined(ENABLE_NANORC) && (!defined(NANO_TINY) || defined(ENABLE_JUSTIFY))
|
||||||
bool has_blank_mbchars(const char *s);
|
bool has_blank_mbchars(const char *s);
|
||||||
#endif
|
#endif
|
||||||
#ifdef ENABLE_UTF8
|
#ifdef ENABLE_UTF8
|
||||||
@ -378,7 +378,7 @@ void do_first_line(void);
|
|||||||
void do_last_line(void);
|
void do_last_line(void);
|
||||||
void do_page_up(void);
|
void do_page_up(void);
|
||||||
void do_page_down(void);
|
void do_page_down(void);
|
||||||
#ifndef DISABLE_JUSTIFY
|
#ifdef ENABLE_JUSTIFY
|
||||||
void do_para_begin(bool update_screen);
|
void do_para_begin(bool update_screen);
|
||||||
void do_para_end(bool update_screen);
|
void do_para_end(bool update_screen);
|
||||||
void do_para_begin_void(void);
|
void do_para_begin_void(void);
|
||||||
@ -554,10 +554,10 @@ bool do_wrap(filestruct *line);
|
|||||||
#if defined(ENABLE_HELP) || !defined(DISABLE_WRAPJUSTIFY)
|
#if defined(ENABLE_HELP) || !defined(DISABLE_WRAPJUSTIFY)
|
||||||
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(DISABLE_JUSTIFY)
|
#if !defined(NANO_TINY) || defined(ENABLE_JUSTIFY)
|
||||||
size_t indent_length(const char *line);
|
size_t indent_length(const char *line);
|
||||||
#endif
|
#endif
|
||||||
#ifndef DISABLE_JUSTIFY
|
#ifdef ENABLE_JUSTIFY
|
||||||
void justify_format(filestruct *paragraph, size_t skip);
|
void justify_format(filestruct *paragraph, size_t skip);
|
||||||
bool begpar(const filestruct *const foo);
|
bool begpar(const filestruct *const foo);
|
||||||
bool inpar(const filestruct *const foo);
|
bool inpar(const filestruct *const foo);
|
||||||
|
@ -39,7 +39,7 @@ static const rcoption rcopts[] = {
|
|||||||
#ifdef ENABLE_LINENUMBERS
|
#ifdef ENABLE_LINENUMBERS
|
||||||
{"linenumbers", LINE_NUMBERS},
|
{"linenumbers", LINE_NUMBERS},
|
||||||
#endif
|
#endif
|
||||||
#ifndef DISABLE_JUSTIFY
|
#ifdef ENABLE_JUSTIFY
|
||||||
{"brackets", 0},
|
{"brackets", 0},
|
||||||
#endif
|
#endif
|
||||||
{"const", CONSTANT_SHOW}, /* deprecated form, remove in 2018 */
|
{"const", CONSTANT_SHOW}, /* deprecated form, remove in 2018 */
|
||||||
@ -71,7 +71,7 @@ static const rcoption rcopts[] = {
|
|||||||
{"positionlog", POS_HISTORY},
|
{"positionlog", POS_HISTORY},
|
||||||
#endif
|
#endif
|
||||||
{"preserve", PRESERVE},
|
{"preserve", PRESERVE},
|
||||||
#ifndef DISABLE_JUSTIFY
|
#ifdef ENABLE_JUSTIFY
|
||||||
{"punct", 0},
|
{"punct", 0},
|
||||||
{"quotestr", 0},
|
{"quotestr", 0},
|
||||||
#endif
|
#endif
|
||||||
@ -1138,7 +1138,7 @@ void parse_rcfile(FILE *rcstream, bool syntax_only)
|
|||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
#endif
|
#endif
|
||||||
#ifndef DISABLE_JUSTIFY
|
#ifdef ENABLE_JUSTIFY
|
||||||
if (strcasecmp(rcopts[i].name, "punct") == 0) {
|
if (strcasecmp(rcopts[i].name, "punct") == 0) {
|
||||||
punct = option;
|
punct = option;
|
||||||
if (has_blank_mbchars(punct)) {
|
if (has_blank_mbchars(punct)) {
|
||||||
|
10
src/text.c
10
src/text.c
@ -39,7 +39,7 @@ static pid_t pid = -1;
|
|||||||
static bool prepend_wrap = FALSE;
|
static bool prepend_wrap = FALSE;
|
||||||
/* Should we prepend wrapped text to the next line? */
|
/* Should we prepend wrapped text to the next line? */
|
||||||
#endif
|
#endif
|
||||||
#ifndef DISABLE_JUSTIFY
|
#ifdef ENABLE_JUSTIFY
|
||||||
static filestruct *jusbuffer = NULL;
|
static filestruct *jusbuffer = NULL;
|
||||||
/* The buffer where we store unjustified text. */
|
/* The buffer where we store unjustified text. */
|
||||||
static filestruct *jusbottom = NULL;
|
static filestruct *jusbottom = NULL;
|
||||||
@ -1742,7 +1742,7 @@ ssize_t break_line(const char *line, ssize_t goal, bool snap_at_nl)
|
|||||||
}
|
}
|
||||||
#endif /* ENABLE_HELP || !DISABLE_WRAPJUSTIFY */
|
#endif /* ENABLE_HELP || !DISABLE_WRAPJUSTIFY */
|
||||||
|
|
||||||
#if !defined(NANO_TINY) || !defined(DISABLE_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
|
||||||
* and the non-whitespace of the line. */
|
* and the non-whitespace of the line. */
|
||||||
size_t indent_length(const char *line)
|
size_t indent_length(const char *line)
|
||||||
@ -1763,9 +1763,9 @@ size_t indent_length(const char *line)
|
|||||||
|
|
||||||
return len;
|
return len;
|
||||||
}
|
}
|
||||||
#endif /* !NANO_TINY || !DISABLE_JUSTIFY */
|
#endif /* !NANO_TINY || ENABLE_JUSTIFY */
|
||||||
|
|
||||||
#ifndef DISABLE_JUSTIFY
|
#ifdef ENABLE_JUSTIFY
|
||||||
/* justify_format() replaces blanks with spaces and multiple spaces by 1
|
/* justify_format() replaces blanks with spaces and multiple spaces by 1
|
||||||
* (except it maintains up to 2 after a character in punct optionally
|
* (except it maintains up to 2 after a character in punct optionally
|
||||||
* followed by a character in brackets, and removes all from the end).
|
* followed by a character in brackets, and removes all from the end).
|
||||||
@ -2556,7 +2556,7 @@ void do_full_justify(void)
|
|||||||
{
|
{
|
||||||
do_justify(TRUE);
|
do_justify(TRUE);
|
||||||
}
|
}
|
||||||
#endif /* !DISABLE_JUSTIFY */
|
#endif /* ENABLE_JUSTIFY */
|
||||||
|
|
||||||
#ifndef DISABLE_SPELLER
|
#ifndef DISABLE_SPELLER
|
||||||
/* A word is misspelled in the file. Let the user replace it. We
|
/* A word is misspelled in the file. Let the user replace it. We
|
||||||
|
Загрузка…
Ссылка в новой задаче
Block a user