From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: michael@cadilhac.name (=?iso-8859-1?Q?Micha=EBl?= Cadilhac) Newsgroups: gmane.emacs.devel Subject: flyspell doesn't catch local variables? Date: Wed, 06 Dec 2006 19:35:07 +0100 Organization: Epita/LRDE Message-ID: <87wt54x484.fsf@lrde.org> NNTP-Posting-Host: dough.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1738724727==" X-Trace: sea.gmane.org 1165430148 22813 80.91.229.10 (6 Dec 2006 18:35:48 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 6 Dec 2006 18:35:48 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Dec 06 19:35:44 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by dough.gmane.org with esmtp (Exim 4.50) id 1Gs1cD-0001RI-72 for ged-emacs-devel@m.gmane.org; Wed, 06 Dec 2006 19:35:33 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Gs1cC-0006D1-JR for ged-emacs-devel@m.gmane.org; Wed, 06 Dec 2006 13:35:32 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Gs1c1-0006Co-8o for emacs-devel@gnu.org; Wed, 06 Dec 2006 13:35:21 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Gs1bu-0006B6-Tm for emacs-devel@gnu.org; Wed, 06 Dec 2006 13:35:20 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Gs1bu-0006B3-PS for emacs-devel@gnu.org; Wed, 06 Dec 2006 13:35:14 -0500 Original-Received: from [62.39.139.2] (helo=kualalumpur.lrde.epita.fr) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1Gs1bu-0003mj-Cc for emacs-devel@gnu.org; Wed, 06 Dec 2006 13:35:14 -0500 Original-Received: from mahaena.lrde.epita.fr ([192.168.101.66] helo=mahaena.lrde) by kualalumpur.lrde.epita.fr with esmtp (Exim 4.50) id 1Gs1bn-00024S-2b for emacs-devel@gnu.org; Wed, 06 Dec 2006 19:35:07 +0100 Original-To: emacs-devel@gnu.org Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAMAAABg3Am1AAAAYFBMVEUWCwUyFQk6JBNLGglQK BVRMiRkHQtwMBZuOCRyRi1iQiZyUUCFNxuIPCKRTC2mVTSpZTqVVS2SW0OYZkixb0qraE/KeU7EcT +4h2bPhVfQkm7hlnDkvZjYqIjrwJnzwqB5+4wZAAAACXBIWXMAAAsTAAALEwEAmpwYAAAACXZwQWc AAAAwAAAAMADO7oxXAAADvUlEQVRIx32Wi5ajIAyGRcCAchErVqu27/+W+wfbs724i3Mcz5n/S0JI wlTbyXrs+zrFEL1zPuIdY7xO6+PBf6u27f4DrFPO3jvoQYRYFoj9CXyu+7ZPEWrXUNM0zpEfgjuY9 RTY1hyg5qUNgMb44Dwiiz5OZ8DCwVCjpdLaGNOVtw+M+Lz+AlNwRAhGSamh1abrtFKmG0DkmL8BhE +GdCNlreChBaO7DpjpIvbv/fr4AnqErhoYF6KI4aPrLIeFQLGj6RO4JWLjtdZ1WQXhvegGG0EKyO/ vwH7xJBk4tLrW5UPxN3zAufHDO3Axh4MCMPLisKQyRuJo/Btw60gpWcu6OogjsmIeiRIKgUlj3oCp a1QtRP1ywT9VfXCiZMEg4X+BfYADAHhhdc+NV1UBBT9SIedvgFFwDFslkO7S8e+KtQcohJCyefdgt DoC4pe+FB8VL3bDeiGB/AVurZJCvY5AtdaSKpYLJArxCXCOlMUpiRpF0Sbb8nZYBnGBPoGZuOCGAd lTqgXRlrrDuUgpDh+VNPYN0IRALnkIFsVTiBanbBQbesYl1Num584iojnnHIPVJRSJvFnrrFHPmD6 yBKJVbZ+nKScjIVfatlSaJ9BBiIbcW1rnOSF4F/OYGiFLQaCXyAUsLTggnAN9VOuMaBtuX1QmHwok RD4CIHzXChG5z37oWkRhxx5tCmdKNUSp7/tUYlQwQ/6z424JPtr+mlwwwbbGQj5CXwBjyPj4NQRmJ J7GZez7mPpk02W+jvgMnFrUaozhE7jPF9va+QZinMaxn0dGMSy5ExuHmdZ8APf7felTv9zGccGal3 le2JdHt0lJaGklvjwA6JcVACwXpugd+gAJQvuIL2C7r9eJgQscXQH0I+sxkrBjjE0ukW9gui7rMo9 DAoGnTzyZceA8lYh+AMxWeFiu/ZhSLCeAUex4hhPr6XsPPAqu0xRxNVAaS0J58pODvhCN/AFWziLP rMtYjsxD6y0dDpDeH2Cf+sxEyPmSYuIJbOi1zCmQc/DkbQg2FQ/O2RfgDP0Aj8eU+VpDmlpLvBkqe kTJpe5+r6xtz9A7VnCxlthfAJkz4JGRJfzVcEiHHK36BOgE2PYRPpIna0K5wAzGCLcWN6A6A3CRRu SJWo+NoybQfag9TA/CxymwTdnDWkh4cPOweckTRCkhzgH8K+ChxkKG2L4oQBlPp8B2G/sc02CDKTp xXExlOJ3q79vcpyGYlmelFOXRxyj/hwe+XnBhw6osY17wJfB/IB/3o2a14Hl8jNfqDx44iLN4w0aG AAAAAElFTkSuQmCC User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.90 (gnu/linux) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:63364 Archived-At: --===============1738724727== Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Try this: $ emacs -Q M-: (progn (require 'latex) (setq ispell-dictionary "francais") (add-hook 'LaTeX-mode-hook 'flyspell-mode)) And now open the following file: --=-=-= Content-Type: text/x-tex Content-Disposition: inline; filename=test.tex \section{What is a game?} %%% Local Variables: %%% mode: latex %%% ispell-local-dictionary: "english" %%% End: --=-=-= The dictionary loaded will be the french one, not the english one. The following fixes that. --=-=-= Content-Type: text/x-patch; charset=iso-8859-1 Content-Disposition: inline; filename=flyspell.patch Content-Transfer-Encoding: quoted-printable Index: lisp/textmodes/flyspell.el =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /sources/emacs/emacs/lisp/textmodes/flyspell.el,v retrieving revision 1.112 diff -c -r1.112 flyspell.el *** lisp/textmodes/flyspell.el 11 Nov 2006 01:00:03 -0000 1.112 =2D-- lisp/textmodes/flyspell.el 6 Dec 2006 17:34:41 -0000 *************** *** 541,546 **** =2D-- 541,551 ---- (member (or ispell-local-dictionary ispell-dictionary) flyspell-dictionaries-that-consider-dash-as-word-deli= miter))))) =20=20 + (defun flyspell-hack-local-variables-hook () + ;; When local variables are loaded, see if the dictionary context + ;; has changed. + (flyspell-accept-buffer-local-defs 'force)) +=20 (defun flyspell-kill-ispell-hook () (setq flyspell-last-buffer nil) (dolist (buf (buffer-list)) *************** *** 579,584 **** =2D-- 584,592 ---- (add-hook 'pre-command-hook (function flyspell-pre-command-hook) t t) ;; we bound flyspell action to after-change hook (add-hook 'after-change-functions 'flyspell-after-change-function nil t) + ;; we bound flyspell action to hack-local-variables-hook + (add-hook 'hack-local-variables-hook + (function flyspell-hack-local-variables-hook) t t) ;; set flyspell-generic-check-word-predicate based on the major mode (let ((mode-predicate (get major-mode 'flyspell-mode-predicate))) (if mode-predicate *************** *** 684,689 **** =2D-- 692,699 ---- (remove-hook 'post-command-hook (function flyspell-post-command-hook) t) (remove-hook 'pre-command-hook (function flyspell-pre-command-hook) t) (remove-hook 'after-change-functions 'flyspell-after-change-function t) + (remove-hook 'hack-local-variables-hook + (function flyspell-hack-local-variables-hook) t) ;; we remove all the flyspell hilightings (flyspell-delete-all-overlays) ;; we have to erase pre cache variables Index: lisp/textmodes/../ChangeLog =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /sources/emacs/emacs/lisp/ChangeLog,v retrieving revision 1.10400 diff -c -0 -r1.10400 ChangeLog *** lisp/textmodes/../ChangeLog 4 Dec 2006 10:24:04 -0000 1.10400 =2D-- lisp/textmodes/../ChangeLog 6 Dec 2006 17:35:03 -0000 *************** *** 0 **** =2D-- 1,7 ---- + 2006-12-06 Micha=EBl Cadilhac +=20 + * textmodes/flyspell.el (flyspell-hack-local-variables-hook): New. + Force buffer local defs evaluation on local variables loading. + (flyspell-mode-on, flyspell-mode-off): Use it in + `hack-local-variables-hook'. +=20 --=-=-= Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable TIA! =2D-=20 /!\ My mail address has changed, please update your files accordingly. | Micha=EBl `Micha' Cadilhac | La culture c'est comme la confitu= re, | | Epita/LRDE Promo 2007 | c'est meilleur avec du pain. = | | http://michael.cadilhac.name | -- MOI59 = | `--JID: michael.cadilhac@gmail.com--' - = --' --=-=-=-- --==-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (GNU/Linux) iD8DBQFFdw1hUJhDmOfFA3URAiLCAJ4vQe5jZqWiaKoURd4+yzyiz7Vq0wCghwco Yn5hGJOOnY+NVs4gF+t6PzQ= =Biwz -----END PGP SIGNATURE----- --==-=-=-- --===============1738724727== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-devel --===============1738724727==--