This is Interesting: Free IT Magazines  
Home > Archive > Emacs > October 2006 > [flyspell] set dictionary via file variables





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author [flyspell] set dictionary via file variables
Petrik Galvosas

2006-10-02, 7:12 am

I like to select the dictionary for flyspell on a per file basis (I
frequently open different files using different languages and it is
tedious to always do "M-x ispell-change-dictionary RET
desired_local_dictionary RET"). So my first attempt was (in a LaTeX
File):

%%% Local Variables:
%%% mode: latex
%%% ispell-dictionary "german8"
%%% End:

This does not work but there is no error message either. Other flavors
like

%%% Local Variables:
%%% mode: latex
%%% ispell-dictionary: german8
%%% End:

do not work either.

Does anyone have a clue what can be done in this case?

Thanks in advance
Petrik

Reiner Steib

2006-10-02, 7:12 am

On Mon, Oct 02 2006, Petrik Galvosas wrote:

> %%% Local Variables:
> %%% mode: latex
> %%% ispell-dictionary "german8"
> %%% End:
>
> This does not work but there is no error message either.


Try `ispell-local-dictionary'. The correct syntax is with colon and
quotes (because it's a string value):

%%% ispell-local-dictionary: "german8"

Bye, Reiner.
--
,,,
(o o)
---ooO-(_)-Ooo--- | PGP key available | http://rsteib.home.pages.de/
Petrik Galvosas

2006-10-02, 1:13 pm

At Mon, 02 Oct 2006 12:32:49 +0200,
Reiner Steib wrote:
>
> Try `ispell-local-dictionary'. The correct syntax is with colon and
> quotes (because it's a string value):
>
> %%% ispell-local-dictionary: "german8"


Thanks so much. It works, only one needs to switch one time to another
buffer. I.e. directly after loading the file the local dictionary is
still default ("english" in my case). However after visiting another
buffer and returning ispell switches to "german8". I can live with
that.

Petrik



Felix E. Klee

2006-10-04, 7:15 pm

At Mon, 02 Oct 2006 11:47:53 +0200,
Petrik Galvosas wrote:
> Does anyone have a clue what can be done in this case?


I set the local dictionary outside of the variables section - probably
explained somewhere in the flyspell documentation. An example:

Local Variables:
mode:text
mode:flyspell
fill-column:79
End:
Local IspellDict: german8
LocalWords: Klee CreateNewMajorMode Esc wc

--
Felix E. Klee

Reiner Steib

2006-10-04, 7:15 pm

On Wed, Oct 04 2006, Felix E. Klee wrote:

> I set the local dictionary outside of the variables section - probably
> explained somewhere in the flyspell documentation.


I don't find anything related in the manual.

[...]
> End:
> Local IspellDict: german8


I didn't know about this. The doc string of `ispell-local-dictionary'
says that "Local IspellDict:" has the same effect as my suggestion:

,----[ <f1> v ispell-local-dictionary RET ]
| ispell-local-dictionary is a variable defined in `ispell'.
| [...]
|
| Setting `ispell-local-dictionary' to a value has the same effect as
| calling M-x ispell-change-dictionary with that value. This variable
| is automatically set when defined in the file with either
| `ispell-dictionary-keyword' or the Local Variable syntax.
`----

,----[ <f1> v ispell-dictionary-keyword RET ]
| ispell-dictionary-keyword is a variable defined in `ispell'.
| Its value is
| "Local IspellDict: "
|
| Documentation:
| The keyword for a local dictionary to use.
| The keyword must be followed by a valid dictionary name, defined in
| `ispell-local-dictionary-alist' or `ispell-dictionary-alist'.
| When multiple occurrences exist, the last keyword
| definition is used.
`----

Bye, Reiner.
--
,,,
(o o)
---ooO-(_)-Ooo--- | PGP key available | http://rsteib.home.pages.de/
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2009 webservertalk.com