Index: runtime/doc/options.txt
===================================================================
--- runtime/doc/options.txt	(revision 984)
+++ runtime/doc/options.txt	(working copy)
@@ -2391,16 +2391,16 @@
 'endofline' 'eol'	boolean	(default on)
 			local to buffer
 			{not in Vi}
-	When writing a file and this option is off and the 'binary' option
-	is on, no <EOL> will be written for the last line in the file.  This
-	option is automatically set when starting to edit a new file, unless
-	the file does not have an <EOL> for the last line in the file, in
-	which case it is reset.  Normally you don't have to set or reset this
-	option.  When 'binary' is off the value is not used when writing the
-	file.  When 'binary' is on it is used to remember the presence of a
-	<EOL> for the last line in the file, so that when you write the file
-	the situation from the original file can be kept.  But you can change
-	it if you want to.
+	When writing a file and this option is off, no <EOL> will be written
+	for the last line in the file.  This option is automatically set when
+	starting to edit a new file, unless the file does not have an <EOL>
+	for the last line in the file, in which case it is reset.  Normally
+	you don't have to set or reset this option, the situation from the
+	original file will be kept.  But you can change it if you want to.
+	If you prefer Vim to automatically add the <EOL> to text files that
+	don't have it, add the following to your .vimrc: >
+	    au BufWritePre * if !&bin | set eol | endif
+<
 
 			     *'equalalways'* *'ea'* *'noequalalways'* *'noea'*
 'equalalways' 'ea'	boolean	(default on)
Index: src/netbeans.c
===================================================================
--- src/netbeans.c	(revision 984)
+++ src/netbeans.c	(working copy)
@@ -3455,7 +3455,7 @@
 	    }
 	}
 	/* Correction for when last line doesn't have an EOL. */
-	if (!bufp->b_p_eol && bufp->b_p_bin)
+	if (!bufp->b_p_eol)
 	    char_count -= eol_size;
     }
 
Index: src/option.c
===================================================================
--- src/option.c	(revision 984)
+++ src/option.c	(working copy)
@@ -8192,7 +8192,7 @@
     else
     {
 	/* Special case: 'modified' is b_changed, but we also want to consider
-	 * it set when 'ff' or 'fenc' changed. */
+	 * it set when 'ff', 'fenc' or 'eol' changed. */
 	if ((int *)varp == &curbuf->b_changed)
 	    *numval = curbufIsChanged();
 	else
@@ -8494,7 +8494,7 @@
 
     varp = get_varp_scope(p, opt_flags);
 
-    /* for 'modified' we also need to check if 'ff' or 'fenc' changed. */
+    /* for 'modified' we also need to check if 'ff', 'fenc' or 'eol' changed. */
     if ((p->flags & P_BOOL) && ((int *)varp == &curbuf->b_changed
 					? !curbufIsChanged() : !*(int *)varp))
 	MSG_PUTS("no");
@@ -10623,8 +10623,9 @@
 }
 
 /*
- * Save the current values of 'fileformat' and 'fileencoding', so that we know
- * the file must be considered changed when the value is different.
+ * Save the current values of 'fileformat', 'fileencoding' and 'endofline', so
+ * that we know the file must be considered changed when the value is
+ * different.
  */
     void
 save_file_ff(buf)
@@ -10646,10 +10647,9 @@
 }
 
 /*
- * Return TRUE if 'fileformat' and/or 'fileencoding' has a different value
- * from when editing started (save_file_ff() called).
- * Also when 'endofline' was changed and 'binary' is set, or when 'bomb' was
- * changed and 'binary' is not set.
+ * Return TRUE if 'fileformat', 'fileencoding' and/or 'endofline' has a
+ * different value from when editing started (save_file_ff() called).
+ * Also when 'bomb' was changed and 'binary' is not set.
  * Don't consider a new, empty buffer to be changed.
  */
     int
@@ -10665,7 +10665,7 @@
 	return FALSE;
     if (buf->b_start_ffc != *buf->b_p_ff)
 	return TRUE;
-    if (buf->b_p_bin && buf->b_start_eol != buf->b_p_eol)
+    if (buf->b_start_eol != buf->b_p_eol)
 	return TRUE;
 #ifdef FEAT_MBYTE
     if (!buf->b_p_bin && buf->b_start_bomb != buf->b_p_bomb)
Index: src/os_unix.c
===================================================================
--- src/os_unix.c	(revision 984)
+++ src/os_unix.c	(working copy)
@@ -4022,8 +4022,8 @@
 				/* Finished a line, add a NL, unless this line
 				 * should not have one. */
 				if (lnum != curbuf->b_op_end.lnum
-					|| !curbuf->b_p_bin
-					|| (lnum != write_no_eol_lnum
+					|| ((!curbuf->b_p_bin
+					    || lnum != write_no_eol_lnum)
 					    && (lnum !=
 						    curbuf->b_ml.ml_line_count
 						    || curbuf->b_p_eol)))
Index: src/memline.c
===================================================================
--- src/memline.c	(revision 984)
+++ src/memline.c	(working copy)
@@ -4812,8 +4812,8 @@
 	if (ffdos)
 	    size += lnum - 1;
 
-	/* Don't count the last line break if 'bin' and 'noeol'. */
-	if (buf->b_p_bin && !buf->b_p_eol)
+	/* Don't count the last line break if 'noeol'. */
+	if (!buf->b_p_eol)
 	    size -= ffdos + 1;
     }
 
Index: src/ops.c
===================================================================
--- src/ops.c	(revision 984)
+++ src/ops.c	(working copy)
@@ -6332,7 +6332,6 @@
 					   &char_count_cursor, len, eol_size);
 		    if (lnum == curbuf->b_ml.ml_line_count
 			    && !curbuf->b_p_eol
-			    && curbuf->b_p_bin
 			    && (long)STRLEN(s) < len)
 			byte_count_cursor -= eol_size;
 		}
@@ -6357,7 +6356,7 @@
 	}
 
 	/* Correction for when last line doesn't have an EOL. */
-	if (!curbuf->b_p_eol && curbuf->b_p_bin)
+	if (!curbuf->b_p_eol)
 	    byte_count -= eol_size;
 
 #ifdef FEAT_VISUAL
Index: src/fileio.c
===================================================================
--- src/fileio.c	(revision 984)
+++ src/fileio.c	(working copy)
@@ -4201,8 +4205,7 @@
 	/* write failed or last line has no EOL: stop here */
 	if (end == 0
 		|| (lnum == end
-		    && write_bin
-		    && (lnum == write_no_eol_lnum
+		    && ((write_bin && lnum == write_no_eol_lnum)
 			|| (lnum == buf->b_ml.ml_line_count && !buf->b_p_eol))))
 	{
 	    ++lnum;			/* written the line, count it */
