This fixes the bug that François Maltey encountered in
87mzvdmblw.fsf(a)localhost.localdomain, where adding (setq ispell-dictionary
"francais") didn't actually set ispell’s dictionary to French.
xemacs-packages/ispell/ChangeLog addition:
2005-01-14 Aidan Kehoe <kehoea(a)parhasard.net>
* ispell.el (ispell-change-dictionary): Don't necessarily nuke
ispell-dictionary on every call from
ispell-buffer-local-dict. This allows the advertised method of
defaulting the dictionary--
(setq ispell-dictionary "language-name")
--to actually work.
Test cases:
;; The assertion failed before, but succeeds after this
;; change.
(let ((ispell-dictionary "american"))
(with-string-as-buffer-contents
(concat "once upon a time, when pigs spoke rhyme, "
"and monkeys chewed tobacco")
(ispell-region (point-min) (point-max)))
(assert (equal ispell-dictionary "american")))
;; This checks that the if statment that was
;; modified still works. Succeeds both before and after the
;; change.
(let ((ispell-dictionary "american"))
(ispell-change-dictionary "british" '(4))
(assert (equal ispell-dictionary "british")))
XEmacs Packages source patch:
Diff command: cvs -q diff -u
Files affected: xemacs-packages/ispell/ispell.el
Index: xemacs-packages/ispell/ispell.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/ispell/ispell.el,v
retrieving revision 1.20
diff -u -r1.20 ispell.el
--- xemacs-packages/ispell/ispell.el 2004/01/14 05:35:57 1.20
+++ xemacs-packages/ispell/ispell.el 2005/01/14 20:39:50
@@ -2389,7 +2389,7 @@
(t ; reset dictionary!
(if (assoc dict ispell-dictionary-alist)
(progn
- (if (or arg (null dict)) ; set default dictionary
+ (if (and arg dict) ; set default dictionary
(setq ispell-dictionary dict))
(if (null arg) ; set local dictionary
(setq ispell-local-dictionary dict)))
--
“Ah come on now Ted, a Volkswagen with a mind of its own, driving all over
the place and going mad, if that’s not scary I don’t know what is.”