]> git.eshelyaron.com Git - emacs.git/commitdiff
* textmodes/flyspell.el (flyspell-correct-word-before-point):
authorChong Yidong <cyd@stupidchicken.com>
Thu, 16 Apr 2009 18:45:20 +0000 (18:45 +0000)
committerChong Yidong <cyd@stupidchicken.com>
Thu, 16 Apr 2009 18:45:20 +0000 (18:45 +0000)
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.

lisp/ChangeLog
lisp/textmodes/flyspell.el

index b35f7c8893b9a9d6938447a5de1cd0a56e492df7..fcbac5c9e7f3d7e5132381751ecc13e2874f121c 100644 (file)
@@ -1,3 +1,12 @@
+2009-04-16  Chong Yidong  <cyd@stupidchicken.com>
+
+       * 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.
+
 2009-04-16  Robert Brown  <brown@google.com>  (tiny change)
 
        * emacs-lisp/lisp-mode.el: Give `deftype' a doc-string-elt
index 4b9121de94a4cb1709ce9a333f4f20610e127c60..d2cf0ba3877cd4a22f864225b361b9674f918ccb 100644 (file)
@@ -347,12 +347,12 @@ property of the major mode name.")
    (not (save-excursion
          (re-search-backward "^[ \t]*%%%[ \t]+Local" nil t)))
    (not (save-excursion
-         (let ((this (point-marker))
-               (e (progn (end-of-line) (point-marker))))
+         (let ((this (point)))
            (beginning-of-line)
-           (if (re-search-forward "\\\\\\(cite\\|label\\|ref\\){[^}]*}" e t)
-               (and (>= this (match-beginning 0))
-                    (<= this (match-end 0)) )))))))
+           (and (re-search-forward "\\\\\\(cite\\|label\\|ref\\){[^}]*}"
+                                   (line-end-position) t)
+                (>= this (match-beginning 0))
+                (<= this (match-end 0))))))))
 
 ;;*--- sgml mode -------------------------------------------------------*/
 (put 'sgml-mode 'flyspell-mode-predicate 'sgml-mode-flyspell-verify)
@@ -362,25 +362,10 @@ property of the major mode name.")
 (defun sgml-mode-flyspell-verify ()
   "Function used for `flyspell-generic-check-word-predicate' in SGML mode."
   (not (save-excursion
-        (let ((this (point-marker))
-              (s (progn (beginning-of-line) (point-marker)))
-              (e (progn (end-of-line) (point-marker))))
-          (or (progn
-                (goto-char this)
-                (and (re-search-forward  "[^<]*>" e t)
-                     (= (match-beginning 0) this)))
-              (progn
-                (goto-char this)
-                (and (re-search-backward "<[^>]*" s t)
-                     (= (match-end 0) this)))
-              (and (progn
-                     (goto-char this)
-                     (and (re-search-forward  "[^&]*;" e t)
-                          (= (match-beginning 0) this)))
-                   (progn
-                     (goto-char this)
-                     (and (re-search-backward "&[^;]*" s t)
-                          (= (match-end 0) this)))))))))
+        (or (looking-at "[^<\n]*>")
+            (looking-back "<[^>\n]*")
+            (and (looking-at "[^&\n]*;")
+                 (looking-back "&[^;\n]*"))))))
 
 ;;*---------------------------------------------------------------------*/
 ;;*    Programming mode                                                 */
@@ -2063,7 +2048,7 @@ If OPOINT is non-nil, restore point there after adjusting it for replacement."
     (error "Pop-up menus do not work on this terminal"))
   ;; use the correct dictionary
   (flyspell-accept-buffer-local-defs)
-  (or opoint (setq opoint (point-marker)))
+  (or opoint (setq opoint (point)))
   (let ((cursor-location (point))
        (word (flyspell-get-word nil)))
     (if (consp word)