patch 8.2.3520: cannot define a function for thesaurus completion

Problem:    Cannot define a function for thesaurus completion.
Solution:   Add 'thesaurusfunc'. (Yegappan Lakshmanan, closes #8987,
            closes 8950)
diff --git a/runtime/doc/insert.txt b/runtime/doc/insert.txt
index 31b820f..8d47a7e 100644
--- a/runtime/doc/insert.txt
+++ b/runtime/doc/insert.txt
@@ -842,6 +842,12 @@
 			Other uses include translation between two languages,
 			or grouping API functions by keyword.
 
+			If the 'thesaurusfunc' option is set, then the user
+			specified function is invoked to get the list of
+			completion matches and the 'thesaurus' option is not
+			used. See |complete-functions| for an explanation of
+			how the function is invoked and what it should return.
+
 	CTRL-T	or
 	CTRL-N		Search forward for next matching keyword.  This
 			keyword replaces the previous matching keyword.
@@ -1052,7 +1058,7 @@
 
 FUNCTIONS FOR FINDING COMPLETIONS			*complete-functions*
 
-This applies to 'completefunc' and 'omnifunc'.
+This applies to 'completefunc', 'thesaurusfunc' and 'omnifunc'.
 
 The function is called in two different ways:
 - First the function is called to find the start of the text to be completed.
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index 41d7105..6750479 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -8028,6 +8028,18 @@
 	uses another default.
 	Backticks cannot be used in this option for security reasons.
 
+						*'thesaurusfunc'* *tsrfu'*
+'thesaurusfunc' 'tsrfu'	string	(default: empty)
+			local to buffer
+			{not available when compiled without the |+eval|
+			feature}
+	This option specifies a function to be used for thesaurus completion
+	with CTRL-X CTRL-T. |i_CTRL-X_CTRL-T|
+	See |complete-functions| for an explanation of how the function is
+	invoked and what it should return.
+	This option cannot be set from a |modeline| or in the |sandbox|, for
+	security reasons.
+
 			     *'tildeop'* *'top'* *'notildeop'* *'notop'*
 'tildeop' 'top'		boolean	(default off)
 			global
diff --git a/runtime/doc/quickref.txt b/runtime/doc/quickref.txt
index fcdd5a7..f7c5c17 100644
--- a/runtime/doc/quickref.txt
+++ b/runtime/doc/quickref.txt
@@ -948,6 +948,7 @@
 'textmode'	  'tx'	    obsolete, use 'fileformat'
 'textwidth'	  'tw'	    maximum width of text that is being inserted
 'thesaurus'	  'tsr'     list of thesaurus files for keyword completion
+'thesaurusfunc'	  'tsrfu'   function to be used for thesaurus completion
 'tildeop'	  'top'     tilde command "~" behaves like an operator
 'timeout'	  'to'	    time out on mappings and key codes
 'timeoutlen'	  'tm'	    time out time in milliseconds