From: "Sebastien Vauban" <sva-news-D0wtAvR13HarG/iDocfnWg@public.gmane.org>
To: emacs-orgmode-mXXj517/zsQ@public.gmane.org
Subject: Guess correct dictionary for Ispell
Date: Fri, 08 Nov 2013 23:45:33 +0100 [thread overview]
Message-ID: <86zjpeecmq.fsf@somewhere.org> (raw)
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
next reply other threads:[~2013-11-08 22:45 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-08 22:45 Sebastien Vauban [this message]
2013-11-09 0:39 ` Guess correct dictionary for Ispell Thomas S. Dye
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=86zjpeecmq.fsf@somewhere.org \
--to=sva-news-d0wtavr13harg/idocfnwg@public.gmane.org \
--cc=emacs-orgmode-mXXj517/zsQ@public.gmane.org \
/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.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.