changeset 106063:ec3a09d48295

* textmodes/flyspell.el (sgml-mode-flyspell-verify): Use `sgml-lexical-context' instead of own parse for tag. (Further to Bug#4511).
author Kevin Ryde <user42@zip.com.au>
date Mon, 16 Nov 2009 22:52:29 +0000
parents 5691eb814adb
children 596e2a7ed0ef
files lisp/textmodes/flyspell.el
diffstat 1 files changed, 8 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/textmodes/flyspell.el	Mon Nov 16 22:26:36 2009 +0000
+++ b/lisp/textmodes/flyspell.el	Mon Nov 16 22:52:29 2009 +0000
@@ -360,13 +360,14 @@
 (put 'nxml-mode 'flyspell-mode-predicate 'sgml-mode-flyspell-verify)
 
 (defun sgml-mode-flyspell-verify ()
-  "Function used for `flyspell-generic-check-word-predicate' in SGML mode."
-  (not (save-excursion
-	 (or (looking-at "[^<\n]*>")
-	     (ispell-looking-back "<[^>\n]*" (line-beginning-position))
-	     (and (looking-at "[^&\n]*;")
-		  (ispell-looking-back "&[^;\n]*"
-                                       (line-beginning-position)))))))
+  "Function used for `flyspell-generic-check-word-predicate' in SGML mode.
+Tag and attribute names are not spell checked, everything else is.
+
+String values of attributes are checked because they can be text
+like <img alt=\"Some thing.\">."
+
+  (not (memq (car (sgml-lexical-context))
+	     '(tag pi))))
 
 ;;*---------------------------------------------------------------------*/
 ;;*    Programming mode                                                 */