From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?utf-8?Q?S=C3=A9bastien_Vauban?= Subject: Update ispell-dictionary to text language Date: Mon, 11 Jan 2010 12:27:52 +0100 Message-ID: <87d41gkhjb.fsf@mundaneum.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org-mXXj517/zsQ@public.gmane.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org-mXXj517/zsQ@public.gmane.org To: emacs-orgmode-mXXj517/zsQ@public.gmane.org Hello, Here my proposal (and my very first self-written chunk of ELisp code) for switching to the right language for ispell, upon reading the contents of the meta-tag `LANGUAGE'. --8<---------------cut here---------------start------------->8--- (defun org-switch-language () "Switch language for Org file, if a `#+LANGUAGE:' meta-tag is on top 14= lines." (save-excursion (goto-line 15) (if (re-search-backward "#\\+LANGUAGE: +\\([A-Za-z_]*\\)" 1 t) (ispell-change-dictionary (match-string 1))))) --8<---------------cut here---------------end--------------->8--- That should be hooked, such in: --8<---------------cut here---------------start------------->8--- (add-hook 'org-mode-hook (lambda () ;; file modification date (set (make-local-variable 'time-stamp-format) "%:y-%02m-%02d") (set (make-local-variable 'time-stamp-start) "^#\\+DATE: +") (set (make-local-variable 'time-stamp-end) "$") ;; guess language (org-switch-language) ;; flyspell mode to spell check everywhere (flyspell-mode 1))) --8<---------------cut here---------------end--------------->8--- Maybe that could become a default in Org. I think that makes sense. Comments are (more than) welcome... Best regards, Seb --=20 S=C3=A9bastien Vauban _______________________________________________ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode-mXXj517/zsQ@public.gmane.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode