From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Fabian Braennstroem Newsgroups: gmane.emacs.help Subject: Re: set dictionary for a file Date: Thu, 13 Oct 2005 04:40:44 +0000 (UTC) Organization: www.braennstroem.de Message-ID: References: Reply-To: f.braennstroem@gmx.de NNTP-Posting-Host: main.gmane.org X-Trace: sea.gmane.org 1129178774 18907 80.91.229.2 (13 Oct 2005 04:46:14 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 13 Oct 2005 04:46:14 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Oct 13 06:46:04 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EPuy0-0006DZ-Qh for geh-help-gnu-emacs@m.gmane.org; Thu, 13 Oct 2005 06:45:21 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EPuy0-00008s-Am for geh-help-gnu-emacs@m.gmane.org; Thu, 13 Oct 2005 00:45:20 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!newsfeed.gamma.ru!Gamma.RU!npeer.de.kpn-eurorings.net!usenet-feed.fhg.de!news-koe1.dfn.de!cl-news!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 102 Original-NNTP-Posting-Host: bonsai.fernuni-hagen.de Original-X-Trace: tamarack.fernuni-hagen.de 1129178444 24881 132.176.114.21 (13 Oct 2005 04:40:44 GMT) Original-X-Complaints-To: newsadmin@fernuni-hagen.de Original-NNTP-Posting-Date: Thu, 13 Oct 2005 04:40:44 +0000 (UTC) Mail-Copies-To: nobody User-Agent: slrn/0.9.8.1/rt (Linux) Original-Xref: shelby.stanford.edu gnu.emacs.help:134606 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:30187 Archived-At: Hi Kevin, thanks for the tips! On 2005-10-12, Kevin Rodgers wrote: > 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'. > `---- 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!? Now,I just tried to use: (if (eq buffer-file-name "article.tex" ) (setq ispell-local-dictionary "deutsch8")) which doesn't work either!? Greetings! Fabian