unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#43065: Fix or remove broken flyspell-issue-welcome-flag option
@ 2020-08-27  5:24 Stefan Kangas
  2020-08-27  8:42 ` Eli Zaretskii
  0 siblings, 1 reply; 7+ messages in thread
From: Stefan Kangas @ 2020-08-27  5:24 UTC (permalink / raw)
  To: 43065

[-- Attachment #1: Type: text/plain, Size: 867 bytes --]

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?

[-- Attachment #2: Type: text/plain, Size: 2 bytes --]

.

[-- Attachment #3: 0001-Fix-flyspell-welcome-message.patch --]
[-- Type: text/x-diff, Size: 2352 bytes --]

From 037a7510e7c89fac37b9c53c282b6641495a2ff8 Mon Sep 17 00:00:00 2001
From: Stefan Kangas <stefankangas@gmail.com>
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


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* bug#43065: Fix or remove broken flyspell-issue-welcome-flag option
  2020-08-27  5:24 bug#43065: Fix or remove broken flyspell-issue-welcome-flag option Stefan Kangas
@ 2020-08-27  8:42 ` Eli Zaretskii
  2020-08-27  9:06   ` Eli Zaretskii
  2020-08-27  9:27   ` Stefan Kangas
  0 siblings, 2 replies; 7+ messages in thread
From: Eli Zaretskii @ 2020-08-27  8:42 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: 43065

> From: Stefan Kangas <stefan@marxist.se>
> Date: Wed, 26 Aug 2020 22:24:45 -0700
> 
> 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?

#1, please.

Thanks for paying attention to this.





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#43065: Fix or remove broken flyspell-issue-welcome-flag option
  2020-08-27  8:42 ` Eli Zaretskii
@ 2020-08-27  9:06   ` Eli Zaretskii
  2020-08-27  9:27     ` Stefan Kangas
  2020-08-27  9:27   ` Stefan Kangas
  1 sibling, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2020-08-27  9:06 UTC (permalink / raw)
  To: stefan; +Cc: 43065

> Date: Thu, 27 Aug 2020 11:42:25 +0300
> From: Eli Zaretskii <eliz@gnu.org>
> Cc: 43065@debbugs.gnu.org
> 
> > From: Stefan Kangas <stefan@marxist.se>
> > Date: Wed, 26 Aug 2020 22:24:45 -0700
> > 
> > 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?
> 
> #1, please.

Btw, can we make this only display the welcome message if
flyspell-mode is invoked interactively?  Your patch makes this
unconditional, which I don't think was the original intent.





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#43065: Fix or remove broken flyspell-issue-welcome-flag option
  2020-08-27  9:06   ` Eli Zaretskii
@ 2020-08-27  9:27     ` Stefan Kangas
  2020-08-27  9:31       ` Eli Zaretskii
  0 siblings, 1 reply; 7+ messages in thread
From: Stefan Kangas @ 2020-08-27  9:27 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 43065

Eli Zaretskii <eliz@gnu.org> writes:

> Btw, can we make this only display the welcome message if
> flyspell-mode is invoked interactively?  Your patch makes this
> unconditional, which I don't think was the original intent.

(I received your email less than a minute after pushing.)

Your observation is correct, I think.

Is this one of those places where we are forced to use
(called-interactively-p 'interactive)?  Or can we add an optional
argument to `define-minor-mode' somehow?





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#43065: Fix or remove broken flyspell-issue-welcome-flag option
  2020-08-27  8:42 ` Eli Zaretskii
  2020-08-27  9:06   ` Eli Zaretskii
@ 2020-08-27  9:27   ` Stefan Kangas
  1 sibling, 0 replies; 7+ messages in thread
From: Stefan Kangas @ 2020-08-27  9:27 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 43065

close 43065 28.1
thanks

Eli Zaretskii <eliz@gnu.org> writes:

>> 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?
>
> #1, please.

Fix pushed to master as commit 4766006d3c.  Closing.

Best regards,
Stefan Kangas





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#43065: Fix or remove broken flyspell-issue-welcome-flag option
  2020-08-27  9:27     ` Stefan Kangas
@ 2020-08-27  9:31       ` Eli Zaretskii
  2020-08-27  9:47         ` Stefan Kangas
  0 siblings, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2020-08-27  9:31 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: 43065

> From: Stefan Kangas <stefan@marxist.se>
> Date: Thu, 27 Aug 2020 02:27:13 -0700
> Cc: 43065@debbugs.gnu.org
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> > Btw, can we make this only display the welcome message if
> > flyspell-mode is invoked interactively?  Your patch makes this
> > unconditional, which I don't think was the original intent.
> 
> (I received your email less than a minute after pushing.)
> 
> Your observation is correct, I think.
> 
> Is this one of those places where we are forced to use
> (called-interactively-p 'interactive)?

Yes, I think so.





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#43065: Fix or remove broken flyspell-issue-welcome-flag option
  2020-08-27  9:31       ` Eli Zaretskii
@ 2020-08-27  9:47         ` Stefan Kangas
  0 siblings, 0 replies; 7+ messages in thread
From: Stefan Kangas @ 2020-08-27  9:47 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 43065

Eli Zaretskii <eliz@gnu.org> writes:

> Yes, I think so.

OK, thanks.  Pushed fix to master as commit f40260f121.





^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-08-27  9:47 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-08-27  5:24 bug#43065: Fix or remove broken flyspell-issue-welcome-flag option Stefan Kangas
2020-08-27  8:42 ` Eli Zaretskii
2020-08-27  9:06   ` Eli Zaretskii
2020-08-27  9:27     ` Stefan Kangas
2020-08-27  9:31       ` Eli Zaretskii
2020-08-27  9:47         ` Stefan Kangas
2020-08-27  9:27   ` Stefan Kangas

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).