aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAgustín Martín2012-05-16 10:35:11 +0200
committerAgustín Martín2012-05-16 10:35:11 +0200
commit65034a51d64ca14de163a4f774bbcb12a6f501c3 (patch)
treeeb98a09d4b4ad3c1aae20df91b43c793d63e967c
parent27cb7be27d1ee87665bd497af42e142e41a00765 (diff)
downloademacs-65034a51d64ca14de163a4f774bbcb12a6f501c3.tar.gz
emacs-65034a51d64ca14de163a4f774bbcb12a6f501c3.zip
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.
-rw-r--r--lisp/ChangeLog6
-rw-r--r--lisp/textmodes/flyspell.el13
2 files changed, 17 insertions, 2 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index cec6cdc26b4..60b238e79d1 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,9 @@
12012-05-16 Agustín Martín Domingo <agustin.martin@hispalinux.es>
2
3 * flyspell.el (flyspell-check-pre-word-p, flyspell-check-word-p)
4 (flyspell-debug-signal-word-checked): Delay for otherchars as for
5 normal word components.
6
12012-05-16 Stefan Monnier <monnier@iro.umontreal.ca> 72012-05-16 Stefan Monnier <monnier@iro.umontreal.ca>
2 8
3 * minibuffer.el (completion--sifn-requote): Fix last change. 9 * 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."
739 (eq flyspell-pre-pre-buffer flyspell-pre-buffer)) 739 (eq flyspell-pre-pre-buffer flyspell-pre-buffer))
740 nil) 740 nil)
741 ((or (and (= flyspell-pre-point (- (point) 1)) 741 ((or (and (= flyspell-pre-point (- (point) 1))
742 (eq (char-syntax (char-after flyspell-pre-point)) ?w)) 742 (or (eq (char-syntax (char-after flyspell-pre-point)) ?w)
743 (string-match-p (ispell-get-otherchars)
744 (buffer-substring-no-properties
745 flyspell-pre-point (1+ flyspell-pre-point)))))
743 (= flyspell-pre-point (point)) 746 (= flyspell-pre-point (point))
744 (= flyspell-pre-point (+ (point) 1))) 747 (= flyspell-pre-point (+ (point) 1)))
745 nil) 748 nil)
@@ -753,7 +756,10 @@ before the current command."
753 ;; If other post-command-hooks change the buffer, 756 ;; If other post-command-hooks change the buffer,
754 ;; flyspell-pre-point can lie past eob (bug#468). 757 ;; flyspell-pre-point can lie past eob (bug#468).
755 (null (char-after flyspell-pre-point)) 758 (null (char-after flyspell-pre-point))
756 (eq (char-syntax (char-after flyspell-pre-point)) ?w))) 759 (or (eq (char-syntax (char-after flyspell-pre-point)) ?w)
760 (string-match-p (ispell-get-otherchars)
761 (buffer-substring-no-properties
762 flyspell-pre-point (1+ flyspell-pre-point))))))
757 nil) 763 nil)
758 ((not (eq (current-buffer) flyspell-pre-buffer)) 764 ((not (eq (current-buffer) flyspell-pre-buffer))
759 t) 765 t)
@@ -815,6 +821,7 @@ Mostly we check word delimiters."
815 (save-excursion 821 (save-excursion
816 (backward-char 1) 822 (backward-char 1)
817 (and (looking-at (flyspell-get-not-casechars)) 823 (and (looking-at (flyspell-get-not-casechars))
824 (not (looking-at (ispell-get-otherchars)))
818 (or flyspell-consider-dash-as-word-delimiter-flag 825 (or flyspell-consider-dash-as-word-delimiter-flag
819 (not (looking-at "-")))))) 826 (not (looking-at "-"))))))
820 ;; yes because we have reached or typed a word delimiter. 827 ;; yes because we have reached or typed a word delimiter.
@@ -880,6 +887,7 @@ Mostly we check word delimiters."
880 (save-excursion 887 (save-excursion
881 (backward-char 1) 888 (backward-char 1)
882 (and (and (looking-at (flyspell-get-not-casechars)) 1) 889 (and (and (looking-at (flyspell-get-not-casechars)) 1)
890 (not (looking-at (ispell-get-otherchars)))
883 (and (or flyspell-consider-dash-as-word-delimiter-flag 891 (and (or flyspell-consider-dash-as-word-delimiter-flag
884 (not (looking-at "\\-"))) 2)))))) 892 (not (looking-at "\\-"))) 2))))))
885 c)))) 893 c))))
@@ -895,6 +903,7 @@ Mostly we check word delimiters."
895 (save-excursion 903 (save-excursion
896 (backward-char 1) 904 (backward-char 1)
897 (and (looking-at (flyspell-get-not-casechars)) 905 (and (looking-at (flyspell-get-not-casechars))
906 (not (looking-at (ispell-get-otherchars)))
898 (or flyspell-consider-dash-as-word-delimiter-flag 907 (or flyspell-consider-dash-as-word-delimiter-flag
899 (not (looking-at "\\-")))))))) 908 (not (looking-at "\\-"))))))))
900 c)) 909 c))