diff --git a/ChangeLog b/ChangeLog
index 799c1ca13eaf3dee13bcda1fef0bdc3639b7915e..72317981ad60ee82ffd7c24c31aca4e3632b70cb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -33,6 +33,9 @@ CVS code -
 	  NANO_SMALL is defined. (DLR)
 	- Source reorganization: move code to src/, docs to doc/. (Jordi)
 	- Translation updates (see po/ChangeLog for details).
+	- Since SAMELINEWRAP is only used in nano.c, make it a static
+	  variable in nano.c instead of a flag, and surround all
+	  wrap_reset() calls with DISABLE_WRAPPING  #ifdefs. (DLR)
 - files.c:
   do_browser()
 	- Some of the Pico compatibility options in the file browser
@@ -80,6 +83,10 @@ CVS code -
   page_up()
 	- Removed due to rewrite of movement functions. (David
 	  Benbennick)
+- proto.h:
+	- Surround the do_prev_word() and do_next_word() prototypes with
+	  NANO_SMALL #ifdefs, since the actual functions aren't included
+	  in tiny mode. (DLR)
 - rcfile.c:
   parse_colors()
 	- Generate an error if we try to use a bright background color
diff --git a/src/cut.c b/src/cut.c
index 80af25ca5ab0798e6e03bcdeec6346b874f0d13a..b64de25181c88c735b174628c900957617649488 100644
--- a/src/cut.c
+++ b/src/cut.c
@@ -322,7 +322,9 @@ int do_uncut_text(void)
     filestruct *hold = current;
     int i;
 
+#ifndef DISABLE_WRAPPING
     wrap_reset();
+#endif
     check_statblank();
     if (cutbuffer == NULL || fileptr == NULL)
 	return 0;		/* AIEEEEEEEEEEEE */
diff --git a/src/files.c b/src/files.c
index c918eb7d54b5987261c2aa0823ee5ccd6582a058..309b82d7495be17c84bbd4fcc62ec073ddd6532d 100644
--- a/src/files.c
+++ b/src/files.c
@@ -427,7 +427,9 @@ int do_insertfile(int loading_file)
 	inspath[0] = '\0';
     }
 
+#ifndef DISABLE_WRAPPING
     wrap_reset();
+#endif
 
 #if !defined(DISABLE_BROWSER) || !defined(NANO_SMALL) && defined(ENABLE_MULTIBUFFER)
   start_again:	/* Goto here when the user cancels the file browser. */
diff --git a/src/move.c b/src/move.c
index 52fd5070b0a55cd43363792590624e31f6f9a89a..cf088b52162c97ae0635932d0e476b698b461a81 100644
--- a/src/move.c
+++ b/src/move.c
@@ -49,7 +49,9 @@ int do_page_up(void)
 {
     int i;
 
+#ifndef DISABLE_WRAPPING
     wrap_reset();
+#endif
 
     /* If edittop is the first line of the file, move current up there
      * and put the cursor at the beginning of the line. */
@@ -91,7 +93,9 @@ int do_page_down(void)
 {
     int i;
 
+#ifndef DISABLE_WRAPPING
     wrap_reset();
+#endif
 
     /* If the last line of the file is onscreen, move current down
      * there and put the cursor at the beginning of the line. */
@@ -131,7 +135,9 @@ int do_page_down(void)
 
 int do_up(void)
 {
+#ifndef DISABLE_WRAPPING
     wrap_reset();
+#endif
     check_statblank();
 
     if (current->prev == NULL)
@@ -159,7 +165,9 @@ int do_up(void)
  * bottom. */
 int do_down(void)
 {
+#ifndef DISABLE_WRAPPING
     wrap_reset();
+#endif
     check_statblank();
 
     if (current->next == NULL)
diff --git a/src/nano.c b/src/nano.c
index 3d3682905aae462235eeab9e47cdedabf4c1990c..f020735cfb7eeb7672bbbdf0e68791056aad5e02 100644
--- a/src/nano.c
+++ b/src/nano.c
@@ -57,6 +57,10 @@
 #ifndef DISABLE_WRAPJUSTIFY
 static int fill = 0;	/* Fill - where to wrap lines, basically */
 #endif
+#ifndef DISABLE_WRAPPING
+static int same_line_wrap = 0;	/* Whether wrapped text should be
+				   prepended to the next line */
+#endif
 
 static struct termios oldterm;	/* The user's original term settings */
 static struct sigaction act;	/* For all our fun signal handlers */
@@ -1299,10 +1303,12 @@ int do_mark(void)
     return 1;
 }
 
+#ifndef DISABLE_WRAPPING
 void wrap_reset(void)
 {
-    UNSET(SAMELINEWRAP);
+    same_line_wrap = 0;
 }
+#endif
 
 #ifndef DISABLE_WRAPPING
 /* We wrap the given line.  Precondition: we assume the cursor has been 
@@ -1387,7 +1393,7 @@ int do_wrap(filestruct *inptr)
     /* We prepend the wrapped text to the next line, if the flag is set,
      * and there is a next line, and prepending would not make the line
      * too long. */
-    if (ISSET(SAMELINEWRAP) && inptr->next) {
+    if (same_line_wrap && inptr->next) {
 	wrap_line = inptr->next->data;
 	wrap_line_len = strlen(wrap_line);
 
@@ -1465,7 +1471,7 @@ int do_wrap(filestruct *inptr)
  * other sundry things. */
 
     /* later wraps of this line will be prepended to the next line. */
-    SET(SAMELINEWRAP);
+    same_line_wrap = 1;
 
     /* Each line knows its line number.  We recalculate these if we
      * inserted a new line. */
diff --git a/src/nano.h b/src/nano.h
index be6c0e9327ea47fa0235d382363c753c638b5674..0945f0e5e5406db5058dd75e1f92a54a752e7793 100644
--- a/src/nano.h
+++ b/src/nano.h
@@ -40,11 +40,12 @@
 #endif
 
 #ifndef NANO_SMALL
-  /* For the backup file copy ... */
-# define COPYFILEBLOCKSIZE 1024
+/* For the backup file copy ... */
+#define COPYFILEBLOCKSIZE 1024
 #endif
 
-#ifdef USE_SLANG	/* Slang support enabled */
+#ifdef USE_SLANG
+/* Slang support enabled */
 #include <slcurses.h>
 #define KEY_DC SL_KEY_DELETE
 #define KEY_IC SL_KEY_IC
@@ -53,7 +54,7 @@
 #elif defined(HAVE_NCURSES_H)
 #include <ncurses.h>
 #else /* Uh oh */
-#include <curses.h> 
+#include <curses.h>
 #endif /* CURSES_H */
 
 #ifdef ENABLE_NLS
@@ -233,28 +234,27 @@ typedef struct historyheadtype {
 #define SUSPEND			(1<<7)
 #define NO_WRAP			(1<<8)
 #define AUTOINDENT		(1<<9)
-#define SAMELINEWRAP		(1<<10)
-#define VIEW_MODE		(1<<11)
-#define USE_MOUSE		(1<<12)
-#define USE_REGEXP		(1<<13)
-#define REGEXP_COMPILED		(1<<14)
-#define TEMP_OPT		(1<<15)
-#define CUT_TO_END		(1<<16)
-#define REVERSE_SEARCH		(1<<17)
-#define MULTIBUFFER		(1<<18)
-#define DOS_FILE		(1<<19)
-#define MAC_FILE		(1<<20)
-#define SMOOTHSCROLL		(1<<21)
-#define DISABLE_CURPOS		(1<<22)	/* Damn, we still need it */
-#define REBIND_DELETE		(1<<23)
-#define NO_CONVERT		(1<<24)
-#define BACKUP_FILE		(1<<25)
-#define NO_RCFILE		(1<<26)
-#define COLOR_SYNTAX		(1<<27)
-#define PRESERVE		(1<<28)
-#define HISTORY_CHANGED		(1<<29)
-#define HISTORYLOG		(1<<30)
-#define JUSTIFY_MODE		(1<<31)
+#define VIEW_MODE		(1<<10)
+#define USE_MOUSE		(1<<11)
+#define USE_REGEXP		(1<<12)
+#define REGEXP_COMPILED		(1<<13)
+#define TEMP_OPT		(1<<14)
+#define CUT_TO_END		(1<<15)
+#define REVERSE_SEARCH		(1<<16)
+#define MULTIBUFFER		(1<<17)
+#define DOS_FILE		(1<<18)
+#define MAC_FILE		(1<<19)
+#define SMOOTHSCROLL		(1<<20)
+#define DISABLE_CURPOS		(1<<21)	/* Damn, we still need it */
+#define REBIND_DELETE		(1<<22)
+#define NO_CONVERT		(1<<23)
+#define BACKUP_FILE		(1<<24)
+#define NO_RCFILE		(1<<25)
+#define COLOR_SYNTAX		(1<<26)
+#define PRESERVE		(1<<27)
+#define HISTORY_CHANGED		(1<<28)
+#define HISTORYLOG		(1<<29)
+#define JUSTIFY_MODE		(1<<30)
 
 /* Control key sequences, changing these would be very very bad */
 
diff --git a/src/proto.h b/src/proto.h
index 7ba235c7a61bb710d90a125bdd805ecc0bf8666b..ab7fad19d7e4ff99da3de7ac514f4781b714cf1c 100644
--- a/src/proto.h
+++ b/src/proto.h
@@ -274,11 +274,13 @@ int do_backspace(void);
 int do_delete(void);
 int do_tab(void);
 int do_enter(void);
+#ifndef NANO_SMALL
 int do_next_word(void);
 int do_prev_word(void);
+#endif
 int do_mark(void);
-void wrap_reset(void);
 #ifndef DISABLE_WRAPPING
+void wrap_reset(void);
 int do_wrap(filestruct *inptr);
 #endif
 #ifndef DISABLE_SPELLER
diff --git a/src/search.c b/src/search.c
index c87e1aa336e49252206c8d88c4eb51fb91ad9195..43fbd65d5345f0834006beb53c4ca34128e47938 100644
--- a/src/search.c
+++ b/src/search.c
@@ -385,7 +385,9 @@ int do_search(void)
     filestruct *fileptr = current, *didfind;
     int fileptr_x = current_x;
 
+#ifndef DISABLE_WRAPPING
     wrap_reset();
+#endif
     i = search_init(0);
     switch (i) {
     case -1:
@@ -439,7 +441,9 @@ int do_research(void)
     const char *regex_error = _("Invalid regex \"%s\"");
 #endif /* HAVE_REGEX_H */
 
+#ifndef DISABLE_WRAPPING
     wrap_reset();
+#endif
     search_init_globals();
 
     if (last_search[0] != '\0') {