From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jorge P. de Morais Neto Newsgroups: gmane.emacs.bugs Subject: bug#42248: 27.0.91; With enchant-2.2.8 from Guix, Flyspell errors out or gives lots of false positives Date: Sun, 30 Aug 2020 15:51:42 -0300 Message-ID: <875z90ezlt.fsf@disroot.org> References: <878sfvwbr0.fsf@disroot.org> <87mu2qyu94.fsf@disroot.org> <83k0xtcv7a.fsf@gnu.org> <87eeo1z5we.fsf@disroot.org> <83a6ypcnl4.fsf@gnu.org> <87sgchfbsi.fsf@disroot.org> <837dttcgxl.fsf@gnu.org> <871rjwi0at.fsf@disroot.org> <83y2m45clu.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="18011"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 42248@debbugs.gnu.org, stefan@marxist.se To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Aug 30 20:53:11 2020 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 1kCSRy-0004YI-Ka for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 30 Aug 2020 20:53:11 +0200 Original-Received: from localhost ([::1]:60638 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kCSRx-0007gq-66 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 30 Aug 2020 14:53:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58978) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kCSRq-0007gW-UA for bug-gnu-emacs@gnu.org; Sun, 30 Aug 2020 14:53:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:39195) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kCSRq-0001CK-L0 for bug-gnu-emacs@gnu.org; Sun, 30 Aug 2020 14:53:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kCSRq-00027B-I3 for bug-gnu-emacs@gnu.org; Sun, 30 Aug 2020 14:53:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Jorge P. de Morais Neto Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 30 Aug 2020 18:53:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 42248 X-GNU-PR-Package: emacs Original-Received: via spool by 42248-submit@debbugs.gnu.org id=B42248.15988135248064 (code B ref 42248); Sun, 30 Aug 2020 18:53:02 +0000 Original-Received: (at 42248) by debbugs.gnu.org; 30 Aug 2020 18:52:04 +0000 Original-Received: from localhost ([127.0.0.1]:50741 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kCSQu-00025z-55 for submit@debbugs.gnu.org; Sun, 30 Aug 2020 14:52:04 -0400 Original-Received: from knopi.disroot.org ([178.21.23.139]:34734) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kCSQr-00025Z-8s for 42248@debbugs.gnu.org; Sun, 30 Aug 2020 14:52:02 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id BE70151BBF; Sun, 30 Aug 2020 20:51:59 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at disroot.org Original-Received: from knopi.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id mXYsaJeqb5tN; Sun, 30 Aug 2020 20:51:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1598813516; bh=Cm76qutuEzrBjU5ldDP4pCMKMu7HrJZ3wBrGQPJWxHU=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=Mhkm2STR2C6F3h2a0qsh9bZzwVy96tE/aYybz/zHeba+UAEf6Qn28D/NdittEaPcN ma5Se6+jhDmWak8yMKM9cRciJfGXQdhlJ09Kxp+Tgz7FLPw1bYysh03gcs1Hd7J4aj sOFooZccKoqBGUReXjjncTInzmBM5wvuj0LDMX4OYoteLQcGJZ0W+51CAhpO6Cpb57 /tYzpS8xMj4dTQUA6nIQBCXEfQ6i/jMOot88TzTN0L7Ch7CE38lhLmyDL4nkby0BKA 8+YeM2T23opHJrbtNu2cDH4SYa2aTEVh8AVsVdd/IkyH1wCLqm/hADwg7jmqgHsUB3 NESVSNmJO3+3g== In-Reply-To: <83y2m45clu.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:186719 Archived-At: Em [2020-08-24 seg 17:42:53+0300], Eli Zaretskii escreveu: > Maybe the dictionary you are using doesn't support the apostrophe? Yes, with your help, I found out that Debian's hunspell-en-us package is missing the apostrophe in WORDCHARS value in `/usr/share/hunspell/en_US.aff'. I have worked around the problem by: 1. Create `~/.config/enchant/hunspell' directory and `cd' to it 2. Symlink `/usr/share/hunspell/en_US.dic' to `./en_US.dic' 3. Copy `/usr/share/hunspell/en_US.aff' to `./en_US.aff' 4. Edit `./en_US.aff' and fix WORDCHARS. This solves the Emacs contraction problem and doesn't seem to harm other enchant consumers like LibreOffice and Gedit. I think I should report this to the dictionary developers. And where did you get your en_US dictionary from? The en_US hunspell dictionary is wrong both in Debian buster and Guix. And what should we do about ispell-dictionary-alist still including "-B" among ISPELL-ARGS for many of its entries? This causes an error if the user chooses one of those dictionaries, such as "american". > I don't think I understand the proposed changes -- can you tell in > more detail why they are needed? The revised patch: --8<---------------cut here---------------start------------->8--- --- 27.1/ispell.el 2020-08-30 12:45:49.113459675 -0300 +++ lisp/ispell.el 2020-08-30 08:58:57.182813606 -0300 @@ -1237,11 +1237,12 @@ "Find Enchant's dictionaries, and record in `ispell-enchant-dictionary-alist'." (let* ((dictionaries (split-string - (ispell--call-enchant-lsmod "-list-dicts" (buffer-string)) " ([^)]+)\n")) + (ispell--call-enchant-lsmod "-list-dicts") + " ([^)]+)\n" t)) (found (mapcar #'(lambda (lang) `(,lang "[[:alpha:]]" "[^[:alpha:]]" - ,(ispell--get-extra-word-characters) t nil nil utf-8)) + ,(ispell--get-extra-word-characters lang) t nil nil utf-8)) dictionaries))) ;; Merge into FOUND any elements from the standard ispell-dictionary-base-alist ;; which have no element in FOUND at all. --8<---------------cut here---------------end--------------->8--- The patch removes the extraneous `(buffer-string)' argument to `ispell--call-enchant-lsmod'. That argument was passed as the final argument to `enchant-lsmod-2', which is wrong. The command we want to invoke is only `enchant-lsmod-2 -list-dicts'---that is the command to list Enchant dictionaries according to the enchant-lsmod-2 manpage. And it actually works in practice, unlike the former invocation which causes an error. The patch also passes t as the OMIT-NULLS argument of `split-string'. This correctly avoids a final "" string in the return value of `split-string', because the output of `enchant-lsmod-2 -list-dicts' ends in a separator. Finally, the patch passes `lang' to `ispell--get-extra-word-characters', because the whole point of the invocation is to get the extra word characters for the language under examination; the former code always returned the extra word characters for the default language. The current source code is visibly broken. And in fact, without my patch, when you invoke `emacs -q', evaluate (setq ispell-program-name "enchant-2"), open the original ispell.el.gz, invoke M-x eval-buffer and then M-x ispell-change-dictionary, you can see the error in the list of languages. On the other hand, when you invoke `emacs -q', evaluate (setq ispell-program-name "enchant-2") and then M-x ispell-change-dictionary, there is no error! This makes me suspect that, somehow, `ispell.elc' does not correspond to `ispell.el.gz'. That is a weird idea, but is the only explanation I can think of. This occurs on the emacs-27 branch, commit 29708cbde7. Best regards -- - - I am Brazilian. I hope my English is correct and I welcome feedback. - Free Software Supporter: - If an email of mine arrives at your spam box, please notify me.