aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/textmodes
diff options
context:
space:
mode:
authorAgustín Martín2009-06-25 11:25:09 +0000
committerAgustín Martín2009-06-25 11:25:09 +0000
commite26a7bc01c5b7879be463a25c0cd0622d9f20861 (patch)
tree2defd9f1250366f811ca035cb2e4ca058fe4ddd4 /lisp/textmodes
parenta71ccf3ac8766a1099d8457f4968e50082928456 (diff)
downloademacs-e26a7bc01c5b7879be463a25c0cd0622d9f20861.tar.gz
emacs-e26a7bc01c5b7879be463a25c0cd0622d9f20861.zip
ispell.el: Add `ispell-looking-back' XEmacs compatibility function for `looking-back'
flyspell.el (sgml-mode-flyspell-verify): Use `ispell-looking-back'
Diffstat (limited to 'lisp/textmodes')
-rw-r--r--lisp/textmodes/flyspell.el4
-rw-r--r--lisp/textmodes/ispell.el20
2 files changed, 20 insertions, 4 deletions
diff --git a/lisp/textmodes/flyspell.el b/lisp/textmodes/flyspell.el
index d2cf0ba3877..f3a15b2c5cc 100644
--- a/lisp/textmodes/flyspell.el
+++ b/lisp/textmodes/flyspell.el
@@ -363,9 +363,9 @@ property of the major mode name.")
363 "Function used for `flyspell-generic-check-word-predicate' in SGML mode." 363 "Function used for `flyspell-generic-check-word-predicate' in SGML mode."
364 (not (save-excursion 364 (not (save-excursion
365 (or (looking-at "[^<\n]*>") 365 (or (looking-at "[^<\n]*>")
366 (looking-back "<[^>\n]*") 366 (ispell-looking-back "<[^>\n]*")
367 (and (looking-at "[^&\n]*;") 367 (and (looking-at "[^&\n]*;")
368 (looking-back "&[^;\n]*")))))) 368 (ispell-looking-back "&[^;\n]*"))))))
369 369
370;;*---------------------------------------------------------------------*/ 370;;*---------------------------------------------------------------------*/
371;;* Programming mode */ 371;;* Programming mode */
diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index 2f7b2e68fbd..86e663fed68 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -196,12 +196,13 @@
196;; Improved message reference matching in `ispell-message'. 196;; Improved message reference matching in `ispell-message'.
197;; Fixed bug in returning to nroff mode from tex mode. 197;; Fixed bug in returning to nroff mode from tex mode.
198 198
199;;; Compatibility code for xemacs and (not too) older emacsen: 199;;; Compatibility code for XEmacs and (not too) older emacsen:
200 200
201(eval-and-compile ;; Protect against declare-function undefined in xemacs 201(eval-and-compile ;; Protect against declare-function undefined in XEmacs
202 (unless (fboundp 'declare-function) (defmacro declare-function (&rest r)))) 202 (unless (fboundp 'declare-function) (defmacro declare-function (&rest r))))
203 203
204(declare-function ispell-check-minver "ispell" (v1 v2)) 204(declare-function ispell-check-minver "ispell" (v1 v2))
205(declare-function ispell-looking-back "ispell" (regexp &optional limit))
205 206
206(if (fboundp 'version<=) 207(if (fboundp 'version<=)
207 (defalias 'ispell-check-minver 'version<=) 208 (defalias 'ispell-check-minver 'version<=)
@@ -238,6 +239,21 @@ compatibility function in case `version<=' is not available."
238 (setq pending nil)))) 239 (setq pending nil))))
239 return))) 240 return)))
240 241
242;; XEmacs does not have looking-back
243(if (fboundp 'looking-back)
244 (defalias 'ispell-looking-back 'looking-back)
245 (defun ispell-looking-back (regexp &optional limit &rest ignored)
246 "Return non-nil if text before point matches regular expression REGEXP.
247Like `looking-at' except matches before point, and is slower.
248LIMIT if non-nil speeds up the search by specifying a minimum
249starting position, to avoid checking matches that would start
250before LIMIT.
251
252This is a stripped down compatibility function for use when
253full featured `looking-back' function is missing."
254 (save-excursion
255 (re-search-backward (concat "\\(?:" regexp "\\)\\=") limit t))))
256
241;;; Code: 257;;; Code:
242 258
243(defvar mail-yank-prefix) 259(defvar mail-yank-prefix)