unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Where is the mistake?
@ 2006-02-12 17:43 Sebastian Meisel
  2006-02-12 19:19 ` Where is the mistake? -- Solved Sebastian Meisel
  0 siblings, 1 reply; 2+ messages in thread
From: Sebastian Meisel @ 2006-02-12 17:43 UTC (permalink / 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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Where is the mistake? -- Solved
  2006-02-12 17:43 Where is the mistake? Sebastian Meisel
@ 2006-02-12 19:19 ` Sebastian Meisel
  0 siblings, 0 replies; 2+ messages in thread
From: Sebastian Meisel @ 2006-02-12 19:19 UTC (permalink / raw)



[-- Attachment #1.1: Type: text/plain, Size: 41 bytes --]

Well I found it.
-- 
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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-02-12 19:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-02-12 17:43 Where is the mistake? Sebastian Meisel
2006-02-12 19:19 ` Where is the mistake? -- Solved Sebastian Meisel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).