From e3c39c01f5cf08b0a1f1135c0ac721d142cc8a09 Mon Sep 17 00:00:00 2001 From: Kevin Ryde Date: Mon, 16 Nov 2009 22:53:21 +0000 Subject: [PATCH] * textmodes/flyspell.el (sgml-mode-flyspell-verify): Use `sgml-lexical-context' instead of own parse for tag. (Further to Bug#4511). --- lisp/ChangeLog | 6 ++++++ lisp/textmodes/flyspell.el | 15 ++++++++------- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 67a56445aff..cfe1492a962 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2009-11-16 Kevin Ryde + + * textmodes/flyspell.el (sgml-mode-flyspell-verify): Use + `sgml-lexical-context' instead of own parse for tag. (Further to + Bug#4511). + 2009-11-16 Dan Nicolaescu * vc.el (vc-log-show-limit): Default to 2000. diff --git a/lisp/textmodes/flyspell.el b/lisp/textmodes/flyspell.el index bffbbbc3cc1..9aaf466f0ed 100644 --- a/lisp/textmodes/flyspell.el +++ b/lisp/textmodes/flyspell.el @@ -360,13 +360,14 @@ property of the major mode name.") (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 \"Some." + + (not (memq (car (sgml-lexical-context)) + '(tag pi)))) ;;*---------------------------------------------------------------------*/ ;;* Programming mode */ -- 2.39.5