From: Agustín Martín Date: Wed, 16 May 2012 08:35:11 +0000 (+0200) Subject: textmodes/flyspell.el: Delay for otherchars as for normal word components. X-Git-Tag: emacs-24.2.90~471^2~64 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=65034a51d64ca14de163a4f774bbcb12a6f501c3;p=emacs.git textmodes/flyspell.el: Delay for otherchars as for normal word components. (flyspell-check-pre-word-p, flyspell-check-word-p, flyspell-debug-signal-word-checked): Use for otherchars the same delay used for other word components, so word is not inmediately checked unless we are in a char that is neither a normal word component nor an otherchar. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index cec6cdc26b4..60b238e79d1 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2012-05-16 Agustín Martín Domingo + + * flyspell.el (flyspell-check-pre-word-p, flyspell-check-word-p) + (flyspell-debug-signal-word-checked): Delay for otherchars as for + normal word components. + 2012-05-16 Stefan Monnier * minibuffer.el (completion--sifn-requote): Fix last change. diff --git a/lisp/textmodes/flyspell.el b/lisp/textmodes/flyspell.el index 33fa551c8a4..156a7e532e8 100644 --- a/lisp/textmodes/flyspell.el +++ b/lisp/textmodes/flyspell.el @@ -739,7 +739,10 @@ before the current command." (eq flyspell-pre-pre-buffer flyspell-pre-buffer)) nil) ((or (and (= flyspell-pre-point (- (point) 1)) - (eq (char-syntax (char-after flyspell-pre-point)) ?w)) + (or (eq (char-syntax (char-after flyspell-pre-point)) ?w) + (string-match-p (ispell-get-otherchars) + (buffer-substring-no-properties + flyspell-pre-point (1+ flyspell-pre-point))))) (= flyspell-pre-point (point)) (= flyspell-pre-point (+ (point) 1))) nil) @@ -753,7 +756,10 @@ before the current command." ;; If other post-command-hooks change the buffer, ;; flyspell-pre-point can lie past eob (bug#468). (null (char-after flyspell-pre-point)) - (eq (char-syntax (char-after flyspell-pre-point)) ?w))) + (or (eq (char-syntax (char-after flyspell-pre-point)) ?w) + (string-match-p (ispell-get-otherchars) + (buffer-substring-no-properties + flyspell-pre-point (1+ flyspell-pre-point)))))) nil) ((not (eq (current-buffer) flyspell-pre-buffer)) t) @@ -815,6 +821,7 @@ Mostly we check word delimiters." (save-excursion (backward-char 1) (and (looking-at (flyspell-get-not-casechars)) + (not (looking-at (ispell-get-otherchars))) (or flyspell-consider-dash-as-word-delimiter-flag (not (looking-at "-")))))) ;; yes because we have reached or typed a word delimiter. @@ -880,6 +887,7 @@ Mostly we check word delimiters." (save-excursion (backward-char 1) (and (and (looking-at (flyspell-get-not-casechars)) 1) + (not (looking-at (ispell-get-otherchars))) (and (or flyspell-consider-dash-as-word-delimiter-flag (not (looking-at "\\-"))) 2)))))) c)))) @@ -895,6 +903,7 @@ Mostly we check word delimiters." (save-excursion (backward-char 1) (and (looking-at (flyspell-get-not-casechars)) + (not (looking-at (ispell-get-otherchars))) (or flyspell-consider-dash-as-word-delimiter-flag (not (looking-at "\\-")))))))) c))