diff options
| author | Chong Yidong | 2009-04-16 18:45:20 +0000 |
|---|---|---|
| committer | Chong Yidong | 2009-04-16 18:45:20 +0000 |
| commit | 873f4645aa3caaf2d0e5fe136f29600649315b31 (patch) | |
| tree | eb0353fb0f337570fc5262ee970bfc8d56a9216c | |
| parent | e7deaab0bcbd095f3a6278b74e7cd29c0913370e (diff) | |
| download | emacs-873f4645aa3caaf2d0e5fe136f29600649315b31.tar.gz emacs-873f4645aa3caaf2d0e5fe136f29600649315b31.zip | |
* textmodes/flyspell.el (flyspell-correct-word-before-point):
Don't create markers.
(tex-mode-flyspell-verify): Don't create markers. Use
line-end-position.
(sgml-mode-flyspell-verify): Don't create markers. Simplify code
using looking-at and looking-back.
| -rw-r--r-- | lisp/ChangeLog | 9 | ||||
| -rw-r--r-- | lisp/textmodes/flyspell.el | 35 |
2 files changed, 19 insertions, 25 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index b35f7c8893b..fcbac5c9e7f 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,12 @@ | |||
| 1 | 2009-04-16 Chong Yidong <cyd@stupidchicken.com> | ||
| 2 | |||
| 3 | * textmodes/flyspell.el (flyspell-correct-word-before-point): | ||
| 4 | Don't create markers. | ||
| 5 | (tex-mode-flyspell-verify): Don't create markers. Use | ||
| 6 | line-end-position. | ||
| 7 | (sgml-mode-flyspell-verify): Don't create markers. Simplify code | ||
| 8 | using looking-at and looking-back. | ||
| 9 | |||
| 1 | 2009-04-16 Robert Brown <brown@google.com> (tiny change) | 10 | 2009-04-16 Robert Brown <brown@google.com> (tiny change) |
| 2 | 11 | ||
| 3 | * emacs-lisp/lisp-mode.el: Give `deftype' a doc-string-elt | 12 | * emacs-lisp/lisp-mode.el: Give `deftype' a doc-string-elt |
diff --git a/lisp/textmodes/flyspell.el b/lisp/textmodes/flyspell.el index 4b9121de94a..d2cf0ba3877 100644 --- a/lisp/textmodes/flyspell.el +++ b/lisp/textmodes/flyspell.el | |||
| @@ -347,12 +347,12 @@ property of the major mode name.") | |||
| 347 | (not (save-excursion | 347 | (not (save-excursion |
| 348 | (re-search-backward "^[ \t]*%%%[ \t]+Local" nil t))) | 348 | (re-search-backward "^[ \t]*%%%[ \t]+Local" nil t))) |
| 349 | (not (save-excursion | 349 | (not (save-excursion |
| 350 | (let ((this (point-marker)) | 350 | (let ((this (point))) |
| 351 | (e (progn (end-of-line) (point-marker)))) | ||
| 352 | (beginning-of-line) | 351 | (beginning-of-line) |
| 353 | (if (re-search-forward "\\\\\\(cite\\|label\\|ref\\){[^}]*}" e t) | 352 | (and (re-search-forward "\\\\\\(cite\\|label\\|ref\\){[^}]*}" |
| 354 | (and (>= this (match-beginning 0)) | 353 | (line-end-position) t) |
| 355 | (<= this (match-end 0)) ))))))) | 354 | (>= this (match-beginning 0)) |
| 355 | (<= this (match-end 0)))))))) | ||
| 356 | 356 | ||
| 357 | ;;*--- sgml mode -------------------------------------------------------*/ | 357 | ;;*--- sgml mode -------------------------------------------------------*/ |
| 358 | (put 'sgml-mode 'flyspell-mode-predicate 'sgml-mode-flyspell-verify) | 358 | (put 'sgml-mode 'flyspell-mode-predicate 'sgml-mode-flyspell-verify) |
| @@ -362,25 +362,10 @@ property of the major mode name.") | |||
| 362 | (defun sgml-mode-flyspell-verify () | 362 | (defun sgml-mode-flyspell-verify () |
| 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 | (let ((this (point-marker)) | 365 | (or (looking-at "[^<\n]*>") |
| 366 | (s (progn (beginning-of-line) (point-marker))) | 366 | (looking-back "<[^>\n]*") |
| 367 | (e (progn (end-of-line) (point-marker)))) | 367 | (and (looking-at "[^&\n]*;") |
| 368 | (or (progn | 368 | (looking-back "&[^;\n]*")))))) |
| 369 | (goto-char this) | ||
| 370 | (and (re-search-forward "[^<]*>" e t) | ||
| 371 | (= (match-beginning 0) this))) | ||
| 372 | (progn | ||
| 373 | (goto-char this) | ||
| 374 | (and (re-search-backward "<[^>]*" s t) | ||
| 375 | (= (match-end 0) this))) | ||
| 376 | (and (progn | ||
| 377 | (goto-char this) | ||
| 378 | (and (re-search-forward "[^&]*;" e t) | ||
| 379 | (= (match-beginning 0) this))) | ||
| 380 | (progn | ||
| 381 | (goto-char this) | ||
| 382 | (and (re-search-backward "&[^;]*" s t) | ||
| 383 | (= (match-end 0) this))))))))) | ||
| 384 | 369 | ||
| 385 | ;;*---------------------------------------------------------------------*/ | 370 | ;;*---------------------------------------------------------------------*/ |
| 386 | ;;* Programming mode */ | 371 | ;;* Programming mode */ |
| @@ -2063,7 +2048,7 @@ If OPOINT is non-nil, restore point there after adjusting it for replacement." | |||
| 2063 | (error "Pop-up menus do not work on this terminal")) | 2048 | (error "Pop-up menus do not work on this terminal")) |
| 2064 | ;; use the correct dictionary | 2049 | ;; use the correct dictionary |
| 2065 | (flyspell-accept-buffer-local-defs) | 2050 | (flyspell-accept-buffer-local-defs) |
| 2066 | (or opoint (setq opoint (point-marker))) | 2051 | (or opoint (setq opoint (point))) |
| 2067 | (let ((cursor-location (point)) | 2052 | (let ((cursor-location (point)) |
| 2068 | (word (flyspell-get-word nil))) | 2053 | (word (flyspell-get-word nil))) |
| 2069 | (if (consp word) | 2054 | (if (consp word) |