From: Glenn Morris Date: Sun, 2 Dec 2007 18:18:19 +0000 (+0000) Subject: Agustín Martín X-Git-Tag: emacs-pretest-23.0.90~9161 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=a3614e04ba70e16856e26aaacd80effe481638d0;p=emacs.git Agustín Martín (flyspell-large-region): Explicitly set encoding for aspell process and for communication with it. Only add "-d" option if not already present. Use ispell-current-dictionary and ispell-current-personal-dictionary. General reorganization. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 79fcc774ecc..1e038f2a86c 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,15 @@ +2007-12-02 Agustin Martin + + * textmodes/flyspell.el (flyspell-large-region): Explicitly set + encoding for aspell process and for communication with it. + Only add "-d" option if not already present. + Use ispell-current-dictionary and ispell-current-personal-dictionary. + General reorganization. + + * textmodes/ispell.el (ispell-aspell-find-dictionary): Do not set + encoding here. + (ispell-start-process): Explicitly set encoding here if using aspell. + 2007-12-02 Dan Nicolaescu * pcvs.el (cvs-mode-commit, cvs-mode-edit-log): Also pass a diff diff --git a/lisp/textmodes/flyspell.el b/lisp/textmodes/flyspell.el index 73e8ec49045..16265ae42d1 100644 --- a/lisp/textmodes/flyspell.el +++ b/lisp/textmodes/flyspell.el @@ -1531,29 +1531,42 @@ The buffer to mark them in is `flyspell-large-region-buffer'." (if flyspell-issue-message-flag (message "Checking region...")) (set-buffer curbuf) (ispell-check-version) - (let ((c (apply 'ispell-call-process-region beg - end - ispell-program-name - nil - buffer - nil - (if ispell-really-aspell "list" "-l") - (let (args) - ;; Local dictionary becomes the global dictionary in use. - (if ispell-local-dictionary - (setq ispell-dictionary ispell-local-dictionary)) - (setq args (ispell-get-ispell-args)) - (if ispell-dictionary ; use specified dictionary - (setq args - (append (list "-d" ispell-dictionary) args))) - (if ispell-personal-dictionary ; use specified pers dict - (setq args - (append args - (list "-p" - (expand-file-name - ispell-personal-dictionary))))) - (setq args (append args ispell-extra-args)) - args)))) + ;; Local dictionary becomes the global dictionary in use. + (setq ispell-current-dictionary + (or ispell-local-dictionary ispell-dictionary)) + (setq ispell-current-personal-dictionary + (or ispell-local-pdict ispell-personal-dictionary)) + (let ((args (ispell-get-ispell-args)) + (encoding (ispell-get-coding-system)) + c) + (if (and ispell-current-dictionary ; use specified dictionary + (not (member "-d" args))) ; only define if not overridden + (setq args + (append (list "-d" ispell-current-dictionary) args))) + (if ispell-current-personal-dictionary ; use specified pers dict + (setq args + (append args + (list "-p" + (expand-file-name + ispell-current-personal-dictionary))))) + (setq args (append args ispell-extra-args)) + (if (and ispell-really-aspell + ispell-aspell-supports-utf8) + (setq args + (append args + (list + (concat "--encoding=" + (symbol-name + encoding)))))) + (let ((process-coding-system-alist (list (cons "\\.*" encoding)))) + (setq c (apply 'ispell-call-process-region beg + end + ispell-program-name + nil + buffer + nil + (if ispell-really-aspell "list" "-l") + args))) (if (eq c 0) (progn (flyspell-process-localwords buffer)