From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.user/18158 Path: news.gmane.org!not-for-mail From: Pietro Newsgroups: gmane.emacs.gnus.user Subject: Re: Trigger spell checking before sending Date: Sat, 05 Mar 2016 17:38:06 +0000 Message-ID: <87k2lgsu4h.fsf@posteo.net> References: <874mde27a9.fsf@posteo.net> <874mdeddos.fsf@debian.uxu> <87vb5uvxbd.fsf@pietrop-debian64RfL.eng.citrite.net> <87mvr5ql03.fsf@debian.uxu> <877fi2dmms.fsf@pietrop-debian64RfL.eng.citrite.net> <87ziuxzh8e.fsf@debian.uxu> <8737spm27i.fsf@pietrop-debian64RfL.eng.citrite.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 1457199627 24306 80.91.229.3 (5 Mar 2016 17:40:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 5 Mar 2016 17:40:27 +0000 (UTC) To: info-gnus-english@gnu.org Original-X-From: info-gnus-english-bounces+gegu-info-gnus-english=m.gmane.org@gnu.org Sat Mar 05 18:40:18 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 1acGBd-0007Wb-Ju for gegu-info-gnus-english@m.gmane.org; Sat, 05 Mar 2016 18:40:17 +0100 Original-Received: from localhost ([::1]:47485 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1acGBc-00052N-Pn for gegu-info-gnus-english@m.gmane.org; Sat, 05 Mar 2016 12:40:16 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39418) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1acGBa-00052G-Tp for info-gnus-english@gnu.org; Sat, 05 Mar 2016 12:40:15 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1acGBX-0004Tl-OS for info-gnus-english@gnu.org; Sat, 05 Mar 2016 12:40:14 -0500 Original-Received: from plane.gmane.org ([80.91.229.3]:54438) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1acGBX-0004Sl-HW for info-gnus-english@gnu.org; Sat, 05 Mar 2016 12:40:11 -0500 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1acGBQ-0007RP-9D for info-gnus-english@gnu.org; Sat, 05 Mar 2016 18:40:04 +0100 Original-Received: from host86-181-173-195.range86-181.btcentralplus.com ([86.181.173.195]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 05 Mar 2016 18:40:04 +0100 Original-Received: from pulsarpietro by host86-181-173-195.range86-181.btcentralplus.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 05 Mar 2016 18:40:04 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 65 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: host86-181-173-195.range86-181.btcentralplus.com User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) Cancel-Lock: sha1:Tr+418IBiWKsbdy4LrBfg3E8L8g= 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:18158 Archived-At: Pietro writes: > Emanuel Berg writes: > >> Pietro writes: >> >>> run-hooks: Wrong number of arguments [...] >>> >>> This is what I get in my mini-buffer when I send my >>> email, any thoughts? >> >> OK, I see the problem, it doesn't get >> called interactively. >> >> Try this instead: >> >> (defun spell-before-send () >> (let*((lang-input (read-from-minibuffer "Language [e or s]: ")) >> (lang (pcase lang-input >> ("e" "american-insane") >> ("s" "svenska") ))) >> (when lang >> (ispell-change-dictionary lang) >> (ispell-message) ))) How can I modify this function to skip the spell checking ? I would like to have a third choice which directly sends the message straight away. > Thanks a lot, it works fine now. >> You have to change the interface at the second line, >> as well as the dictionaries at lines four and five, >> of course. >> >> Another thing - here is a hint how to do hooks without >> the lambda stuff. It amounts to the same but gives >> more control and more easy-to-handle code. >> >> First check out if you have anything in the hook >> variable already. If you do, and you want it, put it >> before (or after) the third line below. >> >> Then, evaluate the commented (first) line, then >> evaluate the function (at the second line), then set >> the hook to the hook function (the fourth line). >> >> ;; (setq message-send-hook nil) >> (defun message-send-hook-f () >> (spell-before-send) ) >> (setq message-send-hook #'message-send-hook-f) >> >>> I am new to Emacs Lisp therefore I could some >>> silly mistake. >> >> You don't have to be new to Lisp to do that. >> >> Is there anything you don't understand in the code? >> If it is, find out using the documentation (online >> help: `C-h f', `C-h v', etc.) *or* ask here. ("Online" >> = not on paper :)) >> > No I fully understand it, it does not look that far from the Racket, the > Lisp dialect I have studied >> When you understand it move on to do other things :) > Sure, and thanks a lot, I hope I will give something back to the > community soon! I am afraid I am not ready yet ... :-(