help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: set dictionary for a file


From: Kevin Rodgers
Subject: Re: set dictionary for a file
Date: Wed, 12 Oct 2005 12:38:08 -0600
User-agent: Mozilla Thunderbird 0.9 (X11/20041105)

Fabian Braennstroem wrote:
> I would like to set/change dictionary for certain files,
> which I would declare in .emacs. I tried the
> ispell-multi.el, but it somehow didn't work for me. In my
> Gnus I had
>
>    (add-hook 'gnus-select-group-hook
>     (lambda ()
>      (cond
>       ((string-match
>         "^de\\." (gnus-group-real-name gnus-newsgroup-name))
>        (ispell-change-dictionary "deutsch8"))
>
> which worked a while ago.

Here's what ispell.el itself says:

;; Buffer-Local features:
;; There are a number of buffer-local features that can be used to customize
;;  ispell for the current buffer.  This includes language dictionaries,
;;  personal dictionaries, parsing, and local word spellings.  Each of these
;;  local customizations are done either through local variables, or by
;;  including the keyword and argument(s) at the end of the buffer (usually
;;  prefixed by the comment characters).  See the end of this file for
;;  examples.  The local keywords and variables are:

;;  ispell-dictionary-keyword   language-dictionary
;;      uses local variable ispell-local-dictionary
;;  ispell-pdict-keyword        personal-dictionary
;;      uses local variable ispell-local-pdict
;;  ispell-parsing-keyword      mode-arg extended-char-arg
;;  ispell-words-keyword        any number of local word spellings

And:

,----[ C-h v ispell-local-dictionary RET ]
| ispell-local-dictionary's value is nil
|
| Documentation:
| If non-nil, the dictionary to be used for Ispell commands.
| The value must be a string dictionary name in `ispell-dictionary-alist'.
| This variable becomes buffer-local when set in any fashion.
|
| 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.
|
| To create a non-standard default dictionary (not from `ispell-dictionary-alist')
| call function `set-default' with the new dictionary name.
|
| You can customize this variable.
|
| Defined in `ispell'.
`----

So try (setq ispell-local-dictionary "deutsch8") in your hook.

> Does something similar (file-load-hook?) exist for ordinary files?

,----[ C-h v find-file-hooks RET ]
| find-file-hooks's value is
| (vc-find-file-hook)
|
|
| Documentation:
| List of functions to be called after a buffer is loaded from a file.
| The buffer's local variables (if any) will have been processed before the
| functions are called.
|
| Defined in `files'.
`----

--
Kevin Rodgers





reply via email to

[Prev in Thread] Current Thread [Next in Thread]