[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Nano-devel] [patch][rfc] reenable wrapping
From: |
Alexey Toptygin |
Subject: |
[Nano-devel] [patch][rfc] reenable wrapping |
Date: |
Wed, 13 Jul 2005 15:47:18 +0000 (UTC) |
I've made a patch against nano-1.2.5 that lets you re-enable wrapping with
-W or --wrap on the command line if it has been disabled with "nowrap" in
nanorc or with --disable-wrapping-as-root. Please tell me what you think.
If people think this is a good idea, I'll make an adapted version for
1.3.8 as well.
Alexey
---
diff -Nru nano-1.2.5/nano.1 nano-1.2.5-mine/nano.1
--- nano-1.2.5/nano.1 2003-06-28 22:25:46.000000000 -0400
+++ nano-1.2.5-mine/nano.1 2005-07-12 18:21:25.331678688 -0400
@@ -88,6 +88,12 @@
.B \-V (\-\-version)
Show the current version number and author.
.TP
+.B \-W (\-\-wrap)
+Override "nowrap" from
+.I .nanorc
+or the \-\-disable\-wrapping\-as\-root configure option from the command
+line.
+.TP
.B \-Y \fIstr\fP (\-\-syntax=\fIstr\fP)
Specify a specific syntax highlighting from the
.I .nanorc
diff -Nru nano-1.2.5/nano.1.html nano-1.2.5-mine/nano.1.html
--- nano-1.2.5/nano.1.html 2003-06-28 22:25:46.000000000 -0400
+++ nano-1.2.5-mine/nano.1.html 2005-07-12 18:26:17.776220360 -0400
@@ -1,4 +1,7 @@
-<HTML><HEAD><TITLE>Manpage of NANO</TITLE>
+Content-type: text/html
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<HTML><HEAD><TITLE>Man page of NANO</TITLE>
</HEAD><BODY>
<H1>NANO</H1>
Section: User Commands (1)<BR>Updated: June 19, 2003<BR><A
HREF="#index">Index</A>
@@ -114,6 +117,14 @@
<DD>
Show the current version number and author.
+<DT><B>-W (--wrap)</B>
+
+<DD>
+Override "nowrap" from
+<I>.nanorc</I>
+
+or the --disable-wrapping-as-root configure option from the command
+line.
<DT><B>-Y </B><I>str</I> (--syntax=<I>str</I>)
<DD>
@@ -293,6 +304,6 @@
This document was created by
<A HREF="http://localhost/cgi-bin/man/man2html">man2html</A>,
using the manual pages.<BR>
-Time: 22:27:55 GMT, June 19, 2003
+Time: 22:26:17 GMT, July 12, 2005
</BODY>
</HTML>
diff -Nru nano-1.2.5/nano.c nano-1.2.5-mine/nano.c
--- nano-1.2.5/nano.c 2005-03-22 10:04:02.000000000 -0500
+++ nano-1.2.5-mine/nano.c 2005-07-12 18:02:12.704904592 -0400
@@ -3039,6 +3039,7 @@
const shortcut *s;
int keyhandled = 0; /* Have we handled the keystroke yet? */
int kbinput = -1; /* Input from keyboard */
+ int do_wrap = 0; /* override NO_WRAP from command line */
#ifndef NANO_SMALL
const toggle *t;
@@ -3090,6 +3091,7 @@
{"view", 0, 0, 'v'},
#ifndef DISABLE_WRAPPING
{"nowrap", 0, 0, 'w'},
+ {"wrap", 0, 0, 'W'},
#endif
{"nohelp", 0, 0, 'x'},
{"suspend", 0, 0, 'z'},
@@ -3120,11 +3122,11 @@
#endif
#ifdef HAVE_GETOPT_LONG
- while ((optchr = getopt_long(argc, argv,
"h?BDFHIKMNQ:RST:VY:abcefgijklmo:pr:s:tvwxz",
+ while ((optchr = getopt_long(argc, argv,
"h?BDFHIKMNQ:RST:VWY:abcefgijklmo:pr:s:tvwxz",
long_options, &option_index)) != -1) {
#else
while ((optchr =
- getopt(argc, argv, "h?BDFHIKMNQ:RST:VY:abcefgijklmo:pr:s:tvwxz"))
!= -1) {
+ getopt(argc, argv, "h?BDFHIKMNQ:RST:VWY:abcefgijklmo:pr:s:tvwxz"))
!= -1) {
#endif
switch (optchr) {
@@ -3207,6 +3209,11 @@
case 'V':
version();
exit(0);
+#ifndef DISABLE_WRAPPING
+ case 'W':
+ do_wrap = 1;
+ break;
+#endif
#ifdef ENABLE_COLOR
case 'Y':
syntaxstr = mallocstrcpy(syntaxstr, optarg);
@@ -3349,6 +3356,11 @@
#endif
#endif /* ENABLE_NANORC */
+#ifndef DISABLE_WRAPPING
+ if ( do_wrap )
+ UNSET(NO_WRAP);
+#endif
+
#ifndef NANO_SMALL
history_init();
#ifdef ENABLE_NANORC
diff -Nru nano-1.2.5/nano.info nano-1.2.5-mine/nano.info
--- nano-1.2.5/nano.info 2005-05-15 23:51:16.000000000 -0400
+++ nano-1.2.5-mine/nano.info 2005-07-12 18:49:33.715005408 -0400
@@ -1,4 +1,4 @@
-This is ./nano.info, produced by makeinfo version 4.6 from ./nano.texi.
+This is ./nano.info, produced by makeinfo version 4.7 from ./nano.texi.
INFO-DIR-SECTION Editors
START-INFO-DIR-ENTRY
@@ -104,6 +104,11 @@
`-V, --version'
Print the version number and copyright and quit.
+`-W, --wrap'
+ Override "nowrap" from .nanorc or the
+ (`--disable-wrapping-as-root') configure option from the command
+ line.
+
`-Y, --syntax=[str]'
Specify a specific syntax highlighting from the .nanorc to use, if
available.
@@ -474,17 +479,17 @@
Node: Introduction513
Node: Overview936
Node: Command Line Options1421
-Ref: Expert Mode4478
-Node: Editor Basics5390
-Node: Entering Text5615
-Node: Special Functions5953
-Node: The Titlebar6805
-Node: The Statusbar7501
-Node: Shortcut Lists8080
-Node: Online Help8328
-Node: Feature Toggles8701
-Node: The File Browser10146
-Node: Pico Compatibility10853
-Node: Building and Configure Options13493
+Ref: Expert Mode4616
+Node: Editor Basics5528
+Node: Entering Text5753
+Node: Special Functions6091
+Node: The Titlebar6943
+Node: The Statusbar7639
+Node: Shortcut Lists8218
+Node: Online Help8466
+Node: Feature Toggles8839
+Node: The File Browser10284
+Node: Pico Compatibility10991
+Node: Building and Configure Options13631
End Tag Table
diff -Nru nano-1.2.5/nano.texi nano-1.2.5-mine/nano.texi
--- nano-1.2.5/nano.texi 2005-05-15 23:51:16.000000000 -0400
+++ nano-1.2.5-mine/nano.texi 2005-07-12 18:38:48.635072464 -0400
@@ -154,6 +154,10 @@
@item -V, --version
Print the version number and copyright and quit.
address@hidden -W, --wrap
+Override "nowrap" from .nanorc or the (@code{--disable-wrapping-as-root})
+configure option from the command line.
+
@item -Y, --syntax=[str]
Specify a specific syntax highlighting from the .nanorc to use, if
available.
- [Nano-devel] [patch][rfc] reenable wrapping,
Alexey Toptygin <=