* force reparse of file variables
@ 2015-08-13 16:59 Sam Halliday
2015-08-13 17:43 ` Dan Espen
0 siblings, 1 reply; 7+ messages in thread
From: Sam Halliday @ 2015-08-13 16:59 UTC (permalink / raw)
To: help-gnu-emacs
Hi all,
Is there a way to force (re)-load all the file variables in a buffer?
I have a template (with yasnippet) that populates files of certain types and derives some file variables (such as the 'compile-command), but I need to save/open to load it.
Best regards,
Sam
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: force reparse of file variables
2015-08-13 16:59 force reparse of file variables Sam Halliday
@ 2015-08-13 17:43 ` Dan Espen
2015-08-13 18:23 ` Drew Adams
2015-08-14 12:54 ` Sam Halliday
0 siblings, 2 replies; 7+ messages in thread
From: Dan Espen @ 2015-08-13 17:43 UTC (permalink / raw)
To: help-gnu-emacs
Sam Halliday <sam.halliday@gmail.com> writes:
> Hi all,
>
> Is there a way to force (re)-load all the file variables in a buffer?
>
> I have a template (with yasnippet) that populates files of certain
> types and derives some file variables (such as the 'compile-command),
> but I need to save/open to load it.
Do that lots of times.
I save the file, then revert-buffer.
--
Dan Espen
^ permalink raw reply [flat|nested] 7+ messages in thread
* RE: force reparse of file variables
2015-08-13 17:43 ` Dan Espen
@ 2015-08-13 18:23 ` Drew Adams
2015-08-14 12:54 ` Sam Halliday
1 sibling, 0 replies; 7+ messages in thread
From: Drew Adams @ 2015-08-13 18:23 UTC (permalink / raw)
To: Dan Espen, help-gnu-emacs
> > Is there a way to force (re)-load all the file variables in a buffer?
> >
> > I have a template (with yasnippet) that populates files of certain
> > types and derives some file variables (such as the 'compile-command),
> > but I need to save/open to load it.
>
> Do that lots of times. I save the file, then revert-buffer.
C-x C-v RET
IOW, `find-alternate-file' should do what you want, I think. It kills
the buffer and revisits the file.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: force reparse of file variables
2015-08-13 17:43 ` Dan Espen
2015-08-13 18:23 ` Drew Adams
@ 2015-08-14 12:54 ` Sam Halliday
2015-08-14 13:14 ` Michael Heerdegen
[not found] ` <mailman.8326.1439558135.904.help-gnu-emacs@gnu.org>
1 sibling, 2 replies; 7+ messages in thread
From: Sam Halliday @ 2015-08-14 12:54 UTC (permalink / raw)
To: help-gnu-emacs
On Thursday, 13 August 2015 18:43:37 UTC+1, Dan Espen wrote:
> Sam Halliday <sam.halliday@gmail.com> writes:
> > Is there a way to force (re)-load all the file variables in a buffer?
> >
> > I have a template (with yasnippet) that populates files of certain
> > types and derives some file variables (such as the 'compile-command),
> > but I need to save/open to load it.
>
> Do that lots of times.
> I save the file, then revert-buffer.
Thanks Dan. That works a charm. The one problem is that it means that in my workflow if I create a new buffer, that has a file template, then I always save the file instead of waiting for the user to decide when to save it. If there was a way to reload the File-Variables for an unsaved buffer, that'd be even better.
FYI, my templating is implemented here
https://github.com/fommil/dotfiles/blob/master/.emacs.d/init.el#L222
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: force reparse of file variables
2015-08-14 12:54 ` Sam Halliday
@ 2015-08-14 13:14 ` Michael Heerdegen
[not found] ` <mailman.8326.1439558135.904.help-gnu-emacs@gnu.org>
1 sibling, 0 replies; 7+ messages in thread
From: Michael Heerdegen @ 2015-08-14 13:14 UTC (permalink / raw)
To: help-gnu-emacs
Sam Halliday <sam.halliday@gmail.com> writes:
> If there was a way to reload the File-Variables for an unsaved buffer,
> that'd be even better.
I guess something like M-: (hack-local-variables) RET should work.
Michael.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: force reparse of file variables
[not found] ` <mailman.8326.1439558135.904.help-gnu-emacs@gnu.org>
@ 2015-08-14 13:41 ` Dan Espen
2015-08-14 15:23 ` Sam Halliday
1 sibling, 0 replies; 7+ messages in thread
From: Dan Espen @ 2015-08-14 13:41 UTC (permalink / raw)
To: help-gnu-emacs
Michael Heerdegen <michael_heerdegen@web.de> writes:
> Sam Halliday <sam.halliday@gmail.com> writes:
>
>> If there was a way to reload the File-Variables for an unsaved buffer,
>> that'd be even better.
>
> I guess something like M-: (hack-local-variables) RET should work.
It does.
Who knew?
--
Dan Espen
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: force reparse of file variables
[not found] ` <mailman.8326.1439558135.904.help-gnu-emacs@gnu.org>
2015-08-14 13:41 ` Dan Espen
@ 2015-08-14 15:23 ` Sam Halliday
1 sibling, 0 replies; 7+ messages in thread
From: Sam Halliday @ 2015-08-14 15:23 UTC (permalink / raw)
To: help-gnu-emacs
On Friday, 14 August 2015 14:15:38 UTC+1, Michael Heerdegen wrote:
> Sam Halliday <sam.halliday@gmail.com> writes:
>
> > If there was a way to reload the File-Variables for an unsaved buffer,
> > that'd be even better.
>
> I guess something like M-: (hack-local-variables) RET should work.
Fantastic! :-D
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2015-08-14 15:23 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-13 16:59 force reparse of file variables Sam Halliday
2015-08-13 17:43 ` Dan Espen
2015-08-13 18:23 ` Drew Adams
2015-08-14 12:54 ` Sam Halliday
2015-08-14 13:14 ` Michael Heerdegen
[not found] ` <mailman.8326.1439558135.904.help-gnu-emacs@gnu.org>
2015-08-14 13:41 ` Dan Espen
2015-08-14 15:23 ` Sam Halliday
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).