From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ole =?UTF-8?Q?J=C3=B8rgen_?= =?UTF-8?Q?Br=C3=B8nner?= Newsgroups: gmane.emacs.bugs Subject: bug#24050: 24.5; ispell-change-dictionary suggests non-existent dicts (aspell) Date: Thu, 21 Jul 2016 21:49:06 +0200 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1469138492 32057 80.91.229.3 (21 Jul 2016 22:01:32 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 21 Jul 2016 22:01:32 +0000 (UTC) To: 24050@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Jul 22 00:01:19 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1bQM1u-0004CU-Oq for geb-bug-gnu-emacs@m.gmane.org; Fri, 22 Jul 2016 00:01:19 +0200 Original-Received: from localhost ([::1]:43909 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQM1t-00086d-VP for geb-bug-gnu-emacs@m.gmane.org; Thu, 21 Jul 2016 18:01:17 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39228) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQM1h-00083N-C7 for bug-gnu-emacs@gnu.org; Thu, 21 Jul 2016 18:01:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bQM1e-0006p0-Vv for bug-gnu-emacs@gnu.org; Thu, 21 Jul 2016 18:01:04 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:48318) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQM1e-0006ou-SN for bug-gnu-emacs@gnu.org; Thu, 21 Jul 2016 18:01:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bQM1e-0002S6-Fo for bug-gnu-emacs@gnu.org; Thu, 21 Jul 2016 18:01:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Ole =?UTF-8?Q?J=C3=B8rgen_?= =?UTF-8?Q?Br=C3=B8nner?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 21 Jul 2016 22:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 24050 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.14691384439360 (code B ref -1); Thu, 21 Jul 2016 22:01:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 21 Jul 2016 22:00:43 +0000 Original-Received: from localhost ([127.0.0.1]:60655 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bQM1I-0002Qo-04 for submit@debbugs.gnu.org; Thu, 21 Jul 2016 18:00:43 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:46608) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bQJyB-0007mr-75 for submit@debbugs.gnu.org; Thu, 21 Jul 2016 15:49:19 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bQJy4-0003EB-QG for submit@debbugs.gnu.org; Thu, 21 Jul 2016 15:49:14 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:34354) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQJy4-0003E7-Mm for submit@debbugs.gnu.org; Thu, 21 Jul 2016 15:49:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37577) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQJy2-0001Zx-Q4 for bug-gnu-emacs@gnu.org; Thu, 21 Jul 2016 15:49:12 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bQJy0-0003CA-KQ for bug-gnu-emacs@gnu.org; Thu, 21 Jul 2016 15:49:09 -0400 Original-Received: from mail-qk0-x230.google.com ([2607:f8b0:400d:c09::230]:34887) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQJy0-0003C6-FE for bug-gnu-emacs@gnu.org; Thu, 21 Jul 2016 15:49:08 -0400 Original-Received: by mail-qk0-x230.google.com with SMTP id s63so83525540qkb.2 for ; Thu, 21 Jul 2016 12:49:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to; bh=2gKX2z9T6v7/V/yW7flSqSv4aBqnt7GOFQJZrbndV38=; b=fMLqTHlkvWVn7rJ0Lv3GujlPMn0bLNfYChzX6AHKKXVIVmJHBy20NUqjyyTlgIuSV6 Xjj0TVnWamtlNIpO/pobvpJ4rAwG1bnmDc2plR2EU1KExpwhICBxaXZpnTMTm1TXi6GK yqWXjr8Zsy1Bur1+jK6KCEx+xWRMBMNaRgBLqLHZD96HfdK2aGdCeJaqWjYqRCScrk9D EUphXqdSPMLom+Nlq5asIoj6gKbkQ67j1LZv+H0wgkCiPvHCBA39Jqq3kcHgzZoeUA8z lzu34Y2NChrV8Pe/CVzSIBgOq1kaQw7lpOtecg1eCdk5RcYQHAYq1fow8Kq/AkN1scqJ FkYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=2gKX2z9T6v7/V/yW7flSqSv4aBqnt7GOFQJZrbndV38=; b=AQWicsyl3zZmXtroSDDdLl4XSfxAn2MmP9R9a9KrHajbIGR2GGLLfs9+iYRhZEHLZn /mKaeD/i6M4AzAuTSJrl2Cauon6Uf2mehtCpLruolvizIkTQaGq7XU54sFrpNuIyEapY jYip6ryilKPreJXlp7yHl4XsFfYHSqQJ6FBB4qbnrpoED4g2K78szzHnwJZzurtiQSQz vFxk3Gi2j+zN7i7ogPjS35vaiAAPy93HrGumSChfZ6w/KTZoDOSONdCf4r5ps0Kc+IwA x635TgOUiEeSU57vzQcuZs7BZ/+RGTpjXP9yhMZsrmjE0x3LL+wS84pC+Le71lpic+Gl mX3w== X-Gm-Message-State: AEkoouukLAzbcZWUkKHIaheGO+75wgbfGkRSvdLccGk3KQy3Dw4L3P6dshn3lh4f8Dze46unSxiKiSruCiuEjA== X-Received: by 10.55.190.199 with SMTP id o190mr33174qkf.192.1469130547424; Thu, 21 Jul 2016 12:49:07 -0700 (PDT) Original-Received: by 10.237.53.137 with HTTP; Thu, 21 Jul 2016 12:49:06 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Mailman-Approved-At: Thu, 21 Jul 2016 18:00:39 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:121397 Archived-At: I'm using aspell as the "ispell provider". M-x ispell-change-dictionary helpfully gives a list of dictionaries to choose from. The list however contains dictionaries I don't have installed on my system. Only after spellchecking is attempted I get an error in *Messages*. Diving into the code I find quite an effort to build a list of dictionaries for the three different ispell providers. There's a dedicated function, `ispell-find-aspell-dictionaries`, to find valid aspell dictionaries. It sanely ask bin/aspell for the list and then does some post-processing to find the rest of the spec. But after the *correct* list has been found this code[1] is run: ;; Merge into FOUND any elements from the standard ispell-dictionary-base-alist ;; which have no element in FOUND at all. (dolist (dict ispell-dictionary-base-alist) (unless (assoc (car dict) found) (setq found (nconc found (list dict))))) Adding invalid entries to the list. There might be a rationale behind that, but to me is seems like `ispell-dictionary-base-alist` mostly exist due to lack of *ispell* (old aspell?) introspection? (When using *ispell* as the provider, invalid entries are filtered out in `ispell-valid-dictionary-list`) Removing that code isn't enough though: In `ispell-set-spellchecker-params` the invalid entries are added again: (where `found-dicts-alist` is the result of `ispell-find-aspell-dictionaries` in when aspell is used) (run-hooks 'ispell-initialize-spellchecker-hook) ;; Add dicts to ``ispell-dictionary-alist'' unless already present. (dolist (dict (append found-dicts-alist ispell-base-dicts-override-alist ispell-dictionary-base-alist)) (unless (assoc (car dict) all-dicts-alist) (add-to-list 'all-dicts-alist dict))) (setq ispell-dictionary-alist all-dicts-alist)) This code seems to have two purposes: - When *ispell* is the provider, `found-dicts-alist` is nil at this point, so the default entries must be added - Apply dictionary overrides (possibly set by the hook above) I would suggest simply removing [1] and not add the *base-alist above when using aspell/hunspell, but the following comment makes it seem like the "invalid" entries are added intentionally: ;; Substitute ispell-dictionary-alist with the list of ;; dictionaries corresponding to the given spellchecker. ;; If a recent aspell or hunspell, use the list of really ;; installed dictionaries and add to it elements of the original ;; list that are not present there*. Allow distro info. In GNU Emacs 24.5.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.20.6) of 2016-06-04 on juergen Windowing system distributor `The X.Org Foundation', version 11.0.11803000 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' CPPFLAGS=-D_FORTIFY_SOURCE=2 LDFLAGS=-Wl,-O1,--sort-common,--as-needed,-z,relro' Important settings: value of $LC_COLLATE: en_US.UTF-8 value of $LC_CTYPE: en_US.UTF-8 value of $LC_MESSAGES: en_US.UTF-8 value of $LC_MONETARY: en_US.UTF-8 value of $LC_NUMERIC: en_US.UTF-8 value of $LC_TIME: nb_NO.utf8 value of $LANG: en_US.utf8 locale-coding-system: utf-8-unix Major mode: Lisp Interaction Minor modes in effect: 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 blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Recent messages: Making completion list... [2 times] Local Ispell dictionary set to german Entering debugger... Back to top level. is undefined Making completion list... [2 times] Starting new Ispell process /usr/bin/aspell with german dictionary... ispell-init-process: Error: The file "/usr/lib/aspell-0.60/german" can not be opened for reading. ESC M-x is undefined [3 times] Making completion list... [2 times] Load-path shadows: None found. Features: (shadow sort gnus-util mail-extr emacsbug message format-spec rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util help-fns mail-prsvr mail-utils debug ispell help-mode easymenu 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 76572 7275) (symbols 48 18057 0) (miscs 40 46 163) (strings 32 10715 4971) (string-bytes 1 296127) (vectors 16 9261) (vector-slots 8 387535 14421) (floats 8 65 422) (intervals 56 220 26) (buffers 960 13) (heap 1024 26108 1053))