all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / 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; 3+ 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] 3+ messages in thread
[parent not found: <mailman.157.1139766172.2858.help-gnu-emacs@gnu.org>]

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

Thread overview: 3+ 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
     [not found] <mailman.157.1139766172.2858.help-gnu-emacs@gnu.org>
2006-02-12 23:18 ` Where is the mistake? Thien-Thi Nguyen

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.