unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Felix Dietrich <felix.dietrich@sperrhaken.name>
To: help-gnu-emacs@gnu.org
Subject: Re: ispell select Emacs dictionary on Debian
Date: Tue, 27 Jul 2021 07:17:06 +0200	[thread overview]
Message-ID: <87r1fkgwtp.fsf@sperrhaken.name> (raw)
In-Reply-To: <87k0ldylab.fsf@zoho.eu> (Emanuel Berg via Users list for the's message of "Mon, 26 Jul 2021 02:24:28 +0200")

Emanuel Berg via Users list for the GNU Emacs text editor
<help-gnu-emacs@gnu.org> writes:

> As described in the previous post, Debian seems to react upon the
> installation of the iamerican-insane package as with the superuser
> script [select-default-ispell] to set the dictionary that alternative
> does show up.

The iamerican packages call in their postinst script [1]
“update-default-ispell” which will call the function
“build_emacsen_support”; this function creates the file
</var/cache/dictionaries-common/emacsen-ispell-dicts.el>
with entries for ‘ispell-dictionary-alist’ (indirectly,
see the function ‘debian-ispell-initialize-dicts-alist’
and the hook ‘ispell-initialize-spellchecker-hook’).

> However after that with `ispell-change-dictionary' the
> alternatives are still only
>
>   american
>   default
>   svenska

“emacsen-ispell-dicts.el” is only read at start-up [2].  If you install a
new dictionary, an already running Emacs will not know about it.  You may
try to reinitialise the dictionary with the following snippet:

    (progn
      (setq debian-ispell-only-dictionary-alist nil
    	debian-aspell-only-dictionary-alist nil
    	debian-hunspell-only-dictionary-alist nil
    	ispell-dictionary-alist nil)
      (load-file "/var/cache/dictionaries-common/emacsen-ispell-dicts.el")
      ;; There is a setter associated with ‘ispell-program-name’ which
      ;; calls ‘ispell-set-spellchecker-params’.  Calling this function
      ;; directly does not work; I donʼt understand why.
      (setq ispell-program-name "ispell"))

For testing purposes, start Emacs with the “-q” (“--no-init-file”)
switch.  Do the dictionaries show up then in the dialog of
‘ispell-change-dictionary’?  Do you use a custom built Emacs or the
Debian package?

> If I remove all iamerican-* packages the american alternative
> go away. I don't know if this is related to the iamerican
> package in particular but that seems reasonable.

It is connected to the action of removing the dictionary: ispell filters
the list of ‘ispell-dictionary-alist’ for the dialog: it will only
display those entries whose dictionary files exist.

> But then why aren't the iamerican-small, iamerican-large,
> iamerican-huge, and iamerican-insane there whenever _they_
> are installed?

To reiterate: their entries are added on installation of the respective
package to the file emacsen-ispell-dicts.el; this file is only loaded at
start-up.

> PS. The Swedish dictionary doesn't work either. It saysff
>     "ispell-init-process: Illegal format hash table
>     /usr/lib/ispell/svenska.hash - expected magic2 0x9602, got
>     0x414c"

Does not work for me either.  Seems like a bug.  Please report it.
Meanwhile, try recreating the .hash file manually (requires the wswedish
package):

    buildhash /usr/share/dict/svenska /usr/lib/ispell/svenska.aff \
        /usr/lib/ispell/svenska.hash


Footnotes:
[1]  If you have the package installed you may read their content here:
     </var/lib/dpkg/info/iamerican.postinst>.  Otherwise, download the
     package and open it: the file is in the subarchive
     “control.tar.xz".

[2]  </etc/emacs/site-start.d/50dictionaries-common.el>

-- 
Felix Dietrich



  reply	other threads:[~2021-07-27  5:17 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-22  6:22 Create a complete/huge dictionary for aspell Hongyi Zhao
2021-07-22  6:36 ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-07-22  7:48   ` Hongyi Zhao
2021-07-23  1:07     ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-07-23  1:29       ` Hongyi Zhao
2021-07-23  1:44         ` Hongyi Zhao
2021-07-23  7:29         ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-07-23 12:58     ` Felix Dietrich
2021-07-23 13:33       ` Hongyi Zhao
2021-07-24 13:34         ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-07-24 13:54           ` ispell select Emacs dictionary on Debian (was: Re: Create a complete/huge dictionary for aspell.) Emanuel Berg via Users list for the GNU Emacs text editor
2021-07-25 22:37             ` ispell select Emacs dictionary on Debian Felix Dietrich
2021-07-26  0:24               ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-07-27  5:17                 ` Felix Dietrich [this message]
2021-08-01  0:26                   ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-08-01  6:09                     ` Eli Zaretskii
2021-08-01 12:46                     ` Felix Dietrich
2021-08-01 21:11                       ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-07-24 15:30           ` Create a complete/huge dictionary for aspell Hongyi Zhao
2021-07-24 16:47             ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-07-25  2:57               ` Hongyi Zhao
2021-07-25 15:36                 ` Hongyi Zhao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87r1fkgwtp.fsf@sperrhaken.name \
    --to=felix.dietrich@sperrhaken.name \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).