From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Tor Kringeland Newsgroups: gmane.emacs.bugs Subject: bug#51843: Ispell personal dictionary breaks other dictionaries Date: Sun, 14 Nov 2021 17:47:42 +0100 Message-ID: References: <834k8evmfh.fsf@gnu.org> <83y25qu39t.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="5062"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 51843@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Nov 14 17:48:11 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mmIfr-00016C-6w for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 14 Nov 2021 17:48:11 +0100 Original-Received: from localhost ([::1]:53692 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mmIfp-0000nj-QL for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 14 Nov 2021 11:48:09 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:39748) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mmIfi-0000na-84 for bug-gnu-emacs@gnu.org; Sun, 14 Nov 2021 11:48:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:39909) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mmIfh-0004Ct-WB for bug-gnu-emacs@gnu.org; Sun, 14 Nov 2021 11:48:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mmIfh-00059r-V5 for bug-gnu-emacs@gnu.org; Sun, 14 Nov 2021 11:48:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Tor Kringeland Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 14 Nov 2021 16:48:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 51843 X-GNU-PR-Package: emacs Original-Received: via spool by 51843-submit@debbugs.gnu.org id=B51843.163690846919809 (code B ref 51843); Sun, 14 Nov 2021 16:48:01 +0000 Original-Received: (at 51843) by debbugs.gnu.org; 14 Nov 2021 16:47:49 +0000 Original-Received: from localhost ([127.0.0.1]:51455 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mmIfV-00059R-C9 for submit@debbugs.gnu.org; Sun, 14 Nov 2021 11:47:49 -0500 Original-Received: from mailgw101.it.ntnu.no ([129.241.56.177]:50188) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mmIfS-00059G-Qm for 51843@debbugs.gnu.org; Sun, 14 Nov 2021 11:47:48 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ntnu.no; i=@ntnu.no; q=dns/txt; s=s1-1909-ntnu; t=1636908464; h=from : to : cc : subject : in-reply-to : references : date : message-id : mime-version : content-type : from; bh=yA2xvJ3yIkFa9AlkkUjZNpAloIQpoG1VD2xm8jgsxT8=; b=lumY7fO3v+0HnyFEk42DwFb8gl3WwmdGD8GCjTA3c8ze4ZMH0LDoky13+Wr7A7RDzl06V zJ3Bv+XLy4g3zNZuynxUkRbaH9duqX2BYAuJmLyLDFgG4eiy9DdbIbD9FZ6ybz1qrNDM5Sq NORcdiZvB6el3D0QdQ/O8WwhSHBagxCQiKDql86rIGFmw7P6aEFAtJc8P9eHE/PgMwPxAlZ 4amnGEBVnmNVmckuF0iT0H0XjajdjEZTTBQl8W/qbRIzjF/wd3eXNhp1Lec0EsT7DqfSqcd zS7pndkm4F7IV4d4kFacSPBTdh2G+8wxUkxMS7GdtSV4NzofXnsd4GqyAudQ== Original-Received: from localhost (localhost [127.0.0.1]) by mailgw101.it.ntnu.no (Postfix) with ESMTP id D3CD81DE27D0; Sun, 14 Nov 2021 17:47:44 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mailgw101.it.ntnu.no Original-Received: from mailgw101.it.ntnu.no ([127.0.0.1]) by localhost (mailgw101.it.ntnu.no [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 5z7h5I1vThwO; Sun, 14 Nov 2021 17:47:44 +0100 (CET) Original-Received: from localhost (unknown [37.120.203.82]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: takringe@ntnu.no) by mailgw101.it.ntnu.no (Postfix) with ESMTPSA id 2CB241DE279D; Sun, 14 Nov 2021 17:47:44 +0100 (CET) In-Reply-To: <83y25qu39t.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:219969 Archived-At: Eli Zaretskii writes: > [Please use Reply All to reply, so that the bug tracker gets a copy.] > >> From: Tor Kringeland >> Date: Sun, 14 Nov 2021 16:28:04 +0100 >> >> Eli Zaretskii writes: >> >> > Isn't this the same problem with the LANG setting in the environment? >> >> I don't think so. The issues seems to be a disparity between the >> language codes for the personal dictionary (you can only have a personal >> dictionary for one language) and the main dictionary. The header of >> `/tmp/words.txt' is >> >> personal_ws-1.1 en 1 >> >> where the `en' refers to the language/dictionary and `1' refers to the >> number of words in your personal dictionary. If I initiate a personal >> dictionary with, say, Norwegian, the header looks like >> >> personal_ws-1.1 nn 1 >> >> and I get the opposite problem (that it works for Norwegian but not >> English). > > How do you initiate the personal dictionary? By setting `ispell-personal-dictionary' to point at a non-existent file. It then creates the file with the language code for the current dictionary. >> I suspect the error comes from `ispell' feeding these two disparate >> language codes to `aspell': it tries to combine two dictionaries for two >> different languages and `aspell' complains. But I'm not certain this is >> the case, as I don't understand well the code in `ispell.el'. > > Does the same problem happen if you invoke Aspell from the shell, > passing it the Norwegian language and the personal dictionary for > English? Yes. If `/tmp/words.txt' is personal_ws-1.1 en 1 mysterious running echo -n mystiks | aspell -a --lang=nn_NO -p /tmp/words.txt outputs `Error: Expected language "nn" but got "en".' similar to the error using `ispell' in Emacs. Running the following similar command with `hunspell' echo -n mystiks | hunspell -a -d nn_NO -p /tmp/words.txt gives no complaints and suggests the word is a typo for `mystisk'. One could argue that the behavior of `hunspell' is not the correct one here, since we're using dictionaries of two different languages and it could have yielded a warning at least. But this has nothing to do with Emacs. But given that this is "undefined behavior" for spell checkers one can use with `ispell', it would be good if Emacs could sanity check the language code of the personal dictionary with that of the main one and not include the former if there is a disparity --- or optionally being able to set personal dictionaries for multiple language codes.