From: Sebastian Meisel <sebastianmeisel@web.de>
Subject: Where is the mistake?
Date: Sun, 12 Feb 2006 18:43:15 +0100 [thread overview]
Message-ID: <200602121844.04142.sebastianmeisel@web.de> (raw)
[-- Attachment #1.1: Type: text/plain, Size: 2483 bytes --]
I worked on on my flyspell-incorrect-hook, and again it doesn't work as
aspected, but I can't find the error. Maybe someone can have a look:
-->
(add-hook 'flyspell-incorrect-hook 'flyspell-zusammen())
(setq ispell-dictionary-alist
'(("english" "[A-Za-z]" "[^A-Za-z]" "[']" nil
("-B")
nil iso-8859-1)
("german8" "[a-zA-ZÄÖÜäößü]" "[^a-zA-ZÄÖÜäößü]" "[']" t
("-S" "-d" "german")
"~latin1" iso-8859-1)))
(setq ispell-dictionary "german8")
(defun flyspell-zusammen (beg end poss)
"This function is to be called by 'flyspell-incorrect-hook. It looks for
german hyphenationmarks (\"-) and
checks if the 'misspelled words could be correct parts of combined word in
german language."
(save-excursion
(when (consp poss)
(if (re-search-backward "\"-" (- beg 2) t)
(save-excursion
(setq temp-buffer (get-buffer-create " *flyspell-temp*"))
(copy-to-buffer temp-buffer beg end)
(set-buffer temp-buffer)
(goto-char (point-min))
(setq word (capitalize (buffer-string)))
(when (member word (nth 2 poss)) t)
)
(if (and (re-search-forward "-" (+ end 2) t)
(re-search-backward "[se]" (1- end) t))
(save-excursion
(message "hi here")
(setq temp-buffer (get-buffer-create " *flyspell-temp*"))
(copy-to-buffer temp-buffer beg (1- end))
(set-buffer temp-buffer)
(goto-char (point-min))
(setq word (capitalize (buffer-string)))
(if (when (member word (nth 2 poss)) t)
t (when (member (concat word "e") (nth 2 poss)) t))
)
(if (and (re-search-forward "-" (+ end 2) t)
(re-search-backward "[lr]" (1- end) t))
(save-excursion
(message "hi there")
(setq temp-buffer (get-buffer-create " *flyspell-temp*"))
(copy-to-buffer temp-buffer beg end)
(set-buffer temp-buffer)
(goto-char (point-min))
(setq word (capitalize (buffer-string)))
(if (when (member (concat word "e") (nth 2 poss)) t)
t nil)
)
(progn (message "not there") nil))
)))))
<--
In Geschichts"-wissenschaft
(if (and (re-search-forward "-" (+ end 2) t)
(re-search-backward "[se]" (1- end) t))
correctly recognizes that within 2 chars after Geschichts there is a "-,
while with Erzähl"-rahmen
(if (and (re-search-forward "-" (+ end 2) t)
(re-search-backward "[lr]" (1- end) t))
doesn't match the Erzähl"-. What did I do wrong?
--
Sebastian Meisel
[-- Attachment #1.2: Type: application/pgp-signature, Size: 189 bytes --]
[-- Attachment #2: Type: text/plain, Size: 152 bytes --]
_______________________________________________
help-gnu-emacs mailing list
help-gnu-emacs@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gnu-emacs
next reply other threads:[~2006-02-12 17:43 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-02-12 17:43 Sebastian Meisel [this message]
2006-02-12 19:19 ` Where is the mistake? -- Solved Sebastian Meisel
[not found] <mailman.157.1139766172.2858.help-gnu-emacs@gnu.org>
2006-02-12 23:18 ` Where is the mistake? Thien-Thi Nguyen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200602121844.04142.sebastianmeisel@web.de \
--to=sebastianmeisel@web.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.