From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kenichi Handa Newsgroups: gmane.emacs.devel Subject: Re: Activate an input-method from file-local variables? Date: Tue, 18 Jul 2006 10:25:41 +0900 Message-ID: References: <17593.10.639545.231797@parhasard.net> <17594.9387.783893.359064@parhasard.net> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 (generated by SEMI 1.14.3 - "Ushinoya") Content-Type: text/plain; charset=US-ASCII X-Trace: sea.gmane.org 1153186006 26436 80.91.229.2 (18 Jul 2006 01:26:46 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 18 Jul 2006 01:26:46 +0000 (UTC) Cc: kehoea@parhasard.net, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jul 18 03:26:45 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1G2eMA-0003eA-Gm for ged-emacs-devel@m.gmane.org; Tue, 18 Jul 2006 03:26:38 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1G2eM9-0000E1-W0 for ged-emacs-devel@m.gmane.org; Mon, 17 Jul 2006 21:26:38 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1G2eLx-0000Ay-Pi for emacs-devel@gnu.org; Mon, 17 Jul 2006 21:26:25 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1G2eLx-0000Ah-3a for emacs-devel@gnu.org; Mon, 17 Jul 2006 21:26:25 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1G2eLw-0000Ae-VI for emacs-devel@gnu.org; Mon, 17 Jul 2006 21:26:24 -0400 Original-Received: from [150.29.246.133] (helo=mx1.aist.go.jp) by monty-python.gnu.org with esmtp (Exim 4.52) id 1G2eOj-0004Ke-8f for emacs-devel@gnu.org; Mon, 17 Jul 2006 21:29:17 -0400 Original-Received: from smtp1.aist.go.jp ([150.29.246.12]) by mx1.aist.go.jp with ESMTP id k6I1QKps009051; Tue, 18 Jul 2006 10:26:20 +0900 (JST) env-from (handa@m17n.org) Original-Received: by smtp1.aist.go.jp with ESMTP id k6I1QJ5a019281; Tue, 18 Jul 2006 10:26:19 +0900 (JST) env-from (handa@m17n.org) Original-Received: from handa by etlken with local (Exim 3.36 #1 (Debian)) id 1G2eLF-0001Uq-00; Tue, 18 Jul 2006 10:25:41 +0900 Original-To: Stefan Monnier In-reply-to: (message from Stefan Monnier on Sun, 16 Jul 2006 08:32:45 -0400) User-Agent: SEMI/1.14.3 (Ushinoya) FLIM/1.14.2 (Yagi-Nishiguchi) APEL/10.2 Emacs/22.0.50 (i686-pc-linux-gnu) MULE/5.0 (SAKAKI) 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:57233 Archived-At: In article , Stefan Monnier writes: >>> AFAICT this does not do what I want: it doesn't *activate* the >>> input method. You still need to hit C-\ to activate it. >> Ah, excuse my misunderstanding. Looking through the source of >> activate-input-method, as well as setting current-input-method, it calls >> input-method-specific initialisation code, so simply setting a file-local >> variable would seem to be impossible. You could, of course, add something >> like the below to your init file, and specify hack-activate-input-method >> appropriately in the files you want it to work for. > That seems much more complex than my current solution of using > `eval: (activate-input-method "TeX")' and adding > (put 'activate-input-method 'safe-local-eval-function t). Provided that a local variable specified in a file is customizable, does :set function of it called? If so, I think the most natural solution is to change (defvar current-input-method ...) to (defcustom current-input-method ...) and provide a proper :set function (perhaps one that calls activate-input-method). Then a user can have this in his file: ;; Local Variables: ;; current-input-method: "INPUT_METHOD_NAME" ;; End: --- Kenichi Handa handa@m17n.org