Commit 6fe61499 authored by Chris Allegretta's avatar Chris Allegretta
Browse files

All the updates that I've been waiting all weekend to commit, no desc, tough

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@668 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
No related merge requests found
Showing with 2249 additions and 2161 deletions
+2249 -2161
......@@ -2,7 +2,7 @@ Cvs code -
- General
- New global variables currshortcut and currslen to support using
the mouse with the shortcuts. Also supports clicking on files
in browser.
in browser. Added #ifdef DISABLE_MOUSE around this code also.
- Changed mouse disabling code from depending on --enable-tiny
to its own flag, --disable-mouse. The --tiny option defines
this automatically, but now just mouse support can be disabled
......@@ -23,6 +23,14 @@ Cvs code -
- Changed all string allocations to charalloc(), new function
designed to take nmalloc argument but call calloc based on
(char *) size.
- New macro DISABLE_WRAPJUSTIFY to easily check for both wrapping
and justify being disabled. This allows us to compile out the
-r flag if neither are set, and will also allow us to comment
out -W when it is written.
- Allow fill to take a negative value ot signify a "from right side"
value. This allows the value to vary with the screen size yet
still be correct. New static value wrap_at to minimize code
inpact. Updated man page and info file.
- configure.in:
- New option, --enable-nanorc, which allows people to have a .nanorc
initialization file and set options normally used on the command
......
......@@ -30,6 +30,7 @@ For Next Version:
make global variable pointing to current shortcut list to determine what
keystroke to ungetch(). [DONE].
- Implement -o (chroot of sorts)
- Implement -W (wrap at # less than width of screen), mark -r as deprecated.
- Allow -r to take a negative argument, meaning right margin instead of
left (allows resizing that way), formerly -W arg. [DONE]
$Id$
......@@ -259,8 +259,12 @@ int do_insertfile(void)
char *realname = NULL;
wrap_reset();
#ifndef DISABLE_MOUSE
currshortcut = writefile_list;
currslen = WRITEFILE_LIST_LEN;
#endif
i = statusq(1, writefile_list, WRITEFILE_LIST_LEN, "",
_("File to insert [from ./] "));
if (i != -1) {
......@@ -279,8 +283,10 @@ int do_insertfile(void)
if (i == NANO_TOFILES_KEY) {
char *tmp = do_browse_from(realname);
#ifndef DISABLE_MOUSE
currshortcut = writefile_list;
currslen = WRITEFILE_LIST_LEN;
#endif
#ifdef DISABLE_TABCOMP
realname = NULL;
......@@ -508,8 +514,11 @@ int do_writeout(char *path, int exiting)
static int did_cred = 0;
#endif
#ifndef DISABLE_MOUSE
currshortcut = writefile_list;
currslen = WRITEFILE_LIST_LEN;
#endif
answer = mallocstrcpy(answer, path);
if ((exiting) && (ISSET(TEMP_OPT))) {
......@@ -536,8 +545,11 @@ int do_writeout(char *path, int exiting)
if (i == NANO_TOFILES_KEY) {
char *tmp = do_browse_from(answer);
#ifndef DISABLE_MOUSE
currshortcut = writefile_list;
currslen = WRITEFILE_LIST_LEN;
#endif
if (tmp != NULL)
answer = mallocstrcpy(answer, tmp);
......@@ -1178,8 +1190,11 @@ char *do_browser(char *inpath)
blank_statusbar_refresh();
#ifndef DISABLE_MOUSE
currshortcut = browser_list;
currslen = BROWSER_LIST_LEN;
#endif
editline = 0;
col = 0;
......
......@@ -92,8 +92,10 @@ shortcut browser_list[BROWSER_LIST_LEN];
colorstruct colors[NUM_NCOLORS];
#endif
#ifndef DISABLE_MOUSE
shortcut *currshortcut = main_list; /* Current shortcut list we're using */
int currslen = MAIN_VISIBLE; /* Length of current shortcut list */
#endif
#ifndef NANO_SMALL
toggle toggles[TOGGLE_LEN];
......
......@@ -70,7 +70,9 @@ search and replace strings.
.TP
.B \-r (\-\-fill)
Wrap lines at column #cols. By default, this is the width of the screen,
less eight.
less eight. If this value is negative, wrapping will occur at #cols from
the right of the screen, allowing it to vary along with the screen width
if the screen is resized.
.TP
.B \-s (\-\-speller)
Enable alternative spell checker command.
......
......@@ -93,7 +93,9 @@ search and replace strings.
<DD>
Wrap lines at column #cols. By default, this is the width of the screen,
less eight.
less eight. If this value is negative, wrapping will occur at #cols from
the right of the screen, allowing it to vary along with the screen width
if the screen is resized.
<DT><B>-s (--speller)</B>
<DD>
......@@ -182,6 +184,6 @@ used by others).
This document was created by
<A HREF="http://localhost/cgi-bin/man/man2html">man2html</A>,
using the manual pages.<BR>
Time: 11:22:15 GMT, April 30, 2001
Time: 02:47:57 GMT, May 20, 2001
</BODY>
</HTML>
......@@ -62,8 +62,11 @@
#include <getopt.h>
#endif
#ifndef DISABLE_WRAPJUSTIFY
/* Former globals, now static */
int fill = 0; /* Fill - where to wrap lines, basically */
int wrap_at = 0; /* Right justified fill value, allows resize */
#endif
struct termios oldterm; /* The user's original term settings */
static struct sigaction act; /* For all our fun signal handlers */
......@@ -181,11 +184,15 @@ void global_init(void)
totlines = 0;
placewewant = 0;
if (!fill)
#ifndef DISABLE_WRAPJUSTIFY
if (wrap_at)
fill = COLS + wrap_at;
else if (!fill)
fill = COLS - CHARS_FROM_EOL;
if (fill < MIN_FILL_LENGTH)
die_too_small();
#endif
hblank = charalloc(COLS + 1);
memset(hblank, ' ', COLS);
......@@ -381,9 +388,12 @@ void usage(void)
#endif
printf(_
(" -p --pico Emulate Pico as closely as possible\n"));
#ifndef DISABLE_WRAPJUSTIFY
printf
(_
(" -r [#cols] --fill=[#cols] Set fill cols to (wrap lines at) #cols\n"));
#endif
#ifndef DISABLE_SPELLER
printf(_
(" -s [prog] --speller=[prog] Enable alternate speller\n"));
......@@ -422,8 +432,11 @@ void usage(void)
#endif
#endif
printf(_(" -p Emulate Pico as closely as possible\n"));
#ifndef DISABLE_WRAPJUSTIFY
printf(_
(" -r [#cols] Set fill cols to (wrap lines at) #cols\n"));
#endif
#ifndef DISABLE_SPELLER
printf(_(" -s [prog] Enable alternate speller\n"));
#endif
......@@ -1672,8 +1685,10 @@ void handle_sigwinch(int s)
if ((editwinrows = LINES - 5 + no_help()) < MIN_EDITOR_ROWS)
die_too_small();
#ifndef DISABLE_WRAPJUSTIFY
if ((fill = COLS - CHARS_FROM_EOL) < MIN_FILL_LENGTH)
die_too_small();
#endif
hblank = nrealloc(hblank, COLS + 1);
memset(hblank, ' ', COLS);
......@@ -2243,7 +2258,10 @@ int main(int argc, char *argv[])
#ifndef DISABLE_SPELLER
{"speller", 1, 0, 's'},
#endif
#ifndef DISABLE_WRAPJUSTIFY
{"fill", 1, 0, 'r'},
#endif
{"mouse", 0, 0, 'm'},
{"pico", 0, 0, 'p'},
{"nofollow", 0, 0, 'l'},
......@@ -2323,12 +2341,20 @@ int main(int argc, char *argv[])
SET(PICO_MODE);
break;
case 'r':
#ifndef DISABLE_WRAPJUSTIFY
fill = atoi(optarg);
if (fill <= 0) {
if (fill < 0)
wrap_at = fill;
else if (fill == 0) {
usage(); /* To stop bogus data (like a string) */
finish(1);
}
break;
#else
usage();
exit(0);
#endif
#ifndef DISABLE_SPELLER
case 's':
alt_speller = charalloc(strlen(optarg) + 1);
......@@ -2461,8 +2487,10 @@ int main(int argc, char *argv[])
while (1) {
#ifndef DISABLE_MOUSE
currshortcut = main_list;
currslen = MAIN_VISIBLE;
#endif
#ifndef _POSIX_VDISABLE
/* We're going to have to do it the old way, i.e. on cygwin */
......
......@@ -63,6 +63,10 @@
#define VERMSG "GNU nano " VERSION
#if defined(DISABLE_WRAPPING) && defined(DISABLE_JUSTIFY)
#define DISABLE_WRAPJUSTIFY 1
#endif
/* Structure types */
typedef struct filestruct {
char *data;
......
......@@ -97,7 +97,9 @@ Command Line Options
`-r [#cols], --fill=[#cols].'
Wrap lines at column #cols. By default this is the width of the
screen, less eight.
screen, less eight. If this value is negative, wrapping will occur
at #cols from the right of the screen, allowing it to vary along
with the screen width if the screen is resized.
`-s [prog], --speller=[prog]'
Invoke [prog] as the spell checker. By default, `nano' uses its
......@@ -393,17 +395,17 @@ Node: Top199
Node: Introduction507
Node: Overview933
Node: Command Line Options1513
Ref: Expert Mode3235
Node: Editor Basics4078
Node: Entering Text4303
Node: Special Functions4643
Node: The Titlebar5498
Node: The Statusbar6196
Node: Shortcut Lists6777
Node: Online Help7170
Node: Feature Toggles7546
Node: The File Browser8689
Node: Pico Compatibility9398
Node: Building and Configure Options11440
Ref: Expert Mode3405
Node: Editor Basics4248
Node: Entering Text4473
Node: Special Functions4813
Node: The Titlebar5668
Node: The Statusbar6366
Node: Shortcut Lists6947
Node: Online Help7340
Node: Feature Toggles7716
Node: The File Browser8859
Node: Pico Compatibility9568
Node: Building and Configure Options11610

End Tag Table
......@@ -145,7 +145,9 @@ emulation. @xref{Pico Compatibility}, for more info.
@item -r [#cols], --fill=[#cols].
Wrap lines at column #cols. By default this is the width of the screen,
less eight.
less eight. If this value is negative, wrapping will occur at #cols from
the right of the screen, allowing it to vary along with the screen width
if the screen is resized.
@item -s [prog], --speller=[prog]
Invoke [prog] as the spell checker. By default, @code{nano} uses its
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment