changeset 24943:59585a4135a6

(flyspell-get-word): Add special handling for when ispell-otherchars is empty.
author Richard M. Stallman <rms@gnu.org>
date Mon, 12 Jul 1999 16:01:16 +0000
parents 517194c6cdc6
children 052b3b8dcccc
files lisp/textmodes/flyspell.el
diffstat 1 files changed, 24 insertions(+), 20 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/textmodes/flyspell.el	Mon Jul 12 16:00:42 1999 +0000
+++ b/lisp/textmodes/flyspell.el	Mon Jul 12 16:01:16 1999 +0000
@@ -731,14 +731,17 @@
 	 (flyspell-not-casechars (flyspell-get-not-casechars))
 	 (ispell-otherchars (ispell-get-otherchars))
 	 (ispell-many-otherchars-p (ispell-get-many-otherchars-p))
-	 (word-regexp (concat flyspell-casechars
-			      "+\\("
-			      ispell-otherchars
-			      "?"
-			      flyspell-casechars
-			      "+\\)"
-			      (if ispell-many-otherchars-p
-				  "*" "?")))
+	 (word-regexp (if (not (string= "" ispell-otherchars))
+			  (concat 
+			   flyspell-casechars
+			   "+\\("
+			   ispell-otherchars
+			   "?"
+			   flyspell-casechars
+			   "+\\)"
+			   (if ispell-many-otherchars-p
+			       "*" "?"))
+			(concat flyspell-casechars "+")))
 	 (tex-prelude "[\\\\{]")
 	 (tex-regexp  (if (eq ispell-parser 'tex)
 			  (concat tex-prelude "?" word-regexp "}?")
@@ -755,18 +758,19 @@
 	  (re-search-backward flyspell-casechars (point-min) t)))
     ;; move to front of word
     (re-search-backward flyspell-not-casechars (point-min) 'start)
-    (let ((pos nil))
-      (while (and (looking-at ispell-otherchars)
-		  (not (bobp))
-		  (or (not did-it-once)
-		      ispell-many-otherchars-p)
-		  (not (eq pos (point))))
-	(setq pos (point))
-	(setq did-it-once t)
-	(backward-char 1)
-	(if (looking-at flyspell-casechars)
-	    (re-search-backward flyspell-not-casechars (point-min) 'move)
-	  (backward-char -1))))
+    (if (not (string= "" ispell-otherchars))
+	(let ((pos nil))
+	  (while (and (looking-at ispell-otherchars)
+		      (not (bobp))
+		      (or (not did-it-once)
+			  ispell-many-otherchars-p)
+		      (not (eq pos (point))))
+	    (setq pos (point))
+	    (setq did-it-once t)
+	    (backward-char 1)
+	    (if (looking-at flyspell-casechars)
+		(re-search-backward flyspell-not-casechars (point-min) 'move)
+	      (backward-char -1)))))
     ;; Now mark the word and save to string.
     (if (eq (re-search-forward tex-regexp (point-max) t) nil)
 	nil