GNU bug report logs - #20581
24.5; aspell dictionary de-alt not found

Previous Next

Package: emacs;

Reported by: "Felix E. Klee" <felix.klee <at> inka.de>

Date: Thu, 14 May 2015 22:17:02 UTC

Severity: normal

Found in version 24.5

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 20581 in the body.
You can then email your comments to 20581 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#20581; Package emacs. (Thu, 14 May 2015 22:17:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to "Felix E. Klee" <felix.klee <at> inka.de>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 14 May 2015 22:17:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: "Felix E. Klee" <felix.klee <at> inka.de>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.5; aspell dictionary de-alt not found
Date: Thu, 14 May 2015 23:15:29 +0100
Installed the Aspell dictionary `de-alt':

<ftp://ftp.gnu.org/gnu/aspell/dict/de-alt/aspell6-de-alt-2.1-1.tar.bz2>

Started EMACS, then opened a text file written in German:

  Dies ist ein kurzes Dokument, das nicht sehr lang ist, so dass ich es
  schnell schreiben konnte.

  Local IspellDict: de-alt

Interactively ran `ispell-buffer'. This resulted in an error message:

  ispell-init-process: Error: The encoding "nil" is not known. This
  could also mean that the file "/usr/lib/aspell-0.60/nil.cset" could
  not be opened for reading or does not exist.

The reason is that Emacs didn’t parse `de-alt' into
`ispell-dictionary-alist'.

A workaround is to specify in `~/.emacs':

  (require 'ispell)
  (add-to-list 'ispell-dictionary-base-alist
               '("de-alt" "[[:alpha:]]" "[^[:alpha:]]" "" t
                 ("-d" "de-alt")
                 nil utf-8))

In GNU Emacs 24.5.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.16.2)
 of 2015-04-20 on bitzer.hoetzel.info
Windowing system distributor `The X.Org Foundation', version 11.0.11701000
System Description: Arch Linux

Configured using:
 `configure --prefix=/usr --sysconfdir=/etc --libexecdir=/usr/lib
 --localstatedir=/var --with-x-toolkit=gtk3 --with-xft
 'CFLAGS=-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong
 --param=ssp-buffer-size=4' CPPFLAGS=-D_FORTIFY_SOURCE=2
 LDFLAGS=-Wl,-O1,--sort-common,--as-needed,-z,relro'

Important settings:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Emacs-Lisp

Minor modes in effect:
  TeX-PDF-mode: t
  shell-dirtrack-mode: t
  show-paren-mode: t
  cua-mode: t
  whitespace-mode: t
  tooltip-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent messages:
Applying style hooks... done
Mark set
Sorting environment...
Removing duplicates... done
Quit [2 times]
Mark set
Quit
Making completion list... [2 times]
Quit
No server editing buffers exist

Load-path shadows:
None found.

Features:
(shadow sort gnus-util mail-extr emacsbug message idna rfc822 mml
mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev
gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util
mail-prsvr mail-utils texmathp flyspell preview prv-emacs tex-bar
tex-buf toolbar-x noutline outline font-latex byte-opt bytecomp
byte-compile cl-extra cconv latex tex-style tex dbus xml crm tex-mode
shell pcomplete quack thingatpt compile cmuscheme comint ansi-color ring
scheme paren delsel cua-base cus-start cus-load ispell browse-kill-ring
preview-latex tex-site auto-loads saveplace redo+ edmacro kmacro ls-lisp
help-mode easy-mmode advice help-fns dired+ image-dired cl-loaddefs
cl-lib format-spec image-file dired-x easymenu dired-aux dired tempbuf
whitespace session package epg-config windmove server time-date tooltip
electric uniquify ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd
tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment
lisp-mode prog-mode register page menu-bar rfn-eshadow timer select
scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cham
georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
korean japanese hebrew greek romanian slovak czech european ethiopic
indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple
abbrev minibuffer nadvice loaddefs button faces cus-face macroexp files
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget hashtable-print-readable backquote make-network-process
dbusbind gfilenotify dynamic-setting system-font-setting
font-render-setting move-toolbar gtk x-toolkit x multi-tty emacs)

Memory information:
((conses 16 238168 11475)
 (symbols 48 31664 0)
 (miscs 40 100 339)
 (strings 32 54892 7604)
 (string-bytes 1 1540668)
 (vectors 16 22543)
 (vector-slots 8 530525 12944)
 (floats 8 141 185)
 (intervals 56 769 0)
 (buffers 960 15)
 (heap 1024 52649 1672))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#20581; Package emacs. (Fri, 15 May 2015 09:19:02 GMT) Full text and rfc822 format available.

Message #8 received at 20581 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: "Felix E. Klee" <felix.klee <at> inka.de>
Cc: 20581 <at> debbugs.gnu.org
Subject: Re: bug#20581: 24.5; aspell dictionary de-alt not found
Date: Fri, 15 May 2015 12:18:00 +0300
> From: "Felix E. Klee" <felix.klee <at> inka.de>
> Date: Thu, 14 May 2015 23:15:29 +0100
> 
> Installed the Aspell dictionary `de-alt':
> 
> <ftp://ftp.gnu.org/gnu/aspell/dict/de-alt/aspell6-de-alt-2.1-1.tar.bz2>
> 
> Started EMACS, then opened a text file written in German:
> 
>   Dies ist ein kurzes Dokument, das nicht sehr lang ist, so dass ich es
>   schnell schreiben konnte.
> 
>   Local IspellDict: de-alt
> 
> Interactively ran `ispell-buffer'. This resulted in an error message:
> 
>   ispell-init-process: Error: The encoding "nil" is not known. This
>   could also mean that the file "/usr/lib/aspell-0.60/nil.cset" could
>   not be opened for reading or does not exist.
> 
> The reason is that Emacs didn’t parse `de-alt' into
> `ispell-dictionary-alist'.

That's right, but why did you expect it to?  "Local IspellDict"
assumes that the named dictionary is in ispell-dictionary-alist
already, it doesn't replace the machinery that is supposed to put
de-alt there.

So please describe your other setup that was supposed to cause de-alt
to appear in ispell-dictionary-alist or ispell-local-dictionary-alist,
as ispell.el expects.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#20581; Package emacs. (Fri, 15 May 2015 09:43:02 GMT) Full text and rfc822 format available.

Message #11 received at 20581 <at> debbugs.gnu.org (full text, mbox):

From: "Felix E. Klee" <felix.klee <at> inka.de>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 20581 <at> debbugs.gnu.org
Subject: Re: bug#20581: 24.5; aspell dictionary de-alt not found
Date: Fri, 15 May 2015 10:42:12 +0100
On Fri, May 15, 2015 at 10:18 AM, Eli Zaretskii <eliz <at> gnu.org> wrote:
> "Local IspellDict" assumes that the named dictionary is in
> ispell-dictionary-alist already

That’s correct. My point is that `de-alt` is *not* in
`ispell-dictionary-alist`.

I had a brief look at `ispell.el` yesterday. On a system with `aspell`,
the variable `ispell-dictionary-alist` gets built based on the output of
`aspell dicts`. On my system this list includes `de-alt`:

    $ aspell dicts | grep de
    de-alt
    de_AT
    de_AT
    de_CH
    de_CH
    de_DE
    de_DE




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#20581; Package emacs. (Fri, 15 May 2015 10:02:01 GMT) Full text and rfc822 format available.

Message #14 received at 20581 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: "Felix E. Klee" <felix.klee <at> inka.de>
Cc: 20581 <at> debbugs.gnu.org
Subject: Re: bug#20581: 24.5; aspell dictionary de-alt not found
Date: Fri, 15 May 2015 13:01:17 +0300
> From: "Felix E. Klee" <felix.klee <at> inka.de>
> Date: Fri, 15 May 2015 10:42:12 +0100
> Cc: 20581 <at> debbugs.gnu.org
> 
> I had a brief look at `ispell.el` yesterday. On a system with `aspell`,
> the variable `ispell-dictionary-alist` gets built based on the output of
> `aspell dicts`. On my system this list includes `de-alt`:
> 
>     $ aspell dicts | grep de
>     de-alt
>     de_AT
>     de_AT
>     de_CH
>     de_CH
>     de_DE
>     de_DE

So could you please step in Edebug through the code in ispell.el that
does the above, and see why the code doesn't DTRT?  (I don't have
Aspell installed to try that myself.)

Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#20581; Package emacs. (Fri, 15 May 2015 10:52:02 GMT) Full text and rfc822 format available.

Message #17 received at 20581 <at> debbugs.gnu.org (full text, mbox):

From: "Felix E. Klee" <felix.klee <at> inka.de>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 20581 <20581 <at> debbugs.gnu.org>
Subject: Re: bug#20581: 24.5; aspell dictionary de-alt not found
Date: Fri, 15 May 2015 11:50:55 +0100
On Fri, May 15, 2015 at 11:01 AM, Eli Zaretskii <eliz <at> gnu.org> wrote:
> So could you please step in Edebug through the code in ispell.el […]

As said before, `ispell-dictionary-alist` is assembled from the output
of `aspell dicts`. For each line in the output,
`ispell-aspell-find-dictionary` is called. Example:

    ELISP> (ispell-aspell-find-dictionary "de_DE")
    ("de_DE" "[[:alpha:]]" "[^[:alpha:]]" "" t
     ("-d" "de_DE")
     nil utf-8)

It doesn’t work with `de-alt`:

    ELISP> (ispell-aspell-find-dictionary "de-alt")
    nil

I used `edebug` on `ispell-aspell-find-dictionary` and found that there
is pattern matching happening that strips the variant `alt` from
`de-alt`. Then a path is assembled, `fullpath`, which evaluates to:
"/usr/lib/aspell-0.60/de.dat"

That `.dat` file doesn’t exist. For `de-alt` it is a mistake to strip
the variant. The correct path is: "/usr/lib/aspell-0.60/de-alt.dat"




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#20581; Package emacs. (Fri, 15 May 2015 13:30:09 GMT) Full text and rfc822 format available.

Message #20 received at 20581 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: "Felix E. Klee" <felix.klee <at> inka.de>
Cc: 20581 <at> debbugs.gnu.org
Subject: Re: bug#20581: 24.5; aspell dictionary de-alt not found
Date: Fri, 15 May 2015 16:29:34 +0300
> From: "Felix E. Klee" <felix.klee <at> inka.de>
> Date: Fri, 15 May 2015 11:50:55 +0100
> Cc: 20581 <20581 <at> debbugs.gnu.org>
> 
>     ELISP> (ispell-aspell-find-dictionary "de-alt")
>     nil
> 
> I used `edebug` on `ispell-aspell-find-dictionary` and found that there
> is pattern matching happening that strips the variant `alt` from
> `de-alt`. Then a path is assembled, `fullpath`, which evaluates to:
> "/usr/lib/aspell-0.60/de.dat"
> 
> That `.dat` file doesn’t exist. For `de-alt` it is a mistake to strip
> the variant. The correct path is: "/usr/lib/aspell-0.60/de-alt.dat"

Thanks.  Does the patch below give good results?

diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index 43003af..8107f79 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -1077,7 +1077,8 @@ (defun ispell-aspell-find-dictionary (dict-name)
 	     ;; Try xx.dat first, strip out variant, country code, etc,
 	     ;; then try xx_YY.dat (without stripping country code).
 	     (dolist (tmp-regexp (list "^[[:alpha:]]+"
-				       "^[[:alpha:]_]+"))
+				       "^[[:alpha:]_]+"
+                                       "^[[:alpha:]]+-\\(alt\\|old\\)"))
 	       (let ((fullpath
 		      (concat tmp-path "/"
 			      (and (string-match tmp-regexp dict-name)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#20581; Package emacs. (Fri, 15 May 2015 14:22:02 GMT) Full text and rfc822 format available.

Message #23 received at 20581 <at> debbugs.gnu.org (full text, mbox):

From: "Felix E. Klee" <felix.klee <at> inka.de>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 20581 <20581 <at> debbugs.gnu.org>
Subject: Re: bug#20581: 24.5; aspell dictionary de-alt not found
Date: Fri, 15 May 2015 15:21:00 +0100
On Fri, May 15, 2015 at 2:29 PM, Eli Zaretskii <eliz <at> gnu.org> wrote:
> Does the patch below give good results?

That does the trick - thanks!

FYI, the list of `.dat` files currently on my test system:

    $ ls -1 *.dat
    de-alt_affix.dat
    de-alt.dat
    de-alt_phonet.dat
    de_AT_affix.dat
    de_AT.dat
    de_CH_affix.dat
    de_CH.dat
    de_DE_affix.dat
    de_DE.dat
    en_affix.dat
    en.dat
    en_phonet.dat
    fr.dat
    fr_phonet.dat

Installed are Aspell dictionaries `en`, `fr`, `de`, and `de-alt`. On the
official page with [available Aspell dictionaries][1], the only
dictionary that ends in `-alt` is `de-alt`.

[1]: ftp://ftp.gnu.org/gnu/aspell/dict/0index.html




Reply sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Fri, 15 May 2015 14:27:01 GMT) Full text and rfc822 format available.

Notification sent to "Felix E. Klee" <felix.klee <at> inka.de>:
bug acknowledged by developer. (Fri, 15 May 2015 14:27:02 GMT) Full text and rfc822 format available.

Message #28 received at 20581-done <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: "Felix E. Klee" <felix.klee <at> inka.de>
Cc: 20581-done <at> debbugs.gnu.org
Subject: Re: bug#20581: 24.5; aspell dictionary de-alt not found
Date: Fri, 15 May 2015 17:26:06 +0300
> From: "Felix E. Klee" <felix.klee <at> inka.de>
> Date: Fri, 15 May 2015 15:21:00 +0100
> Cc: 20581 <20581 <at> debbugs.gnu.org>
> 
> On Fri, May 15, 2015 at 2:29 PM, Eli Zaretskii <eliz <at> gnu.org> wrote:
> > Does the patch below give good results?
> 
> That does the trick - thanks!

Thanks, pushed.

> Installed are Aspell dictionaries `en`, `fr`, `de`, and `de-alt`. On the
> official page with [available Aspell dictionaries][1], the only
> dictionary that ends in `-alt` is `de-alt`.

Yes, but I saw that its alias is "german-old", so I thought someone
might rename the files or something.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 13 Jun 2015 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 10 years and 88 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.