From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#24050: 24.5; ispell-change-dictionary suggests non-existent dicts (aspell) Date: Sun, 28 Jul 2019 12:25:16 +0200 Message-ID: <87k1c2cv77.fsf@mouse.gnus.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="47015"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: 24050@debbugs.gnu.org To: Ole =?UTF-8?Q?J=C3=B8rgen_?= =?UTF-8?Q?Br=C3=B8nner?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Jul 28 12:26:12 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hrgNY-000C6k-7R for geb-bug-gnu-emacs@m.gmane.org; Sun, 28 Jul 2019 12:26:12 +0200 Original-Received: from localhost ([::1]:44418 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hrgNX-0007Zy-3p for geb-bug-gnu-emacs@m.gmane.org; Sun, 28 Jul 2019 06:26:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53838) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hrgNS-0007Xy-Kp for bug-gnu-emacs@gnu.org; Sun, 28 Jul 2019 06:26:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hrgNO-0003HH-St for bug-gnu-emacs@gnu.org; Sun, 28 Jul 2019 06:26:06 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:36975) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hrgNO-0003Fw-MV for bug-gnu-emacs@gnu.org; Sun, 28 Jul 2019 06:26:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hrgNO-0005v2-Gs for bug-gnu-emacs@gnu.org; Sun, 28 Jul 2019 06:26:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 28 Jul 2019 10:26:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24050 X-GNU-PR-Package: emacs Original-Received: via spool by 24050-submit@debbugs.gnu.org id=B24050.156430952422688 (code B ref 24050); Sun, 28 Jul 2019 10:26:02 +0000 Original-Received: (at 24050) by debbugs.gnu.org; 28 Jul 2019 10:25:24 +0000 Original-Received: from localhost ([127.0.0.1]:45793 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hrgMm-0005ts-4s for submit@debbugs.gnu.org; Sun, 28 Jul 2019 06:25:24 -0400 Original-Received: from quimby.gnus.org ([80.91.231.51]:53472) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hrgMj-0005ti-Ej for 24050@debbugs.gnu.org; Sun, 28 Jul 2019 06:25:21 -0400 Original-Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=marnie) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hrgMe-00031M-ES; Sun, 28 Jul 2019 12:25:18 +0200 In-Reply-To: ("Ole \=\?utf-8\?Q\?J\=C3\=B8rgen_Br\=C3\=B8nner\=22's\?\= message of "Thu, 21 Jul 2016 21:49:06 +0200") 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: 209.51.188.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:163940 Archived-At: Ole J=C3=B8rgen Br=C3=B8nner writes: > 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 tha= t, but > to me is seems like `ispell-dictionary-base-alist` mostly exist due to la= ck 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-dictionar= ies` > 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'm going through old Emacs bug reports that haven't received any response.) Thanks for the analysis; altering the code along these lines does fix the problem, and `M-x ispell-change-dictionary' now seems a lot more useful now that it just lists the dictionaries I actually have installed. > I would suggest simply removing [1] and not add the *base-alist above whe= n using > aspell/hunspell, but the following comment makes it seem like the "invali= d" > 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. It may be intentional, but the other comments seem to indicate that it's not... and I don't see the utility of listing dictionaries we don't have, so I think it's a good change anyway. So I've made it on the Emacs trunk now. --=20 (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no