aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/ChangeLog7
-rw-r--r--lisp/textmodes/ispell.el83
2 files changed, 90 insertions, 0 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 60a69ad0236..6121ff190e8 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,10 @@
12013-01-21 Agustín Martín Domingo <agustin.martin@hispalinux.es>
2
3 * textmodes/ispell.el (ispell-hunspell-dictionary-equivs-alist):
4 New variable to map standard dict names to hunspell ones.
5 (ispell-set-spellchecker-params): Make sure specific dict names
6 are used for standard dicts with hunspell.
7
12013-01-21 Tassilo Horn <tsdh@gnu.org> 82013-01-21 Tassilo Horn <tsdh@gnu.org>
2 9
3 * textmodes/reftex-cite.el (reftex-format-citation): Add format 10 * textmodes/reftex-cite.el (reftex-format-citation): Add format
diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index 52e97b8248d..dbcf3910db8 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -773,6 +773,41 @@ here just for backwards compatibility.")
773(make-obsolete-variable 'ispell-aspell-supports-utf8 773(make-obsolete-variable 'ispell-aspell-supports-utf8
774 'ispell-encoding8-command "23.1") 774 'ispell-encoding8-command "23.1")
775 775
776(defvar ispell-hunspell-dictionary-equivs-alist
777 '(("american" "en_US")
778 ("brasileiro" "pt_BR")
779 ("british" "en_GB")
780 ("castellano" "es_ES")
781 ("castellano8" "es_ES")
782 ("czech" "cs_CZ")
783 ("dansk" "da_DK")
784 ("deutsch" "de_DE")
785 ("deutsch8" "de_DE")
786 ("english" "en_US")
787 ("esperanto" "eo")
788 ("esperanto-tex" "eo")
789 ("finnish" "fi_FI")
790 ("francais7" "fr_FR")
791 ("francais" "fr_FR")
792 ("francais-tex" "fr_FR")
793 ("german" "de_DE")
794 ("german8" "de_DE")
795 ("italiano" "it_IT")
796 ("nederlands" "nl_NL")
797 ("nederlands8" "nl_NL")
798 ("norsk" "nn_NO")
799 ("norsk7-tex" "nn_NO")
800 ("polish" "pl_PL")
801 ("portugues" "pt_PT")
802 ("russian" "ru_RU")
803 ("russianw" "ru_RU")
804 ("slovak" "sk_SK")
805 ("slovenian" "sl_SI")
806 ("svenska" "sv_SE")
807 ("hebrew" "he_IL"))
808 "Alist with matching hunspell dict names for standard dict names in
809 `ispell-dictionary-base-alist'.")
810
776(defvar ispell-emacs-alpha-regexp 811(defvar ispell-emacs-alpha-regexp
777 (if (string-match "^[[:alpha:]]+$" "abcde") 812 (if (string-match "^[[:alpha:]]+$" "abcde")
778 "[[:alpha:]]" 813 "[[:alpha:]]"
@@ -1134,9 +1169,57 @@ aspell is used along with Emacs).")
1134 ispell-encoding8-command) 1169 ispell-encoding8-command)
1135 ispell-aspell-dictionary-alist 1170 ispell-aspell-dictionary-alist
1136 nil)) 1171 nil))
1172 (ispell-dictionary-base-alist ispell-dictionary-base-alist)
1137 ispell-base-dicts-override-alist ; Override only base-dicts-alist 1173 ispell-base-dicts-override-alist ; Override only base-dicts-alist
1138 all-dicts-alist) 1174 all-dicts-alist)
1139 1175
1176 ;; While ispell and aspell (through aliases) use the traditional
1177 ;; dict naming originally expected by ispell.el, hunspell
1178 ;; uses locale based names with no alias. We need to map
1179 ;; standard names to locale based names to make default dict
1180 ;; definitions available for hunspell.
1181 (if ispell-really-hunspell
1182 (let (tmp-dicts-alist)
1183 (dolist (adict ispell-dictionary-base-alist)
1184 (let* ((dict-name (nth 0 adict))
1185 (dict-equiv
1186 (cadr (assoc dict-name
1187 ispell-hunspell-dictionary-equivs-alist)))
1188 (ispell-args (nth 5 adict))
1189 (ispell-args-has-d (member "-d" ispell-args))
1190 skip-dict)
1191 ;; Remove "-d" option from `ispell-args' if present
1192 (if ispell-args-has-d
1193 (let ((ispell-args-after-d
1194 (cdr (cdr ispell-args-has-d)))
1195 (ispell-args-before-d
1196 (butlast ispell-args (length ispell-args-has-d))))
1197 (setq ispell-args
1198 (nconc ispell-args-before-d
1199 ispell-args-after-d))))
1200 ;; Unless default dict, re-add "-d" option with the mapped value
1201 (if dict-name
1202 (if dict-equiv
1203 (nconc ispell-args (list "-d" dict-equiv))
1204 (message
1205 "ispell-set-spellchecker-params: Missing hunspell equiv for \"%s\". Skipping."
1206 dict-name)
1207 (setq skip-dict t)))
1208
1209 (unless skip-dict
1210 (add-to-list 'tmp-dicts-alist
1211 (list
1212 dict-name ; dict name
1213 (nth 1 adict) ; casechars
1214 (nth 2 adict) ; not-casechars
1215 (nth 3 adict) ; otherchars
1216 (nth 4 adict) ; many-otherchars-p
1217 ispell-args ; ispell-args
1218 (nth 6 adict) ; extended-character-mode
1219 (nth 7 adict) ; dict encoding
1220 ))))
1221 (setq ispell-dictionary-base-alist tmp-dicts-alist))))
1222
1140 (run-hooks 'ispell-initialize-spellchecker-hook) 1223 (run-hooks 'ispell-initialize-spellchecker-hook)
1141 1224
1142 ;; Add dicts to ``ispell-dictionary-alist'' unless already present. 1225 ;; Add dicts to ``ispell-dictionary-alist'' unless already present.