From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Third Newsgroups: gmane.emacs.bugs Subject: bug#19229: ispell on Windows Date: Thu, 21 May 2015 21:19:19 +0100 Message-ID: References: <831tib6omo.fsf@gnu.org> <83zj4y649d.fsf@gnu.org> <83r3q96gt4.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1432239630 13684 80.91.229.3 (21 May 2015 20:20:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 21 May 2015 20:20:30 +0000 (UTC) Cc: 19229@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu May 21 22:20:22 2015 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 1YvWx3-0004mj-KT for geb-bug-gnu-emacs@m.gmane.org; Thu, 21 May 2015 22:20:21 +0200 Original-Received: from localhost ([::1]:59371 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YvWx2-0003xy-Vi for geb-bug-gnu-emacs@m.gmane.org; Thu, 21 May 2015 16:20:20 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42612) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YvWwu-0003xZ-5i for bug-gnu-emacs@gnu.org; Thu, 21 May 2015 16:20:17 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YvWwn-0005xv-HS for bug-gnu-emacs@gnu.org; Thu, 21 May 2015 16:20:12 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:42421) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YvWwn-0005w0-Em for bug-gnu-emacs@gnu.org; Thu, 21 May 2015 16:20:05 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1YvWwm-0007Yv-8a for bug-gnu-emacs@gnu.org; Thu, 21 May 2015 16:20:04 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alan Third Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 21 May 2015 20:20:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 19229 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 19229-submit@debbugs.gnu.org id=B19229.143223956929024 (code B ref 19229); Thu, 21 May 2015 20:20:03 +0000 Original-Received: (at 19229) by debbugs.gnu.org; 21 May 2015 20:19:29 +0000 Original-Received: from localhost ([127.0.0.1]:52396 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YvWwC-0007Y3-9p for submit@debbugs.gnu.org; Thu, 21 May 2015 16:19:28 -0400 Original-Received: from mail-vn0-f50.google.com ([209.85.216.50]:36606) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YvWw9-0007Xp-De for 19229@debbugs.gnu.org; Thu, 21 May 2015 16:19:26 -0400 Original-Received: by vnbg190 with SMTP id g190so6791982vnb.3 for <19229@debbugs.gnu.org>; Thu, 21 May 2015 13:19:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=2dLto6Edd6IRv+HY6rbU+Hhx6dzHxSDeBbio/8qZ9io=; b=GLgFtd+I0aNJjCEgrp79wx3cDwuLYSPaiER2GpddFyGOX23oUte3jF87eXwEm4Fb/X BKXecNZlf9+CsSZmJo6QRsHWmEYBGclozc1mA/M4BL38hidXWAnLJRYPvxQYL4wmacMH GduN7NlHtyJK6BkGYeAYsILBUPN4wPLRMefQnmB6O5/ZgBWTavC8SCC+mc7uERRaDmbR xpyB923+oK7w5kTwTxBv3Nnkkjfmh+IwUZN6o3+Luo1e7gx0QhTfKGLIgicymIYB5Goq bPAucrCR/tDRYaou6dF0r8e6Kl3fHskftAm8NtIT46ekzEP3G97I56IYA/nqFgx8XBLb iAmg== X-Received: by 10.52.6.8 with SMTP id w8mr1697292vdw.85.1432239560054; Thu, 21 May 2015 13:19:20 -0700 (PDT) Original-Received: by 10.52.253.7 with HTTP; Thu, 21 May 2015 13:19:19 -0700 (PDT) In-Reply-To: <83r3q96gt4.fsf@gnu.org> X-Google-Sender-Auth: ITbzzbwVtvYOPYtxvPQnntrAYg8 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:103004 Archived-At: On 21 May 2015 at 17:23, Eli Zaretskii wrote: >> Date: Thu, 21 May 2015 09:16:00 +0100 >> From: Alan Third >> Cc: 19229@debbugs.gnu.org >> >> This works in windows! Once this is done I can then use >> ispell-change-dictionary to change the dictionary to anything I want. >> Presumably, then, the problem I'm seeing is that ispell+hunspell falls >> over if the dictionary initially set by emacs doesn't exist. OK, I was completely wrong here. >> Is there a way to force ispell+hunspell to use a different dictionary >> from the start other than changing the LANG variable? > > There are several ways of doing that. > > First, you can customize the variable ispell-dictionary to name the > dictionary (without the .aff or .dic extensions, just the stem of the > basename, as in "en_GB"). You can set this in your ~/.emacs. This > will cause ispell.el to invoke Hunspell with the appropriate -d > command-line option. This doesn't work. I've done some digging in ispell.el and I think I know what's going on. The function ispell-find-hunspell-dictionaries parses the output of `hunspell -D` looking for *hunspell's* default dictionary. If you don't have any of the variables you mentioned set then hunspell doesn't give a default. Specifically, it looks for a line that ends ".aff" then uses that line in an argument for ispell-parse-hunspell-affix-file, which fails if it's nil, which in my case it is. Because that function errors, ispell-find-hunspell-dictionaries stops processing and therefore never builds ispell-hunspell-dictionary-alist, which seems to be a pretty vital variable. While that doesn't seem like very good behaviour to me, I don't know if you'd classify it as a bug. > Alternatively, you can set the environment variable DICTIONARY to name > the dictionary, as in "set DICTIONARY=en_GB". This environment > variable is documented in the Hunspell man page. I suspect that, in the short term at least, setting this in my init.el is the best solution. This will work transparently in both Windows and OS X. (There doesn't seem to be any simple way of setting environment variables for "GUI" programs in recent versions of OS X. I have to set PATH in my init.el too.) Thanks! -- Alan Third