unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Kevin Rodgers <ihs_4664@yahoo.com>
Subject: Re: set dictionary for a file
Date: Thu, 13 Oct 2005 10:58:27 -0600	[thread overview]
Message-ID: <dim3nn$si5$1@sea.gmane.org> (raw)
In-Reply-To: <slrndkrpbc.3cg.fab@node1.ddorf.de>

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"))))

 >> ,----[ 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"))))

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?

 > Now,I just tried to use:
 >
 >  (if (eq buffer-file-name "article.tex" )
 >  (setq ispell-local-dictionary "deutsch8"))
 >
 > which doesn't work either!?

`C-h v buffer-file-name' in the article.tex buffer will answer that.

-- 
Kevin Rodgers

  reply	other threads:[~2005-10-13 16:58 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 [this message]
     [not found]     ` <mailman.11235.1129223467.20277.help-gnu-emacs@gnu.org>
2005-10-13 19:29       ` Fabian Braennstroem

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='dim3nn$si5$1@sea.gmane.org' \
    --to=ihs_4664@yahoo.com \
    /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).