Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
From: Pietro <pulsarpietro@posteo.net>
To: info-gnus-english@gnu.org
Subject: Re: Trigger spell checking before sending
Date: Fri, 12 Feb 2016 08:05:10 -0600	[thread overview]
Message-ID: <87vb5uvxbd.fsf@pietrop-debian64RfL.eng.citrite.net> (raw)
In-Reply-To: <874mdeddos.fsf@debian.uxu>

Emanuel Berg <embe8573@student.uu.se> writes:

> Pietro <pulsarpietro@posteo.net> writes:
>
>> I normally use the ispell-buffer command before
>> sending an email or article to check what I have
>> written, anyway sometimes I just forgot it.
>>
>> Is there a way to configure Gnus to start the spell
>> check before sending the message ? I was thinking of
>> an "hook" which can be configured to call a function
>> - as ispell-buffer - triggered by the send command.
>
> There are many options to achieve what you want.
> As for the hooks, yes:
>
>     message-send-hook ; early
>
>     message-send-mail-hook ; late
>     message-send-news-hook
>
> But that might not be the best move. Spelling can be
> confusing with a lot of options and strange words will
> pop up that makes your mind wander and you bring up
> Emacs-w3m to Google it and you... oh, the message!
>
> Or the opposite, when you are in a rush and you have
> written a three liner and it yams every time you send
> it, the thrice-accursed spellchecker starting
> all over!
>
> Instead, I'd do it like this:
>
> Write one defun "message-send-no-check" that *always*
> sends. It could be `C-u C-c C-c' or whatever.
>
> Then write another defun
> "message-send-ask-if-not-spelled" (`C-c C-c') which
> checks a variable "is-spelled". This variable is
> (re)set to nil when you create a new message (put it
> in `message-setup-hook', likely). When you spell, the
> variable is set to t.
>
> If is-spelled is nil, message-send-ask-if-not-spelled
> simply says "Hey, it is not spelled. Use `C-u C-c C-c'
> to send anyway." If it is t, the message is sent
> normally by means of `message-send-and-exit'.
>
> This perhaps sounds complicated but it is super simple
> - just setting, testing, and branching, like all
> programming. Nothing new under the Sun Microsystems.
>
> Here is what I have for spelling:
>
>     http://user.it.uu.se/~embe8573/conf/emacs-init/spell-new.el
>
> Note especially the `ispell-message' stuff! Which has
> a bug by the way if you do `C-g' while spelling... But
> you only get a wierd message (in the echo area, not
> a message-message).
>
> And for the message mode:
>
>     http://user.it.uu.se/~embe8573/conf/emacs-init/gnus/message-my.el
>
> Good luck! Ask more if need be!
Thanks for all your answers guys.

Well my first language isn't English and I do like the idea of focusing
on what I am writing and only at a second time run the spell checker to
make sure everything is correct, I did not know of fly spell but I would
prefer not to use it. I am pretty sure there is not an unique answer to
this matter and everybody has his own preferences, this is why a fully
customizable tools like Gnus comes in handy.

The more I use it the more I like it.

I prefer to run the spell checker at a separate stage since it takes a
bit of concentration to me when I am writing in English I couldn't cope
with external interactions/distractions of any sort very well, however
this is a *pretty personal* view.

I went through the links you pointed me in and they gave me the
spark to more patiently read the Gnus manual and there I found these
these few lines :

Page 138, right at the top:

(add-hook 'message-send-hook #'ispell-message)

Even though I was excited at the idea of writing my own function
everything was already there and I haven't been the first to think about
it :-)

Now that I got this working my following question is : would it be possible
to auto-detect the language the spell checker should check ? 

Alternatively I am thinking of writing a function which asks the user
for the language the ispell function should check for, it does not need
to accept all the languages and for instance I would be more than happy to have
something like that :

Mini-buffer says: [Which language ?[e : English, i: Italian]

In this manner I do not need to remember all the dictionary names but I
could set up a simple mapping inside my functions for the ones I more
often using.

For example typing 'e' would cause:

(ispell-change-dictionary 'english)
(ispell-message)

Such function would be inserted among the 'message-send-hook functions'
list.

Am I talking completely non-sense ?





  reply	other threads:[~2016-02-12 14:05 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-11 22:47 Pietro
2016-02-11 23:34 ` Emanuel Berg
2016-02-12 14:05   ` Pietro [this message]
2016-02-13  3:27     ` Emanuel Berg
2016-02-13  4:42     ` Emanuel Berg
2016-02-18 16:11       ` Pietro
2016-02-19  0:17         ` Emanuel Berg
2016-02-19 10:20           ` Pietro
2016-03-05 17:38             ` Pietro
2016-03-05 17:43               ` Pietro
2016-03-06  5:53                 ` Emanuel Berg
2016-02-19 13:53           ` B.V. Raghav
2016-02-19 20:15             ` Emanuel Berg
2016-02-20  7:12               ` B.V. Raghav
2016-02-15 11:12     ` Peter Münster
2016-02-12  0:07 ` Trigger spell checking before sending [flyspell?] Andrzej A. Filip
2016-02-12  0:21   ` Emanuel Berg
2016-02-12  8:58     ` Andrzej A. Filip
2016-02-13  4:47       ` Emanuel Berg
     [not found]   ` <mailman.4442.1455236524.843.info-gnus-english@gnu.org>
2016-02-12  9:41     ` Loris Bennett
2016-02-13  5:00       ` Emanuel Berg
2016-02-12  7:31 ` Trigger spell checking before sending Eric S Fraga

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87vb5uvxbd.fsf@pietrop-debian64RfL.eng.citrite.net \
    --to=pulsarpietro@posteo.net \
    --cc=info-gnus-english@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 NNTP newsgroup(s).