From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Glenn Morris Newsgroups: gmane.emacs.bugs Subject: bug#13460: Issue to change dictionary when using hunspell on emacs Date: Thu, 17 Jan 2013 13:19:34 -0500 Message-ID: <20728.16566.19238.480349@gnu.org> References: <20130116122509.GA2209@omega.in.herr-schmitt.de> <83hamh80ry.fsf@gnu.org> <20130117131733.GA20519@omega.in.herr-schmitt.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1358446839 14405 80.91.229.3 (17 Jan 2013 18:20:39 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 17 Jan 2013 18:20:39 +0000 (UTC) Cc: 13460@debbugs.gnu.org To: Jochen Schmitt Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Jan 17 19:20:57 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 1Tvu59-0003PF-4w for geb-bug-gnu-emacs@m.gmane.org; Thu, 17 Jan 2013 19:20:55 +0100 Original-Received: from localhost ([::1]:54085 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tvu4p-0006nD-As for geb-bug-gnu-emacs@m.gmane.org; Thu, 17 Jan 2013 13:20:35 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:51680) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tvu4i-0006mQ-11 for bug-gnu-emacs@gnu.org; Thu, 17 Jan 2013 13:20:33 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tvu4b-00054I-PK for bug-gnu-emacs@gnu.org; Thu, 17 Jan 2013 13:20:27 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:60044) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tvu4b-00053r-Mf for bug-gnu-emacs@gnu.org; Thu, 17 Jan 2013 13:20:21 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1Tvu5G-0007uB-Fo for bug-gnu-emacs@gnu.org; Thu, 17 Jan 2013 13:21:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Glenn Morris Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 17 Jan 2013 18:21:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13460 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 13460-submit@debbugs.gnu.org id=B13460.135844682830344 (code B ref 13460); Thu, 17 Jan 2013 18:21:02 +0000 Original-Received: (at 13460) by debbugs.gnu.org; 17 Jan 2013 18:20:28 +0000 Original-Received: from localhost ([127.0.0.1]:37275 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tvu4e-0007tI-2L for submit@debbugs.gnu.org; Thu, 17 Jan 2013 13:20:28 -0500 Original-Received: from fencepost.gnu.org ([208.118.235.10]:44202) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tvu4Y-0007t8-EC for 13460@debbugs.gnu.org; Thu, 17 Jan 2013 13:20:22 -0500 Original-Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1Tvu3q-0008Ee-4d; Thu, 17 Jan 2013 13:19:34 -0500 In-Reply-To: <20130117131733.GA20519@omega.in.herr-schmitt.de> X-Attribution: GM X-Mailer: VM (www.wonderworks.com/vm), GNU Emacs (www.gnu.org/software/emacs) X-Hue: magenta X-Ran: a.#(uD$tMMV_R(:v&/'uMap;{Bbo({` 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:69935 Archived-At: (Please keep the debbugs address cc'd. Resending your comments so that they are more visible.) Date: Thu, 17 Jan 2013 14:17:34 +0100 From: Jochen Schmitt I have try to create a suggestion for a general solution for this issue in the next release of emacs. I have attached a patch on this mail which introduced a alist to translate the dictionary names like 'english' in the form which will be accepted by hunspell. I have done a first short test to check out, that this is a working solution. Of course the ispell-hunspell-dictionary-alist need extension because I have put only two entries to be able to check out my solution. Best Regards: Jochen Schmitt diff -up emacs-24.2/lisp/textmodes/ispell.el.hunspell emacs-24.2/lisp/textmodes/ispell.el --- emacs-24.2/lisp/textmodes/ispell.el.hunspell 2013-01-17 13:17:45.389785784 +0100 +++ emacs-24.2/lisp/textmodes/ispell.el 2013-01-17 13:19:43.388797273 +0100 @@ -572,6 +572,13 @@ re-start Emacs." (coding-system :tag "Coding System"))) :group 'ispell) +(defvar ispell-hunspell-dictionary-alist + '((nil "en_GB") + ("english" "en_GB") + ("american" "en_US") + ) + "Associating list between apell and hunspell dictionaries names" +) (defvar ispell-dictionary-base-alist '((nil @@ -2610,7 +2617,9 @@ Keeps argument list for future ispell in (append (if (and ispell-current-dictionary ; Not for default dict (nil) (not (member "-d" orig-args))) ; Only define if not overridden. - (list "-d" ispell-current-dictionary)) + (list "-d" (if ispell-really-hunspell + (cadr (assoc ispell-current-dictionary ispell-hunspell-dictionary-alist)) + ispell-current-dictionary))) orig-args (if ispell-current-personal-dictionary ; Use specified pers dict. (list "-p"