patch 8.0.0953: get "no write since last change" error in terminal window

Problem:    Get "no write since last change" error in terminal window.
Solution:   Use another message when closing a terminal window. Make ":quit!"
            also end the job.
diff --git a/src/buffer.c b/src/buffer.c
index 3934941..f64255d 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -473,8 +473,8 @@
     {
 	if (term_job_running(buf->b_term))
 	{
-	    if (wipe_buf)
-		/* Wiping out a terminal buffer kills the job. */
+	    if (wipe_buf || unload_buf)
+		/* Wiping out or unloading a terminal buffer kills the job. */
 		free_terminal(buf);
 	    else
 	    {
@@ -1648,7 +1648,7 @@
 	if (bufIsChanged(curbuf))
 #endif
 	{
-	    EMSG(_(e_nowrtmsg));
+	    no_write_message();
 	    return FAIL;
 	}
     }
@@ -1897,6 +1897,28 @@
 }
 #endif
 
+    void
+no_write_message(void)
+{
+#ifdef FEAT_TERMINAL
+    if (term_job_running(curbuf->b_term))
+	EMSG(_("E948: Job still running (add ! to end the job)"));
+    else
+#endif
+	EMSG(_("E37: No write since last change (add ! to override)"));
+}
+
+    void
+no_write_message_nobang(void)
+{
+#ifdef FEAT_TERMINAL
+    if (term_job_running(curbuf->b_term))
+	EMSG(_("E948: Job still running"));
+    else
+#endif
+	EMSG(_("E37: No write since last change"));
+}
+
 /*
  * functions for dealing with the buffer list
  */
diff --git a/src/ex_cmds.c b/src/ex_cmds.c
index 61c85a9..8b21b81 100644
--- a/src/ex_cmds.c
+++ b/src/ex_cmds.c
@@ -3572,7 +3572,7 @@
 	{
 	    if (other)
 		--no_wait_return;
-	    EMSG(_(e_nowrtmsg));
+	    no_write_message();
 	    retval = GETFILE_NOT_WRITTEN;	/* file has been changed */
 	    goto theend;
 	}
diff --git a/src/ex_cmds2.c b/src/ex_cmds2.c
index 8a11fbb..8ca11f0 100644
--- a/src/ex_cmds2.c
+++ b/src/ex_cmds2.c
@@ -1934,9 +1934,9 @@
 	}
 #endif
 	if (flags & CCGD_EXCMD)
-	    EMSG(_(e_nowrtmsg));
+	    no_write_message();
 	else
-	    EMSG(_(e_nowrtmsg_nobang));
+	    no_write_message_nobang();
 	return TRUE;
     }
     return FALSE;
diff --git a/src/ex_docmd.c b/src/ex_docmd.c
index fa5a888..70f3e57 100644
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -7468,7 +7468,7 @@
 	else
 # endif
 	{
-	    EMSG(_(e_nowrtmsg));
+	    no_write_message();
 	    return;
 	}
     }
diff --git a/src/globals.h b/src/globals.h
index 7f2875b..0b887d3 100644
--- a/src/globals.h
+++ b/src/globals.h
@@ -1516,8 +1516,6 @@
 EXTERN char_u e_notmp[]		INIT(= N_("E483: Can't get temp file name"));
 EXTERN char_u e_notopen[]	INIT(= N_("E484: Can't open file %s"));
 EXTERN char_u e_notread[]	INIT(= N_("E485: Can't read file %s"));
-EXTERN char_u e_nowrtmsg[]	INIT(= N_("E37: No write since last change (add ! to override)"));
-EXTERN char_u e_nowrtmsg_nobang[]   INIT(= N_("E37: No write since last change"));
 EXTERN char_u e_null[]		INIT(= N_("E38: Null argument"));
 #if defined(FEAT_DIGRAPHS) || defined(FEAT_TIMERS)
 EXTERN char_u e_number_exp[]	INIT(= N_("E39: Number expected"));
diff --git a/src/proto/buffer.pro b/src/proto/buffer.pro
index d70981d..485eb02 100644
--- a/src/proto/buffer.pro
+++ b/src/proto/buffer.pro
@@ -13,6 +13,8 @@
 void set_curbuf(buf_T *buf, int action);
 void enter_buffer(buf_T *buf);
 void do_autochdir(void);
+void no_write_message(void);
+void no_write_message_nobang(void);
 buf_T *buflist_new(char_u *ffname, char_u *sfname, linenr_T lnum, int flags);
 void free_buf_options(buf_T *buf, int free_p_ff);
 int buflist_getfile(int n, linenr_T lnum, int options, int forceit);
diff --git a/src/quickfix.c b/src/quickfix.c
index 8c55a16..42077c2 100644
--- a/src/quickfix.c
+++ b/src/quickfix.c
@@ -2327,7 +2327,7 @@
 	     * set b_p_ro flag). */
 	    if (!can_abandon(curbuf, forceit))
 	    {
-		EMSG(_(e_nowrtmsg));
+		no_write_message();
 		ok = FALSE;
 	    }
 	    else
diff --git a/src/terminal.c b/src/terminal.c
index d482d19..304a7ba 100644
--- a/src/terminal.c
+++ b/src/terminal.c
@@ -267,7 +267,7 @@
 	/* Create a new buffer in the current window. */
 	if (!can_abandon(curbuf, forceit))
 	{
-	    EMSG(_(e_nowrtmsg));
+	    no_write_message();
 	    vim_free(term);
 	    return;
 	}
diff --git a/src/version.c b/src/version.c
index 545204c..352e0a9 100644
--- a/src/version.c
+++ b/src/version.c
@@ -770,6 +770,8 @@
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    953,
+/**/
     952,
 /**/
     951,