From: David Lawrence Ramsey Date: Tue, 3 Jan 2006 04:53:41 +0000 (+0000) Subject: sort the default strings for brackets and punct, and the "or" atom in X-Git-Tag: v1.3.11~70 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=5329f23345ca56c7cef4fe83aae59ed0620e49e2;p=nano.git sort the default strings for brackets and punct, and the "or" atom in the default regex string for quotestr, in order according to ASCII, and add minor related documentation updates git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3256 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- diff --git a/ChangeLog b/ChangeLog index c0114395..e4fd9baa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,10 @@ CVS code - - Miscellaneous comment fixes. (DLR) - Remove unnecessary #ifdef around termios.h #include in nano.c. (DLR) + - Sort the default strings for brackets and punct, and the "or" + atom in the default regex string for quotestr, according to + ASCII. Changes to main(), nano.1, nanorc.5, and + nanorc.sample. (DLR) - winio.c: edit_scroll() - Redraw the lines before and after the scrolled region even if @@ -11,6 +15,13 @@ CVS code - screen down one line and leaves the cursor on the last line of the screen, in which case we need to update the line after the scrolled region. (DLR) +- doc/nano.1: + - Better display the default values for quotestr. (DLR) +- doc/nanorc.5: + - Give the default values for the brackets and punct options, + and better display the default values for quotestr. (DLR) +- doc/nanorc.sample: + - Remove unneeded comment. (DLR) GNU nano 1.3.10 - 2005.12.23 - General: diff --git a/doc/man/nano.1 b/doc/man/nano.1 index 9e87ccc9..208ae6aa 100644 --- a/doc/man/nano.1 +++ b/doc/man/nano.1 @@ -6,7 +6,7 @@ .\" Public License for copying conditions. There is NO warranty. .\" .\" $Id$ -.TH NANO 1 "version 1.3.10" "November 21, 2005" +.TH NANO 1 "version 1.3.10" "January 02, 2006" .\" Please adjust this date whenever revising the manpage. .\" @@ -84,8 +84,8 @@ Use the blank line below the titlebar as extra editing space. .TP .B \-Q \fIstr\fP (\-\-quotestr=\fIstr\fP) Set the quoting string for justifying. The default is -"^([\ \\t]*[|>:}#])+" if regular expression support is available, or -">\ " otherwise. +"\fI^([\ \\t]*[#:>\\|}])+\fP" if regular expression support is +available, or "\fI>\ \fP" otherwise. .TP .B \-R (\-\-restricted) Restricted mode: Don't read or write to any file not specified on the diff --git a/doc/man/nanorc.5 b/doc/man/nanorc.5 index 1a63dd8b..6cc11e67 100644 --- a/doc/man/nanorc.5 +++ b/doc/man/nanorc.5 @@ -6,7 +6,7 @@ .\" Public License for copying conditions. There is NO warranty. .\" .\" $Id$ -.TH NANORC 5 "version 1.3.10" "November 21, 2005" +.TH NANORC 5 "version 1.3.10" "January 02, 2006" .\" Please adjust this date whenever revising the manpage. .\" .SH NAME @@ -56,7 +56,8 @@ Do backwards searches by default. .B set brackets "\fIstring\fP" Set the characters treated as closing brackets. They cannot contain blank characters. Only closing punctuation, optionally followed by -closing brackets, can end sentences. +closing brackets, can end sentences. The default value is +"\fI"')>]}\fP". .TP .B set/unset casesensitive Do case sensitive searches by default. @@ -113,7 +114,7 @@ Preserve the XON and XOFF keys (^Q and ^S). .B set punct "\fIstring\fP" Set the characters treated as closing punctuation. They cannot contain blank characters. Only closing punctuation, optionally followed by -closing brackets, can end sentences. +closing brackets, can end sentences. The default value is "\fI!.?\fP". .TP .B set/unset quickblank Do quick statusbar blanking. Statusbar messages will disappear after 1 @@ -123,11 +124,8 @@ keystroke instead of 25. The email-quote string, used to justify email-quoted paragraphs. This is an "extended regular expression" if your system supports them, otherwise a literal string. The default value is - - set quotestr "^([\ \\t]*[|>:}#])+" - -if you have regexps, otherwise set quotestr ">\ ". Note that '\\t' -above stands for a literal Tab character. +"\fI^([\ \\t]*[#:>\\|}])+\fP" if you have regexps, or "\fI>\ \fP" +otherwise. Note that '\\t' stands for a literal Tab character. .TP .B set/unset rebinddelete Interpret the Delete key differently so that both Backspace and Delete diff --git a/doc/nanorc.sample b/doc/nanorc.sample index 2c289a2d..623e34bd 100644 --- a/doc/nanorc.sample +++ b/doc/nanorc.sample @@ -24,7 +24,7 @@ ## blank characters. Only closing punctuation, optionally followed by ## closing brackets, can end sentences. ## -# set brackets "'")}]>" +# set brackets ""')>]}" ## Do case sensitive searches by default. # set casesensitive @@ -87,7 +87,7 @@ ## blank characters. Only closing punctuation, optionally followed by ## closing brackets, can end sentences. ## -# set punct ".?!" +# set punct "!.?" ## Do quick statusbar blanking. Statusbar messages will disappear after ## 1 keystroke instead of 25. Note that "const" cancels this out. @@ -97,11 +97,9 @@ ## The email-quote string, used to justify email-quoted paragraphs. ## This is an extended regular expression if your system supports them, ## otherwise a literal string. Default: -# set quotestr "^([ ]*[\|>:}#])+" +# set quotestr "^([ ]*[#:>\|}])+" ## if you have regexps, otherwise: # set quotestr "> " -## You can get old nano quoted-justify behavior via: -# set quotestr "(> )+" ## Fix Backspace/Delete confusion problem. # set rebinddelete diff --git a/src/nano.c b/src/nano.c index b0033b17..a4f486a7 100644 --- a/src/nano.c +++ b/src/nano.c @@ -1956,15 +1956,15 @@ int main(int argc, char **argv) #ifndef DISABLE_JUSTIFY if (punct == NULL) - punct = mallocstrcpy(NULL, ".?!"); + punct = mallocstrcpy(NULL, "!.?"); if (brackets == NULL) - brackets = mallocstrcpy(NULL, "'\")}]>"); + brackets = mallocstrcpy(NULL, "\"')>]}"); if (quotestr == NULL) quotestr = mallocstrcpy(NULL, #ifdef HAVE_REGEX_H - "^([ \t]*[|>:}#])+" + "^([ \t]*[#:>|}])+" #else "> " #endif