add -U/--quickblank option, a Meta-U toggle, and a "quickblank" rcfile

option to blank the statusbar after 1 keystroke instead of 25; note that
this is disabled when NANO_SMALL is defined


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2709 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
master
David Lawrence Ramsey 2005-06-17 19:06:25 +00:00
parent 6399000a48
commit e29111f7ec
9 changed files with 43 additions and 7 deletions

View File

@ -105,6 +105,12 @@ CVS code -
- Since the DISABLE_CURPOS flag is only used in winio.c, reduce - Since the DISABLE_CURPOS flag is only used in winio.c, reduce
it to a static bool there. Changes to statusbar() and it to a static bool there. Changes to statusbar() and
disable_cursorpos(). (DLR) disable_cursorpos(). (DLR)
- Add -U/--quickblank option, a Meta-U toggle, and a
"quickblank" rcfile option to blank the statusbar after 1
keystroke instead of 25. Note that this is disabled when
NANO_SMALL is defined. Changes to toggle_init(), usage(),
main(), statusbar(), nanorc.sample, nano.1, and nanorc.5.
(DLR, suggested by CHAO Wei-Lun)
- chars.c: - chars.c:
make_mbstring() make_mbstring()
- Change erroneous ENABLE_EXTRA #ifdef to NANO_EXTRA to fix a - Change erroneous ENABLE_EXTRA #ifdef to NANO_EXTRA to fix a

View File

@ -6,7 +6,7 @@
.\" Public License for copying conditions. There is NO warranty. .\" Public License for copying conditions. There is NO warranty.
.\" .\"
.\" $Id$ .\" $Id$
.TH NANO 1 "version 1.3.8" "June 16, 2005" .TH NANO 1 "version 1.3.8" "June 17, 2005"
.\" Please adjust this date whenever revising the manpage. .\" Please adjust this date whenever revising the manpage.
.\" .\"
@ -91,6 +91,10 @@ usual chunk-by-chunk behavior.
.B \-T \fIcols\fP (\-\-tabsize=\fIcols\fP) .B \-T \fIcols\fP (\-\-tabsize=\fIcols\fP)
Set the size (width) of a tab to \fIcols\fP columns. Set the size (width) of a tab to \fIcols\fP columns.
.TP .TP
.B \-U (\-\-quickblank)
Do quick statusbar blanking. Statusbar messages will disappear after 1
keystroke instead of 25.
.TP
.B \-V (\-\-version) .B \-V (\-\-version)
Show the current version number and author. Show the current version number and author.
.TP .TP

View File

@ -114,6 +114,10 @@ Set the characters treated as closing punctuation. They cannot contain
blank characters. Only closing punctuation, optionally followed by blank characters. Only closing punctuation, optionally followed by
closing brackets, can end sentences. closing brackets, can end sentences.
.TP .TP
.B set quickblank
Do quick statusbar blanking. Statusbar messages will disappear after 1
keystroke instead of 25.
.TP
.B set quotestr "\fIstring\fP" .B set quotestr "\fIstring\fP"
The email-quote string, used to justify email-quoted paragraphs. This The email-quote string, used to justify email-quoted paragraphs. This
is an "extended regular expression" if your system supports them, is an "extended regular expression" if your system supports them,

View File

@ -85,6 +85,11 @@
## ##
# set punct ".?!" # set punct ".?!"
## Do quick statusbar blanking. Statusbar messages will disappear after
## 1 keystroke instead of 25.
##
# set quickblank
## The email-quote string, used to justify email-quoted paragraphs. ## The email-quote string, used to justify email-quoted paragraphs.
## This is an extended regular expression if your system supports them, ## This is an extended regular expression if your system supports them,
## otherwise a literal string. Default: ## otherwise a literal string. Default:
@ -273,8 +278,8 @@
## highlight possible errors and parameters ## highlight possible errors and parameters
# color brightwhite "^ *(set|unset|syntax|color).*$" # color brightwhite "^ *(set|unset|syntax|color).*$"
## set, unset and syntax ## set, unset and syntax
# color cyan "^ *(set|unset) +(autoindent|backup|backupdir|backwards|brackets|casesensitive|const|cut|fill|historylog|morespace|mouse|multibuffer|noconvert|nofollow|nohelp|nowrap|operatingdir|preserve|punct|quotestr|rebinddelete|regexp|smarthome|smooth|speller)\>" # color cyan "^ *(set|unset) +(autoindent|backup|backupdir|backwards|brackets|casesensitive|const|cut|fill|historylog|morespace|mouse|multibuffer|noconvert|nofollow|nohelp|nowrap|operatingdir|preserve|punct|quickblank|quotestr|rebinddelete|regexp|smarthome|smooth)\>"
# color cyan "^ *(set|unset) +(suspend|tabsize|tabstospaces|tempfile|view|whitespace)" # color cyan "^ *(set|unset) +(speller|suspend|tabsize|tabstospaces|tempfile|view|whitespace)"
# color green "^ *(set|unset|syntax)\>" # color green "^ *(set|unset|syntax)\>"
## colors ## colors
# color yellow "^ *color *(bright)?(white|black|red|blue|green|yellow|magenta|cyan)(,(white|black|red|blue|green|yellow|magenta|cyan))?\>" # color yellow "^ *color *(bright)?(white|black|red|blue|green|yellow|magenta|cyan)(,(white|black|red|blue|green|yellow|magenta|cyan))?\>"

View File

@ -1153,6 +1153,8 @@ void toggle_init(void)
N_("Use of more space for editing"), MORE_SPACE); N_("Use of more space for editing"), MORE_SPACE);
toggle_init_one(TOGGLE_TABSTOSPACES_KEY, toggle_init_one(TOGGLE_TABSTOSPACES_KEY,
N_("Conversion of typed tabs to spaces"), TABS_TO_SPACES); N_("Conversion of typed tabs to spaces"), TABS_TO_SPACES);
toggle_init_one(TOGGLE_QUICKBLANK_KEY,
N_("Quick statusbar blanking"), QUICK_BLANK);
} }
#endif /* !NANO_SMALL */ #endif /* !NANO_SMALL */

View File

@ -1056,6 +1056,8 @@ void usage(void)
#endif #endif
print1opt(_("-T [#cols]"), _("--tabsize=[#cols]"), print1opt(_("-T [#cols]"), _("--tabsize=[#cols]"),
N_("Set width of a tab in cols to #cols")); N_("Set width of a tab in cols to #cols"));
print1opt("-U", _("--quickblank"),
N_("Do quick statusbar blanking"));
print1opt("-V", "--version", print1opt("-V", "--version",
N_("Print version information and exit")); N_("Print version information and exit"));
#ifdef ENABLE_COLOR #ifdef ENABLE_COLOR
@ -4151,6 +4153,7 @@ int main(int argc, char **argv)
{"historylog", 0, NULL, 'H'}, {"historylog", 0, NULL, 'H'},
{"noconvert", 0, NULL, 'N'}, {"noconvert", 0, NULL, 'N'},
{"smooth", 0, NULL, 'S'}, {"smooth", 0, NULL, 'S'},
{"quickblank", 0, NULL, 'U'},
{"restricted", 0, NULL, 'Z'}, {"restricted", 0, NULL, 'Z'},
{"autoindent", 0, NULL, 'i'}, {"autoindent", 0, NULL, 'i'},
{"cut", 0, NULL, 'k'}, {"cut", 0, NULL, 'k'},
@ -4192,11 +4195,11 @@ int main(int argc, char **argv)
while ((optchr = while ((optchr =
#ifdef HAVE_GETOPT_LONG #ifdef HAVE_GETOPT_LONG
getopt_long(argc, argv, getopt_long(argc, argv,
"h?ABC:EFHINOQ:ST:VY:Zabcdefgijklmo:pr:s:tvwxz", "h?ABC:EFHINOQ:ST:UVY:Zabcdefgijklmo:pr:s:tvwxz",
long_options, NULL) long_options, NULL)
#else #else
getopt(argc, argv, getopt(argc, argv,
"h?ABC:EFHINOQ:ST:VY:Zabcdefgijklmo:pr:s:tvwxz") "h?ABC:EFHINOQ:ST:UVY:Zabcdefgijklmo:pr:s:tvwxz")
#endif #endif
) != -1) { ) != -1) {
@ -4263,6 +4266,11 @@ int main(int argc, char **argv)
exit(1); exit(1);
} }
break; break;
#ifndef NANO_SMALL
case 'U':
SET(QUICK_BLANK);
break;
#endif
case 'V': case 'V':
version(); version();
exit(0); exit(0);

View File

@ -303,7 +303,8 @@ typedef struct syntaxtype {
#define WHITESPACE_DISPLAY (1<<26) #define WHITESPACE_DISPLAY (1<<26)
#define MORE_SPACE (1<<27) #define MORE_SPACE (1<<27)
#define TABS_TO_SPACES (1<<28) #define TABS_TO_SPACES (1<<28)
#define USE_UTF8 (1<<29) #define QUICK_BLANK (1<<29)
#define USE_UTF8 (1<<30)
/* Control key sequences. Changing these would be very, very bad. */ /* Control key sequences. Changing these would be very, very bad. */
#define NANO_CONTROL_SPACE 0 #define NANO_CONTROL_SPACE 0
@ -490,6 +491,7 @@ typedef struct syntaxtype {
#define TOGGLE_WHITESPACE_KEY NANO_ALT_P #define TOGGLE_WHITESPACE_KEY NANO_ALT_P
#define TOGGLE_MORESPACE_KEY NANO_ALT_O #define TOGGLE_MORESPACE_KEY NANO_ALT_O
#define TOGGLE_TABSTOSPACES_KEY NANO_ALT_E #define TOGGLE_TABSTOSPACES_KEY NANO_ALT_E
#define TOGGLE_QUICKBLANK_KEY NANO_ALT_U
#endif /* !NANO_SMALL */ #endif /* !NANO_SMALL */
#define MAIN_VISIBLE 12 #define MAIN_VISIBLE 12

View File

@ -84,6 +84,7 @@ const static rcoption rcopts[] = {
{"cut", CUT_TO_END}, {"cut", CUT_TO_END},
{"historylog", HISTORYLOG}, {"historylog", HISTORYLOG},
{"noconvert", NO_CONVERT}, {"noconvert", NO_CONVERT},
{"quickblank", QUICK_BLANK},
{"smarthome", SMART_HOME}, {"smarthome", SMART_HOME},
{"smooth", SMOOTH_SCROLL}, {"smooth", SMOOTH_SCROLL},
{"tabstospaces", TABS_TO_SPACES}, {"tabstospaces", TABS_TO_SPACES},

View File

@ -2893,7 +2893,11 @@ void statusbar(const char *msg, ...)
} }
disable_cursorpos = TRUE; disable_cursorpos = TRUE;
statusblank = 25; statusblank =
#ifndef NANO_SMALL
ISSET(QUICK_BLANK) ? 1 :
#endif
25;
} }
void bottombars(const shortcut *s) void bottombars(const shortcut *s)