all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#20581: 24.5; aspell dictionary de-alt not found
@ 2015-05-14 22:15 Felix E. Klee
  2015-05-15  9:18 ` Eli Zaretskii
  0 siblings, 1 reply; 8+ messages in thread
From: Felix E. Klee @ 2015-05-14 22:15 UTC (permalink / raw)
  To: 20581

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))





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#20581: 24.5; aspell dictionary de-alt not found
  2015-05-14 22:15 bug#20581: 24.5; aspell dictionary de-alt not found Felix E. Klee
@ 2015-05-15  9:18 ` Eli Zaretskii
  2015-05-15  9:42   ` Felix E. Klee
  0 siblings, 1 reply; 8+ messages in thread
From: Eli Zaretskii @ 2015-05-15  9:18 UTC (permalink / raw)
  To: Felix E. Klee; +Cc: 20581

> From: "Felix E. Klee" <felix.klee@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.





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#20581: 24.5; aspell dictionary de-alt not found
  2015-05-15  9:18 ` Eli Zaretskii
@ 2015-05-15  9:42   ` Felix E. Klee
  2015-05-15 10:01     ` Eli Zaretskii
  0 siblings, 1 reply; 8+ messages in thread
From: Felix E. Klee @ 2015-05-15  9:42 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 20581

On Fri, May 15, 2015 at 10:18 AM, Eli Zaretskii <eliz@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





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#20581: 24.5; aspell dictionary de-alt not found
  2015-05-15  9:42   ` Felix E. Klee
@ 2015-05-15 10:01     ` Eli Zaretskii
  2015-05-15 10:50       ` Felix E. Klee
  0 siblings, 1 reply; 8+ messages in thread
From: Eli Zaretskii @ 2015-05-15 10:01 UTC (permalink / raw)
  To: Felix E. Klee; +Cc: 20581

> From: "Felix E. Klee" <felix.klee@inka.de>
> Date: Fri, 15 May 2015 10:42:12 +0100
> Cc: 20581@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.





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#20581: 24.5; aspell dictionary de-alt not found
  2015-05-15 10:01     ` Eli Zaretskii
@ 2015-05-15 10:50       ` Felix E. Klee
  2015-05-15 13:29         ` Eli Zaretskii
  0 siblings, 1 reply; 8+ messages in thread
From: Felix E. Klee @ 2015-05-15 10:50 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 20581

On Fri, May 15, 2015 at 11:01 AM, Eli Zaretskii <eliz@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"





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#20581: 24.5; aspell dictionary de-alt not found
  2015-05-15 10:50       ` Felix E. Klee
@ 2015-05-15 13:29         ` Eli Zaretskii
  2015-05-15 14:21           ` Felix E. Klee
  0 siblings, 1 reply; 8+ messages in thread
From: Eli Zaretskii @ 2015-05-15 13:29 UTC (permalink / raw)
  To: Felix E. Klee; +Cc: 20581

> From: "Felix E. Klee" <felix.klee@inka.de>
> Date: Fri, 15 May 2015 11:50:55 +0100
> Cc: 20581 <20581@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)





^ permalink raw reply related	[flat|nested] 8+ messages in thread

* bug#20581: 24.5; aspell dictionary de-alt not found
  2015-05-15 13:29         ` Eli Zaretskii
@ 2015-05-15 14:21           ` Felix E. Klee
  2015-05-15 14:26             ` Eli Zaretskii
  0 siblings, 1 reply; 8+ messages in thread
From: Felix E. Klee @ 2015-05-15 14:21 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 20581

On Fri, May 15, 2015 at 2:29 PM, Eli Zaretskii <eliz@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





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#20581: 24.5; aspell dictionary de-alt not found
  2015-05-15 14:21           ` Felix E. Klee
@ 2015-05-15 14:26             ` Eli Zaretskii
  0 siblings, 0 replies; 8+ messages in thread
From: Eli Zaretskii @ 2015-05-15 14:26 UTC (permalink / raw)
  To: Felix E. Klee; +Cc: 20581-done

> From: "Felix E. Klee" <felix.klee@inka.de>
> Date: Fri, 15 May 2015 15:21:00 +0100
> Cc: 20581 <20581@debbugs.gnu.org>
> 
> On Fri, May 15, 2015 at 2:29 PM, Eli Zaretskii <eliz@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.





^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2015-05-15 14:26 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-14 22:15 bug#20581: 24.5; aspell dictionary de-alt not found Felix E. Klee
2015-05-15  9:18 ` Eli Zaretskii
2015-05-15  9:42   ` Felix E. Klee
2015-05-15 10:01     ` Eli Zaretskii
2015-05-15 10:50       ` Felix E. Klee
2015-05-15 13:29         ` Eli Zaretskii
2015-05-15 14:21           ` Felix E. Klee
2015-05-15 14:26             ` Eli Zaretskii

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.