comparison lisp/textmodes/flyspell.el @ 91204:53108e6cea98

Merge from emacs--devo--0 Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-294
author Miles Bader <miles@gnu.org>
date Thu, 06 Dec 2007 09:51:45 +0000
parents 880960b70474 3508192ca0a3
children 606f2d163a64
comparison
equal deleted inserted replaced
91203:db40129142b2 91204:53108e6cea98
1529 (erase-buffer) 1529 (erase-buffer)
1530 ;; this is done, we can start checking... 1530 ;; this is done, we can start checking...
1531 (if flyspell-issue-message-flag (message "Checking region...")) 1531 (if flyspell-issue-message-flag (message "Checking region..."))
1532 (set-buffer curbuf) 1532 (set-buffer curbuf)
1533 (ispell-check-version) 1533 (ispell-check-version)
1534 (let ((c (apply 'ispell-call-process-region beg 1534 ;; Local dictionary becomes the global dictionary in use.
1535 end 1535 (setq ispell-current-dictionary
1536 ispell-program-name 1536 (or ispell-local-dictionary ispell-dictionary))
1537 nil 1537 (setq ispell-current-personal-dictionary
1538 buffer 1538 (or ispell-local-pdict ispell-personal-dictionary))
1539 nil 1539 (let ((args (ispell-get-ispell-args))
1540 (if ispell-really-aspell "list" "-l") 1540 (encoding (ispell-get-coding-system))
1541 (let (args) 1541 c)
1542 ;; Local dictionary becomes the global dictionary in use. 1542 (if (and ispell-current-dictionary ; use specified dictionary
1543 (if ispell-local-dictionary 1543 (not (member "-d" args))) ; only define if not overridden
1544 (setq ispell-dictionary ispell-local-dictionary)) 1544 (setq args
1545 (setq args (ispell-get-ispell-args)) 1545 (append (list "-d" ispell-current-dictionary) args)))
1546 (if ispell-dictionary ; use specified dictionary 1546 (if ispell-current-personal-dictionary ; use specified pers dict
1547 (setq args 1547 (setq args
1548 (append (list "-d" ispell-dictionary) args))) 1548 (append args
1549 (if ispell-personal-dictionary ; use specified pers dict 1549 (list "-p"
1550 (setq args 1550 (expand-file-name
1551 (append args 1551 ispell-current-personal-dictionary)))))
1552 (list "-p" 1552 (setq args (append args ispell-extra-args))
1553 (expand-file-name 1553 (if (and ispell-really-aspell
1554 ispell-personal-dictionary))))) 1554 ispell-aspell-supports-utf8)
1555 (setq args (append args ispell-extra-args)) 1555 (setq args
1556 args)))) 1556 (append args
1557 (list
1558 (concat "--encoding="
1559 (symbol-name
1560 encoding))))))
1561 (let ((process-coding-system-alist (list (cons "\\.*" encoding))))
1562 (setq c (apply 'ispell-call-process-region beg
1563 end
1564 ispell-program-name
1565 nil
1566 buffer
1567 nil
1568 (if ispell-really-aspell "list" "-l")
1569 args)))
1557 (if (eq c 0) 1570 (if (eq c 0)
1558 (progn 1571 (progn
1559 (flyspell-process-localwords buffer) 1572 (flyspell-process-localwords buffer)
1560 (with-current-buffer curbuf 1573 (with-current-buffer curbuf
1561 (flyspell-delete-region-overlays beg end) 1574 (flyspell-delete-region-overlays beg end)