# HG changeset patch # User Agustin Martin # Date 1245929109 0 # Node ID 99f2f3ae1c56922ed3374f7c75c0d83d2907a4f9 # Parent 0af21ded137d78503c322c30d1aecb807c6d91af ispell.el: Add `ispell-looking-back' XEmacs compatibility function for `looking-back' flyspell.el (sgml-mode-flyspell-verify): Use `ispell-looking-back' diff -r 0af21ded137d -r 99f2f3ae1c56 lisp/ChangeLog --- a/lisp/ChangeLog Thu Jun 25 08:02:34 2009 +0000 +++ b/lisp/ChangeLog Thu Jun 25 11:25:09 2009 +0000 @@ -1,3 +1,11 @@ +2009-06-25 Agustín Martín + + * textmodes/ispell.el: Add `ispell-looking-back' XEmacs + compatibility function for `looking-back' + + * textmodes/flyspell.el (sgml-mode-flyspell-verify): Use + `ispell-looking-back' + 2009-06-24 Michael Albinus * net/tramp-gvfs.el (tramp-gvfs-handle-make-directory): Use `dir' diff -r 0af21ded137d -r 99f2f3ae1c56 lisp/textmodes/flyspell.el --- a/lisp/textmodes/flyspell.el Thu Jun 25 08:02:34 2009 +0000 +++ b/lisp/textmodes/flyspell.el Thu Jun 25 11:25:09 2009 +0000 @@ -363,9 +363,9 @@ "Function used for `flyspell-generic-check-word-predicate' in SGML mode." (not (save-excursion (or (looking-at "[^<\n]*>") - (looking-back "<[^>\n]*") + (ispell-looking-back "<[^>\n]*") (and (looking-at "[^&\n]*;") - (looking-back "&[^;\n]*")))))) + (ispell-looking-back "&[^;\n]*")))))) ;;*---------------------------------------------------------------------*/ ;;* Programming mode */ diff -r 0af21ded137d -r 99f2f3ae1c56 lisp/textmodes/ispell.el --- a/lisp/textmodes/ispell.el Thu Jun 25 08:02:34 2009 +0000 +++ b/lisp/textmodes/ispell.el Thu Jun 25 11:25:09 2009 +0000 @@ -196,12 +196,13 @@ ;; Improved message reference matching in `ispell-message'. ;; Fixed bug in returning to nroff mode from tex mode. -;;; Compatibility code for xemacs and (not too) older emacsen: - -(eval-and-compile ;; Protect against declare-function undefined in xemacs +;;; Compatibility code for XEmacs and (not too) older emacsen: + +(eval-and-compile ;; Protect against declare-function undefined in XEmacs (unless (fboundp 'declare-function) (defmacro declare-function (&rest r)))) (declare-function ispell-check-minver "ispell" (v1 v2)) +(declare-function ispell-looking-back "ispell" (regexp &optional limit)) (if (fboundp 'version<=) (defalias 'ispell-check-minver 'version<=) @@ -238,6 +239,21 @@ (setq pending nil)))) return))) +;; XEmacs does not have looking-back +(if (fboundp 'looking-back) + (defalias 'ispell-looking-back 'looking-back) + (defun ispell-looking-back (regexp &optional limit &rest ignored) + "Return non-nil if text before point matches regular expression REGEXP. +Like `looking-at' except matches before point, and is slower. +LIMIT if non-nil speeds up the search by specifying a minimum +starting position, to avoid checking matches that would start +before LIMIT. + +This is a stripped down compatibility function for use when +full featured `looking-back' function is missing." + (save-excursion + (re-search-backward (concat "\\(?:" regexp "\\)\\=") limit t)))) + ;;; Code: (defvar mail-yank-prefix)