patch 8.1.1547: functionality of bt_nofile() is confusing

Problem:    Functionality of bt_nofile() is confusing.
Solution:   Split into bt_nofile() and bt_nofilename().
diff --git a/src/buffer.c b/src/buffer.c
index e6ae09d..c3911ae 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -5698,7 +5698,7 @@
  * buffer.  This means the buffer name is not a file name.
  */
     int
-bt_nofile(buf_T *buf)
+bt_nofilename(buf_T *buf)
 {
     return buf != NULL && ((buf->b_p_bt[0] == 'n' && buf->b_p_bt[2] == 'f')
 	    || buf->b_p_bt[0] == 'a'
@@ -5707,6 +5707,15 @@
 }
 
 /*
+ * Return TRUE if "buf" has 'buftype' set to "nofile".
+ */
+    int
+bt_nofile(buf_T *buf)
+{
+    return buf != NULL && buf->b_p_bt[0] == 'n' && buf->b_p_bt[2] == 'f';
+}
+
+/*
  * Return TRUE if "buf" is a "nowrite", "nofile", "terminal" or "prompt"
  * buffer.
  */
@@ -5772,7 +5781,7 @@
 
     /* There is no _file_ when 'buftype' is "nofile", b_sfname
      * contains the name as specified by the user. */
-    if (bt_nofile(buf))
+    if (bt_nofilename(buf))
     {
 #ifdef FEAT_TERMINAL
 	if (buf->b_term != NULL)
diff --git a/src/evalfunc.c b/src/evalfunc.c
index 0ef7609..544426f 100644
--- a/src/evalfunc.c
+++ b/src/evalfunc.c
@@ -1943,7 +1943,7 @@
 		if (buf->b_fname != NULL
 			&& (path_with_url(buf->b_fname)
 #ifdef FEAT_QUICKFIX
-			    || bt_nofile(buf)
+			    || bt_nofilename(buf)
 #endif
 			   )
 			&& STRCMP(buf->b_fname, avar->vval.v_string) == 0)
diff --git a/src/ex_cmds.c b/src/ex_cmds.c
index d7a4187..d1068c7 100644
--- a/src/ex_cmds.c
+++ b/src/ex_cmds.c
@@ -3399,7 +3399,7 @@
 		|| (buf->b_flags & BF_READERR))
 	    && !p_wa
 #ifdef FEAT_QUICKFIX
-	    && !bt_nofile(buf)
+	    && !bt_nofilename(buf)
 #endif
 	    && vim_fexists(ffname))
     {
diff --git a/src/ex_docmd.c b/src/ex_docmd.c
index 91ced52..438cb35 100644
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -9909,7 +9909,7 @@
 		    && wp->w_buffer->b_ffname != NULL
 		    && !bt_help(wp->w_buffer)
 #ifdef FEAT_QUICKFIX
-		    && !bt_nofile(wp->w_buffer)
+		    && !bt_nofilename(wp->w_buffer)
 #endif
 		    )
 	    {
@@ -10236,7 +10236,7 @@
     if (wp->w_buffer->b_fname == NULL
 #ifdef FEAT_QUICKFIX
 	    /* When 'buftype' is "nofile" can't restore the window contents. */
-	    || bt_nofile(wp->w_buffer)
+	    || bt_nofilename(wp->w_buffer)
 #endif
        )
 	return (ssop_flags & SSOP_BLANK);
@@ -10323,7 +10323,7 @@
 	 */
 	if (wp->w_buffer->b_ffname != NULL
 # ifdef FEAT_QUICKFIX
-		&& !bt_nofile(wp->w_buffer)
+		&& !bt_nofilename(wp->w_buffer)
 # endif
 		)
 	{
diff --git a/src/fileio.c b/src/fileio.c
index e6fb6bf..0318325 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -3160,7 +3160,7 @@
 	    && whole
 	    && buf == curbuf
 #ifdef FEAT_QUICKFIX
-	    && !bt_nofile(buf)
+	    && !bt_nofilename(buf)
 #endif
 	    && !filtering
 	    && (!append || vim_strchr(p_cpo, CPO_FNAMEAPP) != NULL)
@@ -3237,7 +3237,7 @@
 					 sfname, sfname, FALSE, curbuf, eap)))
 	    {
 #ifdef FEAT_QUICKFIX
-		if (overwriting && bt_nofile(curbuf))
+		if (overwriting && bt_nofilename(curbuf))
 		    nofile_err = TRUE;
 		else
 #endif
@@ -3270,7 +3270,7 @@
 	    else
 	    {
 #ifdef FEAT_QUICKFIX
-		if (overwriting && bt_nofile(curbuf))
+		if (overwriting && bt_nofilename(curbuf))
 		    nofile_err = TRUE;
 		else
 #endif
@@ -3284,7 +3284,7 @@
 					 sfname, sfname, FALSE, curbuf, eap)))
 	    {
 #ifdef FEAT_QUICKFIX
-		if (overwriting && bt_nofile(curbuf))
+		if (overwriting && bt_nofilename(curbuf))
 		    nofile_err = TRUE;
 		else
 #endif
@@ -6083,7 +6083,7 @@
 
     if (buf->b_fname != NULL
 #ifdef FEAT_QUICKFIX
-	    && !bt_nofile(buf)
+	    && !bt_nofilename(buf)
 #endif
 	    && !path_with_url(buf->b_fname)
 	    && (force
diff --git a/src/popupmnu.c b/src/popupmnu.c
index 09faa69..5fbb3bb 100644
--- a/src/popupmnu.c
+++ b/src/popupmnu.c
@@ -727,7 +727,7 @@
 		if (!resized
 			&& curbuf->b_nwindows == 1
 			&& curbuf->b_fname == NULL
-			&& curbuf->b_p_bt[0] == 'n' && curbuf->b_p_bt[2] == 'f'
+			&& bt_nofile(curbuf)
 			&& curbuf->b_p_bh[0] == 'w')
 		{
 		    /* Already a "wipeout" buffer, make it empty. */
diff --git a/src/proto/buffer.pro b/src/proto/buffer.pro
index 1748fb5..81be7e4 100644
--- a/src/proto/buffer.pro
+++ b/src/proto/buffer.pro
@@ -62,6 +62,7 @@
 int bt_help(buf_T *buf);
 int bt_prompt(buf_T *buf);
 int bt_popup(buf_T *buf);
+int bt_nofilename(buf_T *buf);
 int bt_nofile(buf_T *buf);
 int bt_dontwrite(buf_T *buf);
 int bt_dontwrite_msg(buf_T *buf);
diff --git a/src/quickfix.c b/src/quickfix.c
index 290f6bc..d2d3302 100644
--- a/src/quickfix.c
+++ b/src/quickfix.c
@@ -4135,7 +4135,7 @@
     // Set the options for the quickfix buffer/window (if not already done)
     // Do this even if the quickfix buffer was already present, as an autocmd
     // might have previously deleted (:bdelete) the quickfix buffer.
-    if (curbuf->b_p_bt[0] != 'q')
+    if (bt_quickfix(curbuf))
 	qf_set_cwindow_options();
 
     // Only set the height when still in the same tab page and there is no
diff --git a/src/version.c b/src/version.c
index 675beb8..113fb97 100644
--- a/src/version.c
+++ b/src/version.c
@@ -778,6 +778,8 @@
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    1547,
+/**/
     1546,
 /**/
     1545,