Pietro <pulsarpie...@posteo.net> 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) ))) 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 :)) When you understand it move on to do other things :) -- underground experts united http://user.it.uu.se/~embe8573 _______________________________________________ info-gnus-english mailing list info-gnus-english@gnu.org https://lists.gnu.org/mailman/listinfo/info-gnus-english