From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Sebastien Vauban" Subject: Guess correct dictionary for Ispell Date: Fri, 08 Nov 2013 23:45:33 +0100 Message-ID: <86zjpeecmq.fsf@somewhere.org> Mime-Version: 1.0 Content-Type: text/plain Return-path: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org-mXXj517/zsQ@public.gmane.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org-mXXj517/zsQ@public.gmane.org To: emacs-orgmode-mXXj517/zsQ@public.gmane.org Hello, In case that can be useful for someone, here is how I detect which dictionary to use on a file basis: --8<---------------cut here---------------start------------->8--- (defun my-org-switch-language () "Switch language if a `#+LANGUAGE:' Org meta-tag is on top 8 lines." (save-excursion (goto-line (1+ 8)) (let (lang (dico-alist '(("fr" . "francais") ("en" . "american")))) (when (re-search-backward "#\\+LANGUAGE: +\\([[:alpha:]_]*\\)" 1 t) (setq lang (match-string 1)) (ispell-change-dictionary (cdr (assoc lang dico-alist))))))) (add-hook 'org-mode-hook 'my-org-switch-language) --8<---------------cut here---------------end--------------->8--- Best regards, Seb -- Sebastien Vauban