Subject: bug#43065: Fix or remove broken flyspell-issue-welcome-flag option

From: Stefan Kangas <[email-masked]>
Date: Wed, 26 Aug 2020 22:24:45 -0700

The flyspell-issue-welcome-flag option is supposed to control whether or
not a welcome message is shown when enabling flyspell-mode:

    "Welcome to Flyspell. Use C-. or Mouse-3 to correct words."

This does not work; flyspell-mode does not show such a message.

>From digging in the sources, it's not clear to me if this has worked at
all since 2002 or so.  I didn't bother with a full investigation, so I
might be overlooking something.

In any case, I see three options:

1. Fix it.  I have attached a patch here which does that.  The message
   is mildly annoying, but could be useful to beginners.  (And it's
   easy to disabled using the mentioned variable.)

2. Fix it, but change the default to nil.  I think this is pointless,
   since this would mostly be useful to beginners.

3. Remove the code and make the option obsolete.

Any opinions or preferences?
From 037a7510e7c89fac37b9c53c282b6641495a2ff8 Mon Sep 17 00:00:00 2001
From: Stefan Kangas <[email-masked]>
Date: Thu, 27 Aug 2020 07:07:39 +0200
Subject: [PATCH] Fix flyspell welcome message

* lisp/textmodes/flyspell.el (flyspell-mode, flyspell-mode-on):
Fix showing welcome message when `flyspell-issue-welcome-flag' and
`flyspell-issue-message-flag' are both non-nil.
---
 lisp/textmodes/flyspell.el | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/lisp/textmodes/flyspell.el b/lisp/textmodes/flyspell.el
index 78a74de4e8..0246a64dd1 100644
--- a/lisp/textmodes/flyspell.el
+++ b/lisp/textmodes/flyspell.el
@@ -533,7 +533,7 @@ flyspell-mode
           (progn
             (when flyspell-use-mouse-3-for-menu
               (flyspell--set-use-mouse-3-for-menu 'flyspell-use-mouse-3-for-menu t))
-	    (flyspell-mode-on))
+            (flyspell-mode-on t))
 	(error (message "Error enabling Flyspell mode:\n%s" (cdr err))
 	       (flyspell-mode -1)))
     (flyspell-mode-off)))
@@ -611,8 +611,12 @@ flyspell-kill-ispell-hook
 ;;*---------------------------------------------------------------------*/
 ;;*    flyspell-mode-on ...                                             */
 ;;*---------------------------------------------------------------------*/
-(defun flyspell-mode-on ()
-  "Turn Flyspell mode on.  Do not use this; use `flyspell-mode' instead."
+(defun flyspell-mode-on (&optional SHOW-MSG)
+  "Turn Flyspell mode on.  Do not use this; use `flyspell-mode' instead.
+
+If optional argument SHOW-MSG is non-nil, show a welcome message
+if `flyspell-issue-message-flag' and `flyspell-issue-welcome-flag'
+are both non-nil."
   (ispell-set-spellchecker-params) ; Initialize variables and dicts alists
   (setq ispell-highlight-face 'flyspell-incorrect)
   ;; local dictionaries setup
@@ -644,8 +648,8 @@ flyspell-mode-on
 	(setq flyspell-generic-check-word-predicate mode-predicate)))
   ;; the welcome message
   (if (and flyspell-issue-message-flag
-	   flyspell-issue-welcome-flag
-           (called-interactively-p 'interactive))
+           flyspell-issue-welcome-flag
+           show-msg)
       (let* ((binding (where-is-internal 'flyspell-auto-correct-word
                                          nil 'non-ascii))
              (mouse-button (if flyspell-use-mouse-3-for-menu
-- 
2.28.0