From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Sebastian Meisel Newsgroups: gmane.emacs.help Subject: Re: enhance flyspell for german language (+TeX) Date: Fri, 10 Feb 2006 20:20:43 +0100 Organization: EmK Message-ID: <200602102020.43931.sebastianmeisel@web.de> References: <200602081612.10150.sebastianmeisel@web.de> <200602091115.59268.sebastianmeisel@web.de> <20060209113752.GA6532@free.fr> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1139599221 25114 80.91.229.6 (10 Feb 2006 19:20:21 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 10 Feb 2006 19:20:21 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Feb 10 20:19:50 2006 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1F7do5-0002CL-00 for ; Fri, 10 Feb 2006 20:19:49 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1F7do4-0003K8-HC for geh-help-gnu-emacs@m.gmane.org; Fri, 10 Feb 2006 14:19:48 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1F7dnq-0003K0-MM for help-gnu-emacs@gnu.org; Fri, 10 Feb 2006 14:19:34 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1F7dnp-0003Jo-2X for help-gnu-emacs@gnu.org; Fri, 10 Feb 2006 14:19:34 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1F7dno-0003Jl-Vb for help-gnu-emacs@gnu.org; Fri, 10 Feb 2006 14:19:33 -0500 Original-Received: from [217.72.192.224] (helo=smtp06.web.de) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1F7dre-0001IG-9L for help-gnu-emacs@gnu.org; Fri, 10 Feb 2006 14:23:30 -0500 Original-Received: from [85.216.86.36] (helo=[192.168.2.100]) by smtp06.web.de with asmtp (TLSv1:AES256-SHA:256) (WEB.DE 4.105 #340) id 1F7dnn-0006CR-00 for help-gnu-emacs@gnu.org; Fri, 10 Feb 2006 20:19:31 +0100 Original-To: help-gnu-emacs@gnu.org User-Agent: KMail/1.9.1 In-Reply-To: <20060209113752.GA6532@free.fr> Content-Disposition: inline X-Sender: sebastianmeisel@web.de X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:33120 Archived-At: > There is a flyspell-incorrect-hook, so you might use it to forward the > word (or the sentence) to perl. It could also be used to enhance > flyspell in lisp, I guess. > Well it took me some time, but finally I made it. I use (thank's for the ti= p) the flyspell-incorrect-hook:=20 =2D----------> (add-hook 'flyspell-incorrect-hook 'flyspell-zusammen()) (defun flyspell-zusammen (beg end poss) "This function is to be called by 'flyspell-incorrect-hook. It looks for=20 german hyphenationmarks (\"-) and=20 checks if the 'misspelled words could be correct parts of combined word in= =20 german language." (if (re-search-backward "\"-" (- beg 2) t)=20 (if (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))) (when (member word (nth 2 poss)) t)=20 )) t) ;; (if (when (consp poss) =20 (if (and (re-search-forward "-" (+ end 2) t) =20 (or (re-search-backward "s" (1- end) t) (re-search-backward "e" (1- end) t))) (if (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))) (when (member word (nth 2 poss)) t) )) t) nil))) <--------- It considers Operations"-ger=E4te, Frauen"-park"-platz, Mause"-loch as corr= ect.=20 This could make life a bit easier for german writer using latex. There sti= ll=20 are some shortcomings however, but I think I can live with it: When these words repeat in a text, they are highlighted yellow.=20 When a word is once marked as incorrect the hook is called no more.=20 The only workaround is to delete the word an paste it. I hope someone is testing that, and shares her/his experiences with me. =2D-=20 Sebastian Meisel