all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Expected language "en" but got "sv"
@ 2013-11-10 20:49 Andreas Tjärnberg
  2013-11-10 22:04 ` Peter Dyballa
  0 siblings, 1 reply; 6+ messages in thread
From: Andreas Tjärnberg @ 2013-11-10 20:49 UTC (permalink / raw)
  To: help-gnu-emacs

Hello list,

I have had a small problem lately conserning my spell checker in
emacs. When I have tried to spell check I have gotten the error:
Expected language "en" but got "sv"
My spell checking config is modest I would say.
It turns out that I had my personal dictionary like this:
personal_ws-1.1 sv 3 
okontrollerat
rabalder
plåtarna

and that caused the error to appear when spell checking in english.

I am wondering how I am suppose to handle my personal dictionary if I
have some swedish and some english words that I want to add to it or
perhaps to different files and use them when appropriate.

There has been another thread about this that i've found but no answers
to the posts
https://lists.gnu.org/archive/html/help-gnu-emacs/2005-09/msg00178.html

Hope to get some input

regards
Andreas



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Expected language "en" but got "sv"
  2013-11-10 20:49 Andreas Tjärnberg
@ 2013-11-10 22:04 ` Peter Dyballa
  0 siblings, 0 replies; 6+ messages in thread
From: Peter Dyballa @ 2013-11-10 22:04 UTC (permalink / raw)
  To: Andreas Tjärnberg; +Cc: help-gnu-emacs


Am 10.11.2013 um 21:49 schrieb Andreas Tjärnberg:

> I am wondering how I am suppose to handle my personal dictionary if I
> have some swedish and some english words that I want to add to it or
> perhaps to different files and use them when appropriate.

I have:

-rw-rw-r--   1 pete   1700 14. Dez 2012  .ispell_english
-rw-rw-r--   1 pete   2216  5. Dez 2008  .ispell_german

and this can be configured via

	(setq ispell-personal-dictionary "~/.ispell_german")

You just have to switch… The statement above is not active in my init file, it's just left as a comment. What I do have is:

	      (setq ispell-program-name "ispell")
	;     (setq ispell-program-name "aspell")
	
	      (if (string= "aspell" ispell-program-name)
		(progn
	;	  (setq ispell-extra-args "--norm-form=comp --norm-required --run-together")
	;	  (setq ispell-dictionary "en_GB-ise-w_accents")
		  (setq ispell-dictionary "deutsch")
		  (set-default 'ispell-local-dictionary ispell-dictionary)
		  (add-hook 'LaTeX-mode-hook (function (lambda () (setq ispell-extra-args '("--mode=tex")))))
	;	  (setq-default ispell-extra-args '("--mode=tex"))
	;	  (setq-default ispell-extra-args '("--personal=custom_dict.rws"))
	;	  (add-hook 'LaTeX-mode-hook 'flyspell-mode)
		  (message "Alles für «a»spell")
		  )
;		  (setq ispell-dictionary "german8")
		  (setq ispell-dictionary "deutsch8")
		  (add-hook 'LaTeX-mode-hook (function (lambda () (setq ispell-extra-args '("-t")))))
		  (message "Alles für »i«spell")
		  (add-hook 'TeX-language-en-hook (function (lambda () (ispell-change-dictionary "british"))))
		  (add-hook 'TeX-language-de-hook (function (lambda () (ispell-change-dictionary ispell-dictionary))))
	      )

Maybe some lines can be deleted. It seems to work fine when I M-x ispell-change-dictionary.


--
Greetings

  Pete

People say that if you play Microsoft CD's backwards, you hear satanic things, but that's nothing, because if you play them forwards, they install MS Windows.




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Expected language "en" but got "sv"
       [not found] <mailman.5753.1384120154.10748.help-gnu-emacs@gnu.org>
@ 2013-11-11  3:21 ` Emanuel Berg
  0 siblings, 0 replies; 6+ messages in thread
From: Emanuel Berg @ 2013-11-11  3:21 UTC (permalink / raw)
  To: help-gnu-emacs

andreas.tjarnberg@fripost.org (Andreas Tjärnberg) writes:

> I have had a small problem lately conserning my spell
> checker in emacs. When I have tried to spell check I
> have gotten the error: Expected language "en" but got
> "sv"

I have Swedish and English spell checking with aspell
(but without flyspell, as that disturbs my typeflow),
and some shortcuts/defuns to make it work for words,
regions, or buffers, depending on the context
(DWIM). Though I can't answer your specific question, it
always worked for me, and I put all the
configuration/extension in one file, which might help
you:

http://user.it.uu.se/~embe8573/conf/.emacs-spell

-- 
Emanuel Berg, programmer-for-rent. CV, projects, etc at uXu
underground experts united:  http://user.it.uu.se/~embe8573


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Expected language "en" but got "sv"
@ 2013-11-11 19:43 Andreas
  0 siblings, 0 replies; 6+ messages in thread
From: Andreas @ 2013-11-11 19:43 UTC (permalink / raw)
  To: help-gnu-emacs

Hello,
Thanks Peter and Emanuel for your swift responses.
Your replies got me thinking and I finally found ispell.el which as it
stands I probably should have tried to find earlier.
It turns out that if you don't define your personal dictionaries the
ispell/aspell defaults are used which defaults to
~/.ispell_DICT for ispell
and
~/.aspell.LANG.pws for aspell
where DICT is some name of some kind and LANG is the language of choice.

It seems that both of the suggestions hinted at something like this but I
could not figure it out until I found it in ispell.el.

The simple solution would now be to just remove the variable and let aspell
sort it out. Which I have =).

Thanks for putting me on the right track!
regards
Andreas


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Expected language "en" but got "sv"
       [not found] <mailman.5825.1384199033.10748.help-gnu-emacs@gnu.org>
@ 2013-11-11 22:30 ` Emanuel Berg
  0 siblings, 0 replies; 6+ messages in thread
From: Emanuel Berg @ 2013-11-11 22:30 UTC (permalink / raw)
  To: help-gnu-emacs

Andreas <andreas.tjarnberg@fripost.org> writes:

> Thanks for putting me on the right track!

Those spellcheckers, and especially the dynamic
dictionaries, aren't that easy to figure out. Some time
ago, I wrote a script ("addict") how to add a new word
list: from text file, via sorting, and compressing, to a
unified dictionary (hopefully).

Even if you don't need such a tool, I can be interesting
to see the mechanics. Actually, I'm happy I wrote that
over-pedagogical tutorial, because by now, without it,
not even I can make out those twists and turns :)

http://user.it.uu.se/~embe8573/scripts/addict

-- 
Emanuel Berg, programmer-for-rent. CV, projects, etc at uXu
underground experts united:  http://user.it.uu.se/~embe8573


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Expected language "en" but got "sv"
@ 2013-11-13 23:02 Andreas
  0 siblings, 0 replies; 6+ messages in thread
From: Andreas @ 2013-11-13 23:02 UTC (permalink / raw)
  To: help-gnu-emacs

Hi Emanuel,
I was wondering about adding whole dictionaries when I was figuring out my
issues. I was unsure how the words where actually added to the lists as I
couldn't see a pattern for the small number that I used for testing.
Thanks for your script. I will file it under my resources tree for future
use.

Thanks again
Andreas


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-11-13 23:02 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-13 23:02 Expected language "en" but got "sv" Andreas
     [not found] <mailman.5825.1384199033.10748.help-gnu-emacs@gnu.org>
2013-11-11 22:30 ` Emanuel Berg
  -- strict thread matches above, loose matches on Subject: below --
2013-11-11 19:43 Andreas
     [not found] <mailman.5753.1384120154.10748.help-gnu-emacs@gnu.org>
2013-11-11  3:21 ` Emanuel Berg
2013-11-10 20:49 Andreas Tjärnberg
2013-11-10 22:04 ` Peter Dyballa

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.