help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Reparsing local variables without reopening file?


From: Thomas F. Burdick
Subject: Re: Reparsing local variables without reopening file?
Date: 22 Sep 2002 10:42:23 -0700

Ole Laursen <olau@hardworking.dk> 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!       |                        
    /       /      `-----------------------'                        
   (   -.  |                               
   |     ) |                               
  (`-.  '--.)                              
   `. )----'                               


reply via email to

[Prev in Thread] Current Thread [Next in Thread]