aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAgustín Martín2012-04-16 11:49:51 +0200
committerAgustín Martín2012-04-16 11:49:51 +0200
commit177eca34cbb28be0835f63e2a3b0fa96c43281d7 (patch)
tree2c62e4bb8b26207fde0c785e39b5c969aee672d4
parent4b5afbb0d98ba4a95359ca5edaee8c3ecd7ae007 (diff)
downloademacs-177eca34cbb28be0835f63e2a3b0fa96c43281d7.tar.gz
emacs-177eca34cbb28be0835f63e2a3b0fa96c43281d7.zip
ispell.el (ispell-set-spellchecker-params): Make dicts use [:alpha:] if
possible. If Emacs flavour supports [:alpha:] regexps, use it for Casechars and Not-Casechars. This currently means use it unless flavour is XEmacs. Fixes: debbugs:11200
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/textmodes/ispell.el32
2 files changed, 33 insertions, 4 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index f50af02a239..7ebeea0a9dd 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12012-04-12 Agustín Martín Domingo <agustin.martin@hispalinux.es>
2
3 * ispell.el (ispell-set-spellchecker-params): Post-process
4 `ispell-dictionary-alist' to use [:alpha:] if possible.
5
12012-04-16 Chong Yidong <cyd@gnu.org> 62012-04-16 Chong Yidong <cyd@gnu.org>
2 7
3 * image.el (imagemagick--extension-regexp): New variable. 8 * image.el (imagemagick--extension-regexp): New variable.
diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index 37311b7337d..cfb1a2b3607 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -767,6 +767,12 @@ here just for backwards compatibility.")
767(make-obsolete-variable 'ispell-aspell-supports-utf8 767(make-obsolete-variable 'ispell-aspell-supports-utf8
768 'ispell-encoding8-command "23.1") 768 'ispell-encoding8-command "23.1")
769 769
770(defvar ispell-emacs-alpha-regexp
771 (if (string-match "^[[:alpha:]]+$" "abcde")
772 "[[:alpha:]]"
773 nil)
774 "[[:alpha:]] if Emacs supports [:alpha:] regexp, nil
775otherwise (current XEmacs does not support it).")
770 776
771;;; ********************************************************************** 777;;; **********************************************************************
772;;; The following are used by ispell, and should not be changed. 778;;; The following are used by ispell, and should not be changed.
@@ -1092,8 +1098,7 @@ aspell is used along with Emacs).")
1092 (error nil)) 1098 (error nil))
1093 ispell-really-aspell 1099 ispell-really-aspell
1094 ispell-encoding8-command 1100 ispell-encoding8-command
1095 ;; XEmacs does not like [:alpha:] regexps. 1101 ispell-emacs-alpha-regexp)
1096 (string-match "^[[:alpha:]]+$" "abcde"))
1097 (unless ispell-aspell-dictionary-alist 1102 (unless ispell-aspell-dictionary-alist
1098 (ispell-find-aspell-dictionaries))) 1103 (ispell-find-aspell-dictionaries)))
1099 1104
@@ -1117,8 +1122,27 @@ aspell is used along with Emacs).")
1117 ispell-dictionary-base-alist)) 1122 ispell-dictionary-base-alist))
1118 (unless (assoc (car dict) all-dicts-alist) 1123 (unless (assoc (car dict) all-dicts-alist)
1119 (add-to-list 'all-dicts-alist dict))) 1124 (add-to-list 'all-dicts-alist dict)))
1120 (setq ispell-dictionary-alist all-dicts-alist)))) 1125 (setq ispell-dictionary-alist all-dicts-alist))
1121 1126
1127 ;; If Emacs flavor supports [:alpha:] use it for global dicts. If
1128 ;; spellchecker also supports UTF-8 via command-line option use it
1129 ;; in communication. This does not affect definitions in ~/.emacs.
1130 (if ispell-emacs-alpha-regexp
1131 (let (tmp-dicts-alist)
1132 (dolist (adict ispell-dictionary-alist)
1133 (add-to-list 'tmp-dicts-alist
1134 (list
1135 (nth 0 adict) ; dict name
1136 "[[:alpha:]]" ; casechars
1137 "[^[:alpha:]]" ; not-casechars
1138 (nth 3 adict) ; otherchars
1139 (nth 4 adict) ; many-otherchars-p
1140 (nth 5 adict) ; ispell-args
1141 (nth 6 adict) ; extended-character-mode
1142 (if ispell-encoding8-command
1143 'utf-8
1144 (nth 7 adict)))))
1145 (setq ispell-dictionary-alist tmp-dicts-alist)))))
1122 1146
1123(defun ispell-valid-dictionary-list () 1147(defun ispell-valid-dictionary-list ()
1124 "Return a list of valid dictionaries. 1148 "Return a list of valid dictionaries.