unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Fabian Braennstroem <fab@ddorf.de>
Subject: Re: set dictionary for a file
Date: Thu, 13 Oct 2005 19:29:46 +0000 (UTC)	[thread overview]
Message-ID: <slrndktdec.3cc.fab@node1.ddorf.de> (raw)
In-Reply-To: mailman.11235.1129223467.20277.help-gnu-emacs@gnu.org

Hi Kevin,

On 2005-10-13, Kevin Rodgers <ihs_4664@yahoo.com> wrote:
>  Fabian Braennstroem wrote:
>  > On 2005-10-12, Kevin Rodgers <ihs_4664@yahoo.com> wrote:
>  >> So try (setq ispell-local-dictionary "deutsch8") in your hook.
> 
>  Did you try:
> 
>  (add-hook 'gnus-select-group-hook
>             (lambda ()
>               (when (string-match "^de\\."
>                                   (gnus-group-real-name gnus-newsgroup-name))
>                 (setq ispell-local-dictionary "deutsch8"))))

I did use that before, now I don't use Gnus any more.

> 
>  >> ,----[ 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'.
>  >> `----
>  >
>  > I am not sure, if I understood that correctly. Customizing
>  > the find-file-hook I get a list of functions which are
>  > called when a buffer gets loaded; e.g.  vc-find-file-hook
>  > gets loaded.
>  > So something like could work when I open
>  > 'test.tex':
>  >
>  >     (add-hook 'vc-find-file-hook
>  >      (lambda ()
>  >       (cond
>  >        ((string-match "test.tex" )
>  >     (setq ispell-local-dictionary "deutsch8")))))
>  >
>  > Somehow it doesn't work!?
> 
>  vc-find-file-hook is a function that gets called (via the
>  find-file-hooks variable) when a file is visited; it is not a hook
>  variable itself.  You want to add another function to find-file-hooks:
> 
>  (add-hook 'find-file-hooks
>             (lambda ()
>               (when (equal (file-name-nondirectory buffer-file-name) 
>  "test.tex")
>                 (setq ispell-local-dictionary "deutsch8"))))

Thanks! That is exactly what I need.

> 
>  But I suspect what you really want is:
> 
>  (add-hook 'text-mode-hook
>             (lambda ()
>               (setq ispell-local-dictionary "deutsch8")))
> 
>  Under what circumstances do you want to use any other dictionary than
>  deutsch8?

I need the german dictionary just for a couple texts;
actually I don't know which I need before I get started to
write anything. So I think the best way to set the dictinary
is to explicitly define the name of the file.


Greetings, Fabian

      parent reply	other threads:[~2005-10-13 19:29 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-12 17:28 set dictionary for a file Fabian Braennstroem
2005-10-12 18:38 ` Kevin Rodgers
     [not found] ` <mailman.11056.1129142547.20277.help-gnu-emacs@gnu.org>
2005-10-13  4:40   ` Fabian Braennstroem
2005-10-13 16:58     ` Kevin Rodgers
     [not found]     ` <mailman.11235.1129223467.20277.help-gnu-emacs@gnu.org>
2005-10-13 19:29       ` Fabian Braennstroem [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=slrndktdec.3cc.fab@node1.ddorf.de \
    --to=fab@ddorf.de \
    --cc=f.braennstroem@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).