From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.help Subject: Re: Rebinding a key in a local variable Date: 15 Feb 2004 08:02:27 +0200 Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: Reply-To: Eli Zaretskii NNTP-Posting-Host: deer.gmane.org X-Trace: sea.gmane.org 1076825163 7982 80.91.224.253 (15 Feb 2004 06:06:03 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 15 Feb 2004 06:06:03 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Feb 15 07:05:57 2004 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AsFPh-0000mn-00 for ; Sun, 15 Feb 2004 07:05:57 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AsFMO-0001Yc-43 for geh-help-gnu-emacs@m.gmane.org; Sun, 15 Feb 2004 01:02:32 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1AsFM7-0001Vo-3w for help-gnu-emacs@gnu.org; Sun, 15 Feb 2004 01:02:15 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1AsFLa-0001Rh-7d for help-gnu-emacs@gnu.org; Sun, 15 Feb 2004 01:02:14 -0500 Original-Received: from [207.232.27.5] (helo=WST0054) by monty-python.gnu.org with asmtp (Exim 4.24) id 1AsFKi-0001O7-OZ for help-gnu-emacs@gnu.org; Sun, 15 Feb 2004 01:00:49 -0500 Original-To: help-gnu-emacs@gnu.org In-reply-to: (travislspencer@hotmail.com) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.2 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:16868 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:16868 > From: "Travis Spencer" > Newsgroups: gnu.emacs.help > Date: Sat, 14 Feb 2004 12:25:13 -0800 > > I am trying to rebind the tab key in a local variable, but I can't figure > out the syntax. I think you need to use `eval', since global-set-key is a function, not a variable. > # Local Variables: > # tab-stop-list: (0 4 40) > # global-set-key: [tab] tab-to-tab-stop > # End: > > This gives me the error message: > > File local-variables error: (error "Local variables entry is terminated > incorrectly") I think this is because global-set-key is not a variable. Try this: # eval: (global-set-key [tab] 'tab-to-tab-stop) Btw, it's not a very good idea to use global-set-key here, since that changes the binding of TAB in _all_ buffers and all modes, globally. I'd use local-set-key, which at least limits that to the mode of the buffer where you visit the file with these local variables. If you _really_ want to rebind TAB globally, the place to do that is in your ~/.emacs init file.