Emanuel Berg <[email protected]> writes: > Pietro <[email protected]> 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) ))) > 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!
_______________________________________________ info-gnus-english mailing list [email protected] https://lists.gnu.org/mailman/listinfo/info-gnus-english
