changeset 4256:aaf846efe4cb

(ispell-point): Do nothing if there's no word at START.
author Richard M. Stallman <rms@gnu.org>
date Sat, 24 Jul 1993 05:33:38 +0000
parents 4b65e1ff27b8
children f8b1ea675224
files lisp/textmodes/=ispell4.el
diffstat 1 files changed, 24 insertions(+), 24 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/textmodes/=ispell4.el	Fri Jul 23 23:23:57 1993 +0000
+++ b/lisp/textmodes/=ispell4.el	Sat Jul 24 05:33:38 1993 +0000
@@ -419,36 +419,36 @@
     (setq start (point-marker))
     (ispell-find-word-end)		;now find correct end
     (setq end (point-marker))
-    (if (>= start end)
-	(error "No word %s" message))
-    (while (< start end)
-      (goto-char start)
-      (ispell-find-word-end)		;find end of current word
+    ;; Do nothing if we don't find a word.
+    (if (< start end)
+	(while (< start end)
+	  (goto-char start)
+	  (ispell-find-word-end)	;find end of current word
 					;could be before 'end' if
 					;user typed replacement
 					;that is more than one word
-      (set-marker wend (point))
-      (setq rescan nil)
-      (setq word (buffer-substring start wend))
-      (cond ((ispell-still-bad word)
+	  (set-marker wend (point))
+	  (setq rescan nil)
+	  (setq word (buffer-substring start wend))
+	  (cond ((ispell-still-bad word)
 ;;; This just causes confusion. -- rms.
 ;;;	     (goto-char start)
 ;;;	     (sit-for 0)
-	     (message (format "Ispell checking %s" word))
-	     (ispell-cmd word)
-	     (let ((message (ispell-next-message)))
-	       (cond ((eq message t)
-		      (message "%s: ok" word))
-		     ((or (null message)
-			  (consp message))
-		      (setq rescan
-			    (ispell-command-loop word start wend message)))
-		     (t
-		      (error "unknown ispell response %s" message))))))
-      (cond ((null rescan)
-	     (goto-char wend)
-	     (ispell-next-word)
-	     (set-marker start (point)))))
+		 (message (format "Ispell checking %s" word))
+		 (ispell-cmd word)
+		 (let ((message (ispell-next-message)))
+		   (cond ((eq message t)
+			  (message "%s: ok" word))
+			 ((or (null message)
+			      (consp message))
+			  (setq rescan
+				(ispell-command-loop word start wend message)))
+			 (t
+			  (error "unknown ispell response %s" message))))))
+	  (cond ((null rescan)
+		 (goto-char wend)
+		 (ispell-next-word)
+		 (set-marker start (point))))))
     ;;clear the choices buffer; otherwise it's hard for the user to tell
     ;;when we get back to the command loop
     (let ((buf (get-buffer "*ispell choices*")))