aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1999-07-12 16:01:16 +0000
committerRichard M. Stallman1999-07-12 16:01:16 +0000
commit9658746b2a033069217972dc34bece79f4a41313 (patch)
treec66cf89bc04cdbf3181255014ccd3d5ae490992c
parent3a7855cec981db1e76aa88c7e892d298d72074ab (diff)
downloademacs-9658746b2a033069217972dc34bece79f4a41313.tar.gz
emacs-9658746b2a033069217972dc34bece79f4a41313.zip
(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)."
731 (flyspell-not-casechars (flyspell-get-not-casechars)) 731 (flyspell-not-casechars (flyspell-get-not-casechars))
732 (ispell-otherchars (ispell-get-otherchars)) 732 (ispell-otherchars (ispell-get-otherchars))
733 (ispell-many-otherchars-p (ispell-get-many-otherchars-p)) 733 (ispell-many-otherchars-p (ispell-get-many-otherchars-p))
734 (word-regexp (concat flyspell-casechars 734 (word-regexp (if (not (string= "" ispell-otherchars))
735 "+\\(" 735 (concat
736 ispell-otherchars 736 flyspell-casechars
737 "?" 737 "+\\("
738 flyspell-casechars 738 ispell-otherchars
739 "+\\)" 739 "?"
740 (if ispell-many-otherchars-p 740 flyspell-casechars
741 "*" "?"))) 741 "+\\)"
742 (if ispell-many-otherchars-p
743 "*" "?"))
744 (concat flyspell-casechars "+")))
742 (tex-prelude "[\\\\{]") 745 (tex-prelude "[\\\\{]")
743 (tex-regexp (if (eq ispell-parser 'tex) 746 (tex-regexp (if (eq ispell-parser 'tex)
744 (concat tex-prelude "?" word-regexp "}?") 747 (concat tex-prelude "?" word-regexp "}?")
@@ -755,18 +758,19 @@ Word syntax described by `ispell-dictionary-alist' (which see)."
755 (re-search-backward flyspell-casechars (point-min) t))) 758 (re-search-backward flyspell-casechars (point-min) t)))
756 ;; move to front of word 759 ;; move to front of word
757 (re-search-backward flyspell-not-casechars (point-min) 'start) 760 (re-search-backward flyspell-not-casechars (point-min) 'start)
758 (let ((pos nil)) 761 (if (not (string= "" ispell-otherchars))
759 (while (and (looking-at ispell-otherchars) 762 (let ((pos nil))
760 (not (bobp)) 763 (while (and (looking-at ispell-otherchars)
761 (or (not did-it-once) 764 (not (bobp))
762 ispell-many-otherchars-p) 765 (or (not did-it-once)
763 (not (eq pos (point)))) 766 ispell-many-otherchars-p)
764 (setq pos (point)) 767 (not (eq pos (point))))
765 (setq did-it-once t) 768 (setq pos (point))
766 (backward-char 1) 769 (setq did-it-once t)
767 (if (looking-at flyspell-casechars) 770 (backward-char 1)
768 (re-search-backward flyspell-not-casechars (point-min) 'move) 771 (if (looking-at flyspell-casechars)
769 (backward-char -1)))) 772 (re-search-backward flyspell-not-casechars (point-min) 'move)
773 (backward-char -1)))))
770 ;; Now mark the word and save to string. 774 ;; Now mark the word and save to string.
771 (if (eq (re-search-forward tex-regexp (point-max) t) nil) 775 (if (eq (re-search-forward tex-regexp (point-max) t) nil)
772 nil 776 nil