Index: gedit/gedit-commands-file.c
===================================================================
RCS file: /cvs/gnome/gedit/gedit/gedit-commands-file.c,v
retrieving revision 1.15
diff -u -p -u -p -r1.15 gedit-commands-file.c
--- gedit/gedit-commands-file.c	7 Dec 2006 23:33:28 -0000	1.15
+++ gedit/gedit-commands-file.c	9 Dec 2006 17:28:42 -0000
@@ -958,7 +958,8 @@ _gedit_cmd_file_save_as (GtkAction   *ac
  */
 void
 _gedit_cmd_file_save_documents_list (GeditWindow *window,
-				     GList       *docs)
+				     GList       *docs,
+				     gboolean     save_unmodified)
 {
 	GList *l;
 	GSList *tabs_to_save_as = NULL;
@@ -1005,7 +1006,13 @@ _gedit_cmd_file_save_documents_list (Ged
 			}
 			else
 			{
-				file_save (t, window);			
+				/* skip unmodified docs unless we are
+				   told otherwise */
+				if (save_unmodified ||
+				    gtk_text_buffer_get_modified (GTK_TEXT_BUFFER (doc)))
+				{
+					file_save (t, window);
+				}
 			}
 		}
 		else
@@ -1074,7 +1081,7 @@ _gedit_cmd_file_save_all (GtkAction   *a
 
 	docs = gedit_window_get_documents (window);
 
-	_gedit_cmd_file_save_documents_list (window, docs);
+	_gedit_cmd_file_save_documents_list (window, docs, FALSE);
 
 	g_list_free (docs);
 }
Index: gedit/gedit-commands.h
===================================================================
RCS file: /cvs/gnome/gedit/gedit/gedit-commands.h,v
retrieving revision 1.20
diff -u -p -u -p -r1.20 gedit-commands.h
--- gedit/gedit-commands.h	2 Dec 2006 15:03:22 -0000	1.20
+++ gedit/gedit-commands.h	9 Dec 2006 17:28:42 -0000
@@ -149,7 +149,8 @@ void		_gedit_cmd_file_close_tab 		(Gedit
 							 GeditWindow *window);
 
 void		_gedit_cmd_file_save_documents_list	(GeditWindow *window,
-							 GList       *docs);
+							 GList       *docs,
+							 gboolean     save_unmodified);
 
 G_END_DECLS
 
Index: gedit/gedit-session.c
===================================================================
RCS file: /cvs/gnome/gedit/gedit/gedit-session.c,v
retrieving revision 1.13
diff -u -p -u -p -r1.13 gedit-session.c
--- gedit/gedit-session.c	22 May 2006 15:53:10 -0000	1.13
+++ gedit/gedit-session.c	9 Dec 2006 17:28:42 -0000
@@ -393,7 +393,7 @@ close_confirmation_dialog_response_handl
 					   GEDIT_SESSION_LIST_OF_DOCS_TO_SAVE,
 					   selected_documents);
 
-			_gedit_cmd_file_save_documents_list (window, selected_documents);
+			_gedit_cmd_file_save_documents_list (window, selected_documents, TRUE);
 
 			/* FIXME: also need to lock the window to prevent further changes... */
 
