From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.user/18050 Path: news.gmane.org!not-for-mail From: Emanuel Berg Newsgroups: gmane.emacs.gnus.user Subject: Re: Trigger spell checking before sending Date: Fri, 12 Feb 2016 00:34:11 +0100 Message-ID: <874mdeddos.fsf@debian.uxu> References: <874mde27a9.fsf@posteo.net> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1455233687 26281 80.91.229.3 (11 Feb 2016 23:34:47 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 11 Feb 2016 23:34:47 +0000 (UTC) To: info-gnus-english@gnu.org Original-X-From: info-gnus-english-bounces+gegu-info-gnus-english=m.gmane.org@gnu.org Fri Feb 12 00:34:37 2016 Return-path: Envelope-to: gegu-info-gnus-english@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aU0kq-00018v-Hc for gegu-info-gnus-english@m.gmane.org; Fri, 12 Feb 2016 00:34:32 +0100 Original-Received: from localhost ([::1]:54515 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aU0km-0007NZ-9h for gegu-info-gnus-english@m.gmane.org; Thu, 11 Feb 2016 18:34:28 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55179) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aU0kj-0007NL-Az for info-gnus-english@gnu.org; Thu, 11 Feb 2016 18:34:26 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aU0kg-0001oK-3T for info-gnus-english@gnu.org; Thu, 11 Feb 2016 18:34:25 -0500 Original-Received: from plane.gmane.org ([80.91.229.3]:56004) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aU0kf-0001oG-SD for info-gnus-english@gnu.org; Thu, 11 Feb 2016 18:34:22 -0500 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1aU0kc-0000yM-TA for info-gnus-english@gnu.org; Fri, 12 Feb 2016 00:34:18 +0100 Original-Received: from nl106-137-227.student.uu.se ([130.243.137.227]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 12 Feb 2016 00:34:18 +0100 Original-Received: from embe8573 by nl106-137-227.student.uu.se with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 12 Feb 2016 00:34:18 +0100 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: info-gnus-english@gnu.org Original-Lines: 68 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: nl106-137-227.student.uu.se Mail-Copies-To: never User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) Cancel-Lock: sha1:8O/ukrIE27qJ+ht/kXhN8baNjMQ= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: info-gnus-english@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Announcements and discussions for GNUS, the GNU Emacs Usenet newsreader \(in English\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: info-gnus-english-bounces+gegu-info-gnus-english=m.gmane.org@gnu.org Original-Sender: info-gnus-english-bounces+gegu-info-gnus-english=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.gnus.user:18050 Archived-At: Pietro 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