diff options
| author | Agustín Martín | 2009-06-25 11:25:09 +0000 |
|---|---|---|
| committer | Agustín Martín | 2009-06-25 11:25:09 +0000 |
| commit | e26a7bc01c5b7879be463a25c0cd0622d9f20861 (patch) | |
| tree | 2defd9f1250366f811ca035cb2e4ca058fe4ddd4 /lisp | |
| parent | a71ccf3ac8766a1099d8457f4968e50082928456 (diff) | |
| download | emacs-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')
| -rw-r--r-- | lisp/ChangeLog | 8 | ||||
| -rw-r--r-- | lisp/textmodes/flyspell.el | 4 | ||||
| -rw-r--r-- | lisp/textmodes/ispell.el | 20 |
3 files changed, 28 insertions, 4 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index fed3621c9ee..a5650015086 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,11 @@ | |||
| 1 | 2009-06-25 Agustín Martín <agustin.martin@hispalinux.es> | ||
| 2 | |||
| 3 | * textmodes/ispell.el: Add `ispell-looking-back' XEmacs | ||
| 4 | compatibility function for `looking-back' | ||
| 5 | |||
| 6 | * textmodes/flyspell.el (sgml-mode-flyspell-verify): Use | ||
| 7 | `ispell-looking-back' | ||
| 8 | |||
| 1 | 2009-06-24 Michael Albinus <michael.albinus@gmx.de> | 9 | 2009-06-24 Michael Albinus <michael.albinus@gmx.de> |
| 2 | 10 | ||
| 3 | * net/tramp-gvfs.el (tramp-gvfs-handle-make-directory): Use `dir' | 11 | * net/tramp-gvfs.el (tramp-gvfs-handle-make-directory): Use `dir' |
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. | ||
| 247 | Like `looking-at' except matches before point, and is slower. | ||
| 248 | LIMIT if non-nil speeds up the search by specifying a minimum | ||
| 249 | starting position, to avoid checking matches that would start | ||
| 250 | before LIMIT. | ||
| 251 | |||
| 252 | This is a stripped down compatibility function for use when | ||
| 253 | full 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) |