emacs-pretest-bug
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: aspell does not work


From: Magnus Henoch
Subject: Re: aspell does not work
Date: Mon, 19 Sep 2005 09:54:30 +0200
User-agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (berkeley-unix)

Peter Dyballa <address@hidden> writes:

> I am using: @(#) International Ispell Version 3.1.20 (but really Aspell 
> 0.60.2)
> The GNU Emacs CVS code is about one week old.
>
> I observed that it's helpful to invoke by hand/interactively 
> ispell-change-dictionary so that aspell runs with this extra argument: 
> --encoding=utf-8. It too seems to make it accept words with umlauts as 
> one word. I just started to read once more aspell.info to make aspell 
> launch from the start with the right arguments ...

Ah, now I see... for the record, invoking
ispell-find-aspell-dictionaries interactively would also work.

This should be done automatically, but currently it is only done in
ispell-change-dictionary.  This patch should fix the problem:

2005-09-19  Magnus Henoch  <address@hidden>

        * textmodes/ispell.el (ispell-maybe-find-aspell-dictionaries): New
        function, refactored from ispell-valid-dictionary-list.
        (ispell-valid-dictionary-list): Call it.
        (ispell-accept-buffer-local-defs): Call it.

*** orig/lisp/textmodes/ispell.el
--- mod/lisp/textmodes/ispell.el
***************
*** 880,885 ****
--- 880,895 ----
  (defvar ispell-have-aspell-dictionaries nil
    "Non-nil if we have queried Aspell for dictionaries at least once.")
  
+ (defun ispell-maybe-find-aspell-dictionaries ()
+   "Find Aspell's dictionaries, unless already done."
+   (when (and (not ispell-have-aspell-dictionaries)
+            (condition-case ()
+                (progn (ispell-check-version) t)
+              (error nil))
+            ispell-really-aspell
+            ispell-aspell-supports-utf8)
+     (ispell-find-aspell-dictionaries)))
+ 
  (defun ispell-find-aspell-dictionaries ()
    "Find Aspell's dictionaries, and record in `ispell-dictionary-alist'."
    (interactive)
***************
*** 976,988 ****
    "Returns a list of valid dictionaries.
  The variable `ispell-library-directory' defines the library location."
    ;; If Ispell is really Aspell, query it for the dictionary list.
!   (when (and (not ispell-have-aspell-dictionaries)
!            (condition-case ()
!                (progn (ispell-check-version) t)
!              (error nil))
!            ispell-really-aspell
!            ispell-aspell-supports-utf8)
!     (ispell-find-aspell-dictionaries))
    (let ((dicts (append ispell-local-dictionary-alist ispell-dictionary-alist))
        (dict-list (cons "default" nil))
        name load-dict)
--- 986,992 ----
    "Returns a list of valid dictionaries.
  The variable `ispell-library-directory' defines the library location."
    ;; If Ispell is really Aspell, query it for the dictionary list.
!   (ispell-maybe-find-aspell-dictionaries)
    (let ((dicts (append ispell-local-dictionary-alist ispell-dictionary-alist))
        (dict-list (cons "default" nil))
        name load-dict)
***************
*** 3573,3578 ****
--- 3577,3583 ----
  
  (defun ispell-accept-buffer-local-defs ()
    "Load all buffer-local information, restarting Ispell when necessary."
+   (ispell-maybe-find-aspell-dictionaries)
    (ispell-buffer-local-dict)          ; May kill ispell-process.
    (ispell-buffer-local-words)         ; Will initialize ispell-process.
    (ispell-buffer-local-parsing))
Magnus

reply via email to

[Prev in Thread] Current Thread [Next in Thread]