From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Matthias Meulien Newsgroups: gmane.emacs.help Subject: Re: automating language environment settings Date: 04 Sep 2002 21:06:37 +0200 Organization: ...!#$@~? Sender: help-gnu-emacs-admin@gnu.org Message-ID: References: NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1031166870 16932 127.0.0.1 (4 Sep 2002 19:14:30 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 4 Sep 2002 19:14:30 +0000 (UTC) Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 17mfbg-0004Oo-00 for ; Wed, 04 Sep 2002 21:14:28 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10) id 17mfdG-0004F7-00; Wed, 04 Sep 2002 15:16:06 -0400 Original-Path: shelby.stanford.edu!nntp.stanford.edu!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!mango.news.easynet.net!easynet.net!proxad.net!feeder2-1.proxad.net!news1-2.free.fr!not-for-mail Mail-Copies-To: never Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Original-Lines: 36 Original-NNTP-Posting-Date: 04 Sep 2002 21:02:15 MEST Original-NNTP-Posting-Host: 62.147.140.237 Original-X-Trace: 1031166135 news1-2.free.fr 491 62.147.140.237 Original-X-Complaints-To: abuse@proxad.net Original-Xref: nntp.stanford.edu gnu.emacs.help:104480 Original-To: help-gnu-emacs@gnu.org Errors-To: help-gnu-emacs-admin@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.help:1042 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:1042 > From time to time, I'm using emacs to edit documents written using ISO > 8859-2 charset. Thus, I have first to set language environment to > "Latin-2", then to open text file and finally to select "latin-2-prefix" > as input method. You can activate the "latin-2-prefix" input method automatically when changing of language environment with the following hooks; it also sets the default input method for the latin-1 language environment: (add-hook 'set-language-environment-hook '(lambda () (let ((lang current-language-environment)) (cond ((equal lang "Latin-2") (set-terminal-coding-system 'latin-2) (activate-input-method "latin-2-prefix")) ((equal lang "Latin-1") (set-terminal-coding-system 'latin-1) (setq default-input-method "french-prefix")))))) (add-hook 'exit-language-environment-hook '(lambda () (set-terminal-coding-system nil))) Note that the terminal settings are useful when you work on a character terminal. > So I was thinking about automating above process by creating > corresponding emacs mode and then to reference this mode from first > line of related documents; if everything setup properly, emacs > should be able to apply all necessary settings upon opening > document. (...) Read about local variables in the info manual. Don't you think that the `C-x RET l' key sequence is enough? -- Matthias