From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: tfb@hurricane.OCF.Berkeley.EDU (Thomas F. Burdick) Newsgroups: gmane.emacs.help Subject: Re: Reparsing local variables without reopening file? Date: 22 Sep 2002 10:42:23 -0700 Organization: University of California, Berkeley Sender: help-gnu-emacs-admin@gnu.org Message-ID: References: <87d6r7w3yy.fsf@bach.composers> NNTP-Posting-Host: localhost.gmane.org X-Trace: main.gmane.org 1032717384 16190 127.0.0.1 (22 Sep 2002 17:56:24 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 22 Sep 2002 17:56:24 +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 17tAxy-0004Cs-00 for ; Sun, 22 Sep 2002 19:56:22 +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 17tAxx-0000gD-00; Sun, 22 Sep 2002 13:56:21 -0400 Original-Path: shelby.stanford.edu!nntp.stanford.edu!newsfeed.stanford.edu!newsfeed.berkeley.edu!ucberkeley!agate.berkeley.edu!agate!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 38 Original-NNTP-Posting-Host: hurricane.ocf.berkeley.edu Original-X-Trace: agate.berkeley.edu 1032716545 27241 192.58.221.201 (22 Sep 2002 17:42:25 GMT) Original-X-Complaints-To: usenet@agate.berkeley.edu Original-NNTP-Posting-Date: Sun, 22 Sep 2002 17:42:25 +0000 (UTC) X-Newsreader: Gnus v5.7/Emacs 20.7 Original-Xref: nntp.stanford.edu gnu.emacs.help:105147 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:1702 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:1702 Ole Laursen writes: > Hi > > I was changing a local variable for a test example when it occurred to > me that I didn't know how to make Emacs reparse them. For example: > > // Local Variables: *** > // compile-command: "g++ test.cpp -o test -O3" *** > // End: *** > > Now, one can save and kill the buffer and refind the file (or perhaps > even do a M-x revert-buffer); however, this seems silly. M-x apropos > gives hack-local-variables. But that is a function? What do the gurus > do? Or should hack-local-variables be a command (perhaps with a > somewhat more descriptive name :-)? Typing M-: (hack-local-variables) > is a little laborious. Come to think of it, that would be a nice thing to have as a command, wouldn't it? But hack-local-variables is the function that gets called when you find-file a file, so you can just put this in your .emacs: (defun my-reparse-local-variables () (interactive) (hack-local-variables)) (global-set-key ... #'my-reparse-local-varaibles) -- /|_ .-----------------------. ,' .\ / | No to Imperialist war | ,--' _,' | Wage class war! | / / `-----------------------' ( -. | | ) | (`-. '--.) `. )----'