[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
elisp issues on (cond ((when ...) t) ((when) t))
From: |
Sebastian Meisel |
Subject: |
elisp issues on (cond ((when ...) t) ((when) t)) |
Date: |
Fri, 10 Feb 2006 15:55:41 +0100 |
User-agent: |
KMail/1.9.1 |
Hallo,
I'm trying to enhance my flyspell a little bit for german usage and succeeded
in some aspects, but now come again to the shortcomings of my knowledge of
elisp. I tried the following code:
------->
(add-hook 'flyspell-incorrect-hook 'flyspell-zusammen())
(defun flyspell-zusammen (beg end poss)
"Better spell-checking for german combined words."
(cond (
(when (re-search-backward "\"-" (- beg 2) t)
(when (consp poss)
(setq temp-buffer (get-buffer-create " *flyspell-temp*"))
(save-excursion
(copy-to-buffer temp-buffer beg end)
(set-buffer temp-buffer)
(goto-char (point-min))
(setq word (capitalize (buffer-string)))
(message word)
(when (member word (nth 2 poss)) t)
))) t) ;;(when (re-search
((when (and (re-search-forward "-" (+ end 2) t) (re-search-backward
"s" (1- end) t))
(when (consp poss)
(setq temp-buffer (get-buffer-create " *flyspell-temp*"))
(save-excursion
(copy-to-buffer temp-buffer beg (1- end))
(set-buffer temp-buffer)
(goto-char (point-min))
(setq word (capitalize (buffer-string)))
(message word)
(when (member word (nth 2 poss)) t)
))) t) ;; (when (and (re-search
))
<------------
When I try the function without (cond) and with only one (when
(re-search ...) it works, but (cond ((when ...) t) ((when ...) t)) seems not
to return nil as aspected, when both conditions fail. So no word are
considered incorrect.
What is the error I made?
--
Sebastian Meisel
(P.S. I apologize, that I incidently used german language in on mail before --
switching mailing lists need some concentration.)
- elisp issues on (cond ((when ...) t) ((when) t)),
Sebastian Meisel <=