From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: slanning@theworld.com Newsgroups: gmane.emacs.help Subject: language environment depending on file Date: Thu, 14 Oct 2004 14:11:19 +0000 (UTC) Organization: The World Public Access UNIX, Brookline, MA Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: NNTP-Posting-Host: deer.gmane.org X-Trace: sea.gmane.org 1097763201 14528 80.91.229.6 (14 Oct 2004 14:13:21 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 14 Oct 2004 14:13:21 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Oct 14 16:13:17 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1CI6M0-0003KA-00 for ; Thu, 14 Oct 2004 16:13:16 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CI6T6-0007up-5n for geh-help-gnu-emacs@m.gmane.org; Thu, 14 Oct 2004 10:20:36 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!headwall.stanford.edu!unlnews.unl.edu!newsreader.wustl.edu!news.mv.net!nntp.TheWorld.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 23 Original-NNTP-Posting-Host: shell01.theworld.com Original-X-Trace: pcls4.std.com 1097763079 15533 192.74.137.71 (14 Oct 2004 14:11:19 GMT) Original-X-Complaints-To: abuse@TheWorld.com Original-NNTP-Posting-Date: Thu, 14 Oct 2004 14:11:19 +0000 (UTC) User-Agent: tin/1.4.5-20010409 ("One More Nightmare") (UNIX) (IRIX64/6.5 (IP27)) Original-Xref: shelby.stanford.edu gnu.emacs.help:125877 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: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:21247 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:21247 I'd like to have emacs change the current language environment depending on what file I'm editing. For example, all files ending in .mc, I want to edit in UTF-8, whereas otherwise use my default language environment. I tried this (add-hook 'mmm-mode-hook '(lambda () (make-variable-buffer-local 'current-language-environment) (set-language-environment "UTF-8"))) in ~/.emacs, to try to set the language environment only locally to a buffer that's loaded when mmm-mode is started (so really, it's more than *.mc). The problem is, it ends up changing the language environment globally, so after I edit a .mc file, any other file I edit is edited in UTF-8. So I'd like a per-mode way of setting the language environment or something. I guess I could add a similar hook as above for every other mode, setting language environment back to what I want for the default, but that seems pretty ugly.