diff --git a/ChangeLog b/ChangeLog index 6d1283f..2652555 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +2015-02-05 Andrew Ho + * Add NO_TITLEBAR flag to disable titlebar (also turns on MORE_SPACE). + 2014-04-11 Andrew Ho * Add bracket flashing. diff --git a/NEWS b/NEWS index 0f2b4d4..a428d47 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,6 @@ +2015.02.05 - GNU nano 2.2.6pt adds to nano 2.2.6p an option to disable + the title bar, and use its space for editing. + 2014.04.11 - GNU nano 2.2.6p adds bracket flashing to nano 2.2.6. 2010.11.22 - GNU nano 2.2.6 "Pimp my BBS" wants you to go to diff --git a/configure b/configure index f2447f5..0145a3c 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.65 for GNU nano 2.2.6p. +# Generated by GNU Autoconf 2.65 for GNU nano 2.2.6pt. # # Report bugs to . # @@ -552,8 +552,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='GNU nano' PACKAGE_TARNAME='nano' -PACKAGE_VERSION='2.2.6p' -PACKAGE_STRING='GNU nano 2.2.6p' +PACKAGE_VERSION='2.2.6pt' +PACKAGE_STRING='GNU nano 2.2.6pt' PACKAGE_BUGREPORT='nano-devel@gnu.org' PACKAGE_URL='http://www.gnu.org/software/nano/' @@ -1300,7 +1300,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures GNU nano 2.2.6p to adapt to many kinds of systems. +\`configure' configures GNU nano 2.2.6pt to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1371,7 +1371,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of GNU nano 2.2.6p:";; + short | recursive ) echo "Configuration of GNU nano 2.2.6pt:";; esac cat <<\_ACEOF @@ -1492,7 +1492,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -GNU nano configure 2.2.6p +GNU nano configure 2.2.6pt generated by GNU Autoconf 2.65 Copyright (C) 2009 Free Software Foundation, Inc. @@ -1863,7 +1863,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by GNU nano $as_me 2.2.6p, which was +It was created by GNU nano $as_me 2.2.6pt, which was generated by GNU Autoconf 2.65. Invocation command line was $ $0 $@ @@ -2782,7 +2782,7 @@ fi # Define the identity of the package. PACKAGE='nano' - VERSION='2.2.6p' + VERSION='2.2.6pt' cat >>confdefs.h <<_ACEOF @@ -8884,7 +8884,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by GNU nano $as_me 2.2.6p, which was +This file was extended by GNU nano $as_me 2.2.6pt, which was generated by GNU Autoconf 2.65. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -8952,7 +8952,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -GNU nano config.status 2.2.6p +GNU nano config.status 2.2.6pt configured by $0, generated by GNU Autoconf 2.65, with options \\"\$ac_cs_config\\" diff --git a/configure.ac b/configure.ac index 14193a3..1a4f2ea 100644 --- a/configure.ac +++ b/configure.ac @@ -20,7 +20,7 @@ # # $Id: configure.ac 4516 2010-08-11 02:42:32Z astyanax $ -AC_INIT([GNU nano], [2.2.6p], [nano-devel@gnu.org], [nano]) +AC_INIT([GNU nano], [2.2.6pt], [nano-devel@gnu.org], [nano]) AC_CONFIG_SRCDIR([src/nano.c]) AC_CANONICAL_TARGET([]) AM_INIT_AUTOMAKE diff --git a/src/nano.c b/src/nano.c index 873ba0a..0e8fda7 100644 --- a/src/nano.c +++ b/src/nano.c @@ -856,6 +856,7 @@ void usage(void) N_("Don't convert files from DOS/Mac format")); #endif print_opt("-O", "--morespace", N_("Use one more line for editing")); + print_opt("-OO", "--notitlebar", N_("Don't display titlebar")); #ifndef DISABLE_JUSTIFY print_opt(_("-Q "), _("--quotestr="), N_("Quoting string")); @@ -1000,12 +1001,14 @@ void version(void) printf("\n"); } -/* Return 1 if the MORE_SPACE flag is set, and 0 otherwise. This is - * used to calculate the relative screen position while taking this flag - * into account, since it adds one line to the edit window. */ +/* Return the number of lines to expand the edit window upwards by. + * By default the edit window starts at row 3 (titlebar is row 1, + * and an empty line at row 2 separates the titlebar and edit window). + * The NO_TITLEBAR flag suppresses the titlebar, and the MORE_SPACE flag + * suppresses the empty line above the edit window. */ int no_more_space(void) { - return ISSET(MORE_SPACE) ? 1 : 0; + return (ISSET(MORE_SPACE) ? 1 : 0) + (ISSET(NO_TITLEBAR) ? 1 : 0); } /* Return 2 if the NO_HELP flag is set, and 0 otherwise. This is used @@ -2072,6 +2075,8 @@ int main(int argc, char **argv) {"rebindkeypad", 0, NULL, 'K'}, {"nonewlines", 0, NULL, 'L'}, {"morespace", 0, NULL, 'O'}, +#define NO_TITLEBAR_OPTION_VALUE 128 + {"notitlebar", 0, NULL, NO_TITLEBAR_OPTION_VALUE}, #ifndef DISABLE_JUSTIFY {"quotestr", 1, NULL, 'Q'}, #endif @@ -2219,7 +2224,15 @@ int main(int argc, char **argv) break; #endif case 'O': + if(ISSET(MORE_SPACE)) { + SET(NO_TITLEBAR); + } else { + SET(MORE_SPACE); + } + break; + case NO_TITLEBAR_OPTION_VALUE: SET(MORE_SPACE); + SET(NO_TITLEBAR); break; #ifndef DISABLE_JUSTIFY case 'Q': diff --git a/src/nano.h b/src/nano.h index 12131fb..2fea055 100644 --- a/src/nano.h +++ b/src/nano.h @@ -488,6 +488,7 @@ enum SMART_HOME, WHITESPACE_DISPLAY, MORE_SPACE, + NO_TITLEBAR, TABS_TO_SPACES, QUICK_BLANK, WORD_BOUNDS, diff --git a/src/rcfile.c b/src/rcfile.c index 5aff6d9..672249e 100644 --- a/src/rcfile.c +++ b/src/rcfile.c @@ -48,6 +48,7 @@ static const rcoption rcopts[] = { {"multibuffer", MULTIBUFFER}, #endif {"morespace", MORE_SPACE}, + {"notitlebar", NO_TITLEBAR}, {"nofollow", NOFOLLOW_SYMLINKS}, {"nohelp", NO_HELP}, {"nonewlines", NO_NEWLINES}, diff --git a/src/winio.c b/src/winio.c index fa66cb5..775dad7 100644 --- a/src/winio.c +++ b/src/winio.c @@ -2088,6 +2088,7 @@ char *display_string(const char *buf, size_t start_col, size_t len, bool * of path on the titlebar. */ void titlebar(const char *path) { + if (ISSET(NO_TITLEBAR)) return; int space = COLS; /* The space we have available for display. */ size_t verlen = strlenpt(PACKAGE_STRING) + 1;