patch 8.1.1510: a plugin cannot easily expand a command like done internally

Problem:    A plugin cannot easily expand a command like done internally.
Solution:   Add the expandcmd() function. (Yegappan Lakshmanan, closes #4514)
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index d1f6824..b5df67c 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -2326,6 +2326,7 @@
 exp({expr})			Float	exponential of {expr}
 expand({expr} [, {nosuf} [, {list}]])
 				any	expand special keywords in {expr}
+expandcmd({expr})		String	expand {expr} like with `:edit`
 feedkeys({string} [, {mode}])	Number	add key sequence to typeahead buffer
 filereadable({file})		Number	|TRUE| if {file} is a readable file
 filewritable({file})		Number	|TRUE| if {file} is a writable file
@@ -4218,6 +4219,14 @@
 		See |glob()| for finding existing files.  See |system()| for
 		getting the raw output of an external command.
 
+expandcmd({expr})					*expandcmd()*
+		Expand special items in {expr} like what is done for an Ex
+		command such as `:edit`.  This expands special keywords, like
+		with |expand()|, and environment variables, anywhere in
+		{expr}.  Returns the expanded string.
+		Example: >
+			:echo expandcmd('make %<.o')
+<
 extend({expr1}, {expr2} [, {expr3}])			*extend()*
 		{expr1} and {expr2} must be both |Lists| or both
 		|Dictionaries|.