patch 8.2.3584: "verbose set efm" reports location of the :compiler command

Problem:    "verbose set efm" reports the location of the :compiler command.
            (Gary Johnson)
Solution:   Add the "-keepscript" argument to :command and use it when
            defining CompilerSet.
diff --git a/src/ex_cmds.h b/src/ex_cmds.h
index 1ea7442..35080db 100644
--- a/src/ex_cmds.h
+++ b/src/ex_cmds.h
@@ -56,6 +56,7 @@
 				// set; when missing disallows editing another
 				// buffer when curbuf_lock is set
 #define EX_NONWHITE_OK 0x2000000  // command can be followed by non-white
+#define EX_KEEPSCRIPT  0x4000000  // keep sctx of where command was invoked
 
 #define EX_FILES (EX_XFILE | EX_EXTRA)	// multiple extra files allowed
 #define EX_FILE1 (EX_FILES | EX_NOSPC)	// 1 file, defaults to current file
diff --git a/src/ex_cmds2.c b/src/ex_cmds2.c
index 15560d8..8e7da18 100644
--- a/src/ex_cmds2.c
+++ b/src/ex_cmds2.c
@@ -754,7 +754,7 @@
 		if (old_cur_comp != NULL)
 		    old_cur_comp = vim_strsave(old_cur_comp);
 		do_cmdline_cmd((char_u *)
-			      "command -nargs=* CompilerSet setlocal <args>");
+		   "command -nargs=* -keepscript CompilerSet setlocal <args>");
 	    }
 	    do_unlet((char_u *)"g:current_compiler", TRUE);
 	    do_unlet((char_u *)"b:current_compiler", TRUE);
diff --git a/src/testdir/test_compiler.vim b/src/testdir/test_compiler.vim
index ede307f..09c03f7 100644
--- a/src/testdir/test_compiler.vim
+++ b/src/testdir/test_compiler.vim
@@ -21,6 +21,9 @@
   call assert_equal('perl', b:current_compiler)
   call assert_fails('let g:current_compiler', 'E121:')
 
+  let verbose_efm = execute('verbose set efm')
+  call assert_match('Last set from .*/compiler/perl.vim ', verbose_efm)
+
   call setline(1, ['#!/usr/bin/perl -w', 'use strict;', 'my $foo=1'])
   w!
   call feedkeys(":make\<CR>\<CR>", 'tx')
diff --git a/src/usercmd.c b/src/usercmd.c
index 8ead42c..0050647 100644
--- a/src/usercmd.c
+++ b/src/usercmd.c
@@ -360,7 +360,7 @@
 {
     static char *user_cmd_flags[] = {
 	"addr", "bang", "bar", "buffer", "complete",
-	"count", "nargs", "range", "register"
+	"count", "nargs", "range", "register", "keepscript"
     };
 
     if (idx >= (int)ARRAY_LENGTH(user_cmd_flags))
@@ -735,6 +735,8 @@
 	*flags |= UC_BUFFER;
     else if (STRNICMP(attr, "register", len) == 0)
 	*argt |= EX_REGSTR;
+    else if (STRNICMP(attr, "keepscript", len) == 0)
+	*argt |= EX_KEEPSCRIPT;
     else if (STRNICMP(attr, "bar", len) == 0)
 	*argt |= EX_TRLBAR;
     else
@@ -1764,13 +1766,17 @@
 	}
     }
 
-    current_sctx.sc_version = cmd->uc_script_ctx.sc_version;
+    if ((cmd->uc_argt & EX_KEEPSCRIPT) == 0)
+    {
+	current_sctx.sc_version = cmd->uc_script_ctx.sc_version;
 #ifdef FEAT_EVAL
-    current_sctx.sc_sid = cmd->uc_script_ctx.sc_sid;
+	current_sctx.sc_sid = cmd->uc_script_ctx.sc_sid;
 #endif
+    }
     (void)do_cmdline(buf, eap->getline, eap->cookie,
 				   DOCMD_VERBOSE|DOCMD_NOWAIT|DOCMD_KEYTYPED);
-    current_sctx = save_current_sctx;
+    if ((cmd->uc_argt & EX_KEEPSCRIPT) == 0)
+	current_sctx = save_current_sctx;
     vim_free(buf);
     vim_free(split_buf);
 }
diff --git a/src/version.c b/src/version.c
index 713b5e7..c13ea68 100644
--- a/src/version.c
+++ b/src/version.c
@@ -758,6 +758,8 @@
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    3584,
+/**/
     3583,
 /**/
     3582,