From 037a7510e7c89fac37b9c53c282b6641495a2ff8 Mon Sep 17 00:00:00 2001 From: Stefan Kangas 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