From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Agustin Martin Newsgroups: gmane.emacs.bugs Subject: bug#15903: 24.3.50; Fix small issue with ispell-hunspell when dictionary is set to default (nil) Date: Mon, 18 Nov 2013 13:11:58 +0100 Message-ID: <20131118121157.GA8051@agmartin.aq.upm.es> References: <87wqk9k96w.fsf@smoon.org> <20131118063300.GB889@smoon> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1384776803 3808 80.91.229.3 (18 Nov 2013 12:13:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 18 Nov 2013 12:13:23 +0000 (UTC) To: Vladimir Lomov , 15903@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Nov 18 13:13:27 2013 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 1ViNhh-00069Y-1f for geb-bug-gnu-emacs@m.gmane.org; Mon, 18 Nov 2013 13:13:21 +0100 Original-Received: from localhost ([::1]:42607 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ViNhf-0007e9-Se for geb-bug-gnu-emacs@m.gmane.org; Mon, 18 Nov 2013 07:13:19 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48017) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ViNhW-0007bz-6X for bug-gnu-emacs@gnu.org; Mon, 18 Nov 2013 07:13:17 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ViNhO-0002SG-Sd for bug-gnu-emacs@gnu.org; Mon, 18 Nov 2013 07:13:10 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:45605) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ViNhO-0002S9-Or for bug-gnu-emacs@gnu.org; Mon, 18 Nov 2013 07:13:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1ViNhN-0005Kn-SN for bug-gnu-emacs@gnu.org; Mon, 18 Nov 2013 07:13:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Agustin Martin Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 18 Nov 2013 12:13:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 15903 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 15903-submit@debbugs.gnu.org id=B15903.138477673020439 (code B ref 15903); Mon, 18 Nov 2013 12:13:01 +0000 Original-Received: (at 15903) by debbugs.gnu.org; 18 Nov 2013 12:12:10 +0000 Original-Received: from localhost ([127.0.0.1]:59624 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ViNgW-0005Ja-RJ for submit@debbugs.gnu.org; Mon, 18 Nov 2013 07:12:09 -0500 Original-Received: from edison.ccupm.upm.es ([138.100.198.71]:58416) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ViNgT-0005Iv-9M for 15903@debbugs.gnu.org; Mon, 18 Nov 2013 07:12:06 -0500 Original-Received: from agmartin.aq.upm.es (Agmartin.aq.upm.es [138.100.41.131]) by smtp.upm.es (8.14.3/8.14.3/edison-001) with ESMTP id rAICBwpF027711; Mon, 18 Nov 2013 13:11:58 +0100 Original-Received: by agmartin.aq.upm.es (Postfix, from userid 1000) id 382124001B; Mon, 18 Nov 2013 13:11:58 +0100 (CET) Content-Disposition: inline In-Reply-To: <20131118063300.GB889@smoon> User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.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-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:80728 Archived-At: On Mon, Nov 18, 2013 at 03:33:00PM +0900, Vladimir Lomov wrote: > Hello, > ** Agustin Martin [2013-11-16 12:43:02 +0100]: > > > 2013/11/15 Vladimir Lomov > > >> Hello, > >> according to variable 'ispell-dictionary-base-alist' defined in > >> 'ispell.el' if 'ispell-dictionary' is nil then it is considered as > >> default value for dictionary. Unfortunately, when hunspell is used as > >> ispell program function 'ispell-parse-hunspell-affix-file' fails because > >> it doesn't expect nil as argument. > > >> I propose small and simple patch. I checked it starting emacs as: > >> emacs -Q > >> and evaluating in *scratch*: > >> (setq ispell-program-name "hunspell") > >> (setq ispell-really-hunspell t) > >> after that I run 'M-$' while point is on first 's' of > >> (message) > > >> In minibuffer I see > >> MESSAGE is correct > > >> Without this patch the same steps lead to message > >> ispell-phaf: No matching entry for nil. > > > Hi, > > > Cannot reproduce it here. By the way, once initialized for hunspell > > ispell.el provides a match for default (nil) value, here > > > (nil [[:alpha:]] [^[:alpha:]] ['] nil (-B) nil utf-8) > > Wouldn't you mind to share how you get this? Using 20131101 emacs-snapshot, $ LC_ALL=C emacs-snapshot -Q & In scratch buffer, type (setq ispell-program-name "hunspell") (setq ispell-dictionary nil) and `eval-region' that region. Then run 'M-$' on a couple of words (file and dictionary). This will make ispell.el be loaded and ispell process started, messages buffer shows Starting new Ispell process [hunspell::default] ... Checking spelling of FILE... FILE is correct Checking spelling of DICTIONARY... DICTIONARY is correct Evaluating in the scratch buffer (message "%s" (assoc nil ispell-hunspell-dictionary-alist)) I get (now default here is en_US) (nil [[:alpha:]] [^[:alpha:]] ['0-9] t (-d en_US) nil utf-8) Note that `ispell-hunspell-dictionary-alist' is not bound until ispell.el is loaded, and that will not happen until you spellcheck for the first time (or call a command that forces ispell.el load), so the first part of your check should do nothing until then. If you get some result there please doublecheck that you are not loading it from a different site. PS: What is prin1? Regards, -- Agustin