[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Trigger spell checking before sending
From: |
Emanuel Berg |
Subject: |
Re: Trigger spell checking before sending |
Date: |
Fri, 12 Feb 2016 00:34:11 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) |
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!
--
underground experts united
http://user.it.uu.se/~embe8573
- Trigger spell checking before sending, Pietro, 2016/02/11
- Re: Trigger spell checking before sending,
Emanuel Berg <=
- Re: Trigger spell checking before sending, Pietro, 2016/02/12
- Re: Trigger spell checking before sending, Emanuel Berg, 2016/02/12
- Re: Trigger spell checking before sending, Emanuel Berg, 2016/02/12
- Re: Trigger spell checking before sending, Pietro, 2016/02/18
- Re: Trigger spell checking before sending, Emanuel Berg, 2016/02/18
- Re: Trigger spell checking before sending, Pietro, 2016/02/19
- Re: Trigger spell checking before sending, B.V. Raghav, 2016/02/19
- Re: Trigger spell checking before sending, Emanuel Berg, 2016/02/19
- Re: Trigger spell checking before sending, B.V. Raghav, 2016/02/20
- Re: Trigger spell checking before sending, Peter Münster, 2016/02/15