emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r101507: * lisp/textmodes/ispell.el (


From: Stefan Monnier
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r101507: * lisp/textmodes/ispell.el (ispell-start, ispell-end): Rename from `start'
Date: Mon, 20 Sep 2010 16:15:27 +0200
User-agent: Bazaar (2.0.3)

------------------------------------------------------------
revno: 101507
committer: Stefan Monnier <address@hidden>
branch nick: trunk
timestamp: Mon 2010-09-20 16:15:27 +0200
message:
  * lisp/textmodes/ispell.el (ispell-start, ispell-end): Rename from `start'
  and `end'.
  (ispell-region, ispell-process-line): Update users.
modified:
  lisp/ChangeLog
  lisp/textmodes/ispell.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2010-09-20 13:27:59 +0000
+++ b/lisp/ChangeLog    2010-09-20 14:15:27 +0000
@@ -1,5 +1,9 @@
 2010-09-20  Stefan Monnier  <address@hidden>
 
+       * textmodes/ispell.el (ispell-start, ispell-end): Rename from `start'
+       and `end'.
+       (ispell-region, ispell-process-line): Update users.
+
        * textmodes/reftex-parse.el (reftex-what-macro): Don't hardcode
        point-min==1.
 

=== modified file 'lisp/textmodes/ispell.el'
--- a/lisp/textmodes/ispell.el  2010-09-20 11:53:42 +0000
+++ b/lisp/textmodes/ispell.el  2010-09-20 14:15:27 +0000
@@ -2816,7 +2816,11 @@
       (setq ispell-current-dictionary dict
            ispell-current-personal-dictionary pdict))))
 
-;;; Spelling of comments are checked when ispell-check-comments is non-nil.
+;; Avoid error messages when compiling for these dynamic variables.
+(defvar ispell-start)
+(defvar ispell-end)
+
+;; Spelling of comments are checked when ispell-check-comments is non-nil.
 
 ;;;###autoload
 (defun ispell-region (reg-start reg-end &optional recheckp shift)
@@ -2893,18 +2897,20 @@
                                 (if (marker-position skip-region-start)
                                     (min skip-region-start ispell-region-end)
                                   (marker-position ispell-region-end))))
-             (let* ((start (point))
-                    (end (save-excursion (end-of-line) (min (point) reg-end)))
-                    (string (ispell-get-line start end in-comment)))
+             (let* ((ispell-start (point))
+                    (ispell-end (save-excursion
+                                   (end-of-line) (min (point) reg-end)))
+                    (string (ispell-get-line
+                              ispell-start ispell-end in-comment)))
                (if in-comment          ; account for comment chars added
-                   (setq start (- start (length in-comment))
+                   (setq ispell-start (- ispell-start (length in-comment))
                          in-comment nil))
-               (setq end (point))      ; "end" tracks region retrieved.
+               (setq ispell-end (point)) ; "end" tracks region retrieved.
                (if string              ; there is something to spell check!
                    ;; (special start end)
                    (setq shift (ispell-process-line string
                                                     (and recheckp shift))))
-               (goto-char end)))))
+               (goto-char ispell-end)))))
        (if ispell-quit
            nil
          (or shift 0)))
@@ -3136,17 +3142,13 @@
                                       (point) (+ (point) len))
                                      coding)))))
 
-;; Avoid error messages when compiling for these dynamic variables.
-;; FIXME: dynamically scoped vars should have an "ispell-" prefix.
-(defvar start)
-(defvar end)
-
 (defun ispell-process-line (string shift)
   "Send STRING, a line of text, to ispell and processes the result.
 This will modify the buffer for spelling errors.
-Requires variables START and END to be defined in its lexical scope.
+Requires variables ISPELL-START and ISPELL-END to be defined in its
+dynamic scope.
 Returns the sum SHIFT due to changes in word replacements."
-  ;;(declare special start end)
+  ;;(declare special ispell-start ispell-end)
   (let (poss accept-list)
     (if (not (numberp shift))
        (setq shift 0))
@@ -3169,10 +3171,10 @@
          ;; Markers can move with highlighting!  This destroys
          ;; end of region markers line-end and ispell-region-end
          (let ((word-start
-                (copy-marker (+ start ispell-offset (car (cdr poss)))))
+                (copy-marker (+ ispell-start ispell-offset (car (cdr poss)))))
                (word-len (length (car poss)))
-               (line-end (copy-marker end))
-               (line-start (copy-marker start))
+               (line-end (copy-marker ispell-end))
+               (line-start (copy-marker ispell-start))
                recheck-region replace)
            (goto-char word-start)
            ;; Adjust the horizontal scroll & point
@@ -3279,11 +3281,12 @@
                    (file-name-nondirectory ispell-program-name)
                    (or ispell-current-dictionary "default"))))
            (sit-for 0)
-           (setq start (marker-position line-start)
-                 end (marker-position line-end))
+           (setq ispell-start (marker-position line-start)
+                 ispell-end (marker-position line-end))
            ;; Adjust markers when end of region lost from highlighting.
-           (if (and (not recheck-region) (< end (+ word-start word-len)))
-               (setq end (+ word-start word-len)))
+           (if (and (not recheck-region)
+                     (< ispell-end (+ word-start word-len)))
+               (setq ispell-end (+ word-start word-len)))
            (if (= word-start ispell-region-end)
                (set-marker ispell-region-end (+ word-start word-len)))
            ;; going out of scope - unneeded


reply via email to

[Prev in Thread] Current Thread [Next in Thread]