summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1999-07-12 16:01:16 +0000
committerRichard M. Stallman <rms@gnu.org>1999-07-12 16:01:16 +0000
commit9658746b2a033069217972dc34bece79f4a41313 (patch)
treec66cf89bc04cdbf3181255014ccd3d5ae490992c
parent3a7855cec981db1e76aa88c7e892d298d72074ab (diff)
downloademacs-9658746b2a033069217972dc34bece79f4a41313.tar.gz
(flyspell-get-word): Add special handling for when ispell-otherchars is empty.
-rw-r--r--lisp/textmodes/flyspell.el44
1 files changed, 24 insertions, 20 deletions
diff --git a/lisp/textmodes/flyspell.el b/lisp/textmodes/flyspell.el
index 5daafc66368..4e546e1ab91 100644
--- a/lisp/textmodes/flyspell.el
+++ b/lisp/textmodes/flyspell.el
@@ -731,14 +731,17 @@ Word syntax described by `ispell-dictionary-alist' (which see)."
(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 @@ Word syntax described by `ispell-dictionary-alist' (which see)."
(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