* Force Reread of "local variables:"
@ 2004-02-01 5:01 Tennis Smith
2004-02-01 5:50 ` Eli Zaretskii
` (2 more replies)
0 siblings, 3 replies; 11+ messages in thread
From: Tennis Smith @ 2004-02-01 5:01 UTC (permalink / raw)
Hi,
Anyone have code that will force a re-read of a "local variables:"
sections in a file?
I have several files with this sort of data appended at the bottom:
# -----------------------------------------------------------------------------
# ;;; Local Variables: ***
# ;;; mode: tcl ***
# ;;; project: SUMCHK ***
# ;;; End: ***
If I change the "project" var in the file, is there a way to have
emacs reread this?
TIA,
-Tennis
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Force Reread of "local variables:"
2004-02-01 5:01 Force Reread of "local variables:" Tennis Smith
@ 2004-02-01 5:50 ` Eli Zaretskii
2004-02-02 13:23 ` Oliver Scholz
2004-02-02 15:06 ` Joakim Hove
2 siblings, 0 replies; 11+ messages in thread
From: Eli Zaretskii @ 2004-02-01 5:50 UTC (permalink / raw)
> From: tennis_smith@yahoo.com (Tennis Smith)
> Newsgroups: gnu.emacs.help
> Date: 31 Jan 2004 21:01:42 -0800
>
> Anyone have code that will force a re-read of a "local variables:"
> sections in a file?
Try this:
"M-: (hack-local-variables) RET"
You need to type that with the file's buffer being the current
selected buffer.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Force Reread of "local variables:"
2004-02-01 5:01 Force Reread of "local variables:" Tennis Smith
2004-02-01 5:50 ` Eli Zaretskii
@ 2004-02-02 13:23 ` Oliver Scholz
2004-02-02 23:08 ` Kevin Rodgers
2004-02-02 15:06 ` Joakim Hove
2 siblings, 1 reply; 11+ messages in thread
From: Oliver Scholz @ 2004-02-02 13:23 UTC (permalink / raw)
tennis_smith@yahoo.com (Tennis Smith) writes:
> Anyone have code that will force a re-read of a "local variables:"
> sections in a file?
>
> I have several files with this sort of data appended at the bottom:
>
> # -----------------------------------------------------------------------------
> # ;;; Local Variables: ***
> # ;;; mode: tcl ***
> # ;;; project: SUMCHK ***
> # ;;; End: ***
>
> If I change the "project" var in the file, is there a way to have
> emacs reread this?
If your auto-mode detection is set up correctly and if you don't have
important buffer-local variables other than those in the “Local
Variables” section, you can just do M-x normal-mode RET.
I mention these two “ifs” above, because as far as buffer variables
are concerned this has basically the same effect as killing the buffer
and re-visiting it.
Btw, you probably know this, but if ‘#’ is the comment character of
your language, you can just write:
# Local Variables:
# mode: tcl
# project: SUMCHK
# End:
Oliver
--
14 Pluviôse an 212 de la Révolution
Liberté, Egalité, Fraternité!
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Force Reread of "local variables:"
2004-02-02 13:23 ` Oliver Scholz
@ 2004-02-02 23:08 ` Kevin Rodgers
2004-02-03 4:29 ` Oliver Scholz
2004-02-03 10:37 ` Reiner Steib
0 siblings, 2 replies; 11+ messages in thread
From: Kevin Rodgers @ 2004-02-02 23:08 UTC (permalink / raw)
Oliver Scholz wrote:
> If your auto-mode detection is set up correctly and if you don't have
> important buffer-local variables other than those in the “Local
> Variables” section, you can just do M-x normal-mode RET.
>
> I mention these two “ifs” above, because as far as buffer variables
> are concerned this has basically the same effect as killing the buffer
> and re-visiting it.
So why not just type `C-x C-v RET'?
--
Kevin Rodgers
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Force Reread of "local variables:"
2004-02-02 23:08 ` Kevin Rodgers
@ 2004-02-03 4:29 ` Oliver Scholz
2004-02-03 17:57 ` Kevin Rodgers
2004-02-03 10:37 ` Reiner Steib
1 sibling, 1 reply; 11+ messages in thread
From: Oliver Scholz @ 2004-02-03 4:29 UTC (permalink / raw)
Kevin Rodgers <ihs_4664@yahoo.com> writes:
> Oliver Scholz wrote:
>
>> If your auto-mode detection is set up correctly and if you don't have
>> important buffer-local variables other than those in the “Local
>> Variables” section, you can just do M-x normal-mode RET.
>> I mention these two “ifs” above, because as far as buffer variables
>> are concerned this has basically the same effect as killing the buffer
>> and re-visiting it.
>
> So why not just type `C-x C-v RET'?
[...]
Without `saveplace' you probably suddenly look at a different place in
the file after doing `C-x C-v RET'. Also you loose the information
about the file encoding, for example if you visited the file with
`C-x RET c some-fancy-coding-system RET C-x C-f'
Oliver
--
15 Pluviôse an 212 de la Révolution
Liberté, Egalité, Fraternité!
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Force Reread of "local variables:"
2004-02-03 4:29 ` Oliver Scholz
@ 2004-02-03 17:57 ` Kevin Rodgers
0 siblings, 0 replies; 11+ messages in thread
From: Kevin Rodgers @ 2004-02-03 17:57 UTC (permalink / raw)
Oliver Scholz wrote:
> Kevin Rodgers <ihs_4664@yahoo.com> writes:
>>So why not just type `C-x C-v RET'?
> Without `saveplace' you probably suddenly look at a different place in
> the file after doing `C-x C-v RET'.
Good point, also made by Reiner in his reply. But `M-x revert-buffer
RET yes RET' handles that, although it's a lot of typing unless you
define a keyboard macro for it.
> Also you loose the information
> about the file encoding, for example if you visited the file with
> `C-x RET c some-fancy-coding-system RET C-x C-f'
Ouch, that's a tricky one. If `C-x RET c some-fancy-coding system RET
M-x revert-buffer RET' works, you'd just have to automatically save
"some-fancy-coding-system" to make it easy to insert into the minibuffer
-- maybe in a register?
--
Kevin Rodgers
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Force Reread of "local variables:"
2004-02-02 23:08 ` Kevin Rodgers
2004-02-03 4:29 ` Oliver Scholz
@ 2004-02-03 10:37 ` Reiner Steib
1 sibling, 0 replies; 11+ messages in thread
From: Reiner Steib @ 2004-02-03 10:37 UTC (permalink / raw)
On Tue, Feb 03 2004, Kevin Rodgers wrote:
> Oliver Scholz wrote:
>
>> [...] M-x normal-mode RET [...]
>
> So why not just type `C-x C-v RET'?
The latter doesn't preserve point and mark.
Bye, Reiner.
--
,,,
(o o)
---ooO-(_)-Ooo--- PGP key available via WWW http://rsteib.home.pages.de/
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Force Reread of "local variables:"
2004-02-01 5:01 Force Reread of "local variables:" Tennis Smith
2004-02-01 5:50 ` Eli Zaretskii
2004-02-02 13:23 ` Oliver Scholz
@ 2004-02-02 15:06 ` Joakim Hove
2004-02-03 0:18 ` Tennis Smith
2 siblings, 1 reply; 11+ messages in thread
From: Joakim Hove @ 2004-02-02 15:06 UTC (permalink / raw)
[-- Attachment #1: Type: text/plain, Size: 194 bytes --]
Hello,
> Anyone have code that will force a re-read of a "local variables:"
> sections in a file?
I have attatched some code I use (and find quite useful) for
manipulating buffer-variables:
[-- Attachment #2: buffer-variables.el --]
[-- Type: application/emacs-lisp, Size: 5247 bytes --]
[-- Attachment #3: my-buffer-variables.el --]
[-- Type: application/emacs-lisp, Size: 1132 bytes --]
[-- Attachment #4: Type: text/plain, Size: 496 bytes --]
Please ask if you have questions.
HTH - Joakim
--
/--------------------------------------------------------------------\
/ Joakim Hove / hove@bccs.no / (55 5) 84076 | \
| Unifob AS, Avdeling for Beregningsvitenskap (BCCS) | Stabburveien 18 |
| CMU | 5231 Paradis |
\ Thormøhlensgt.55, 5020 Bergen. | 55 91 28 18 /
\--------------------------------------------------------------------/
[-- Attachment #5: Type: text/plain, Size: 151 bytes --]
_______________________________________________
Help-gnu-emacs mailing list
Help-gnu-emacs@gnu.org
http://mail.gnu.org/mailman/listinfo/help-gnu-emacs
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Force Reread of "local variables:"
2004-02-02 15:06 ` Joakim Hove
@ 2004-02-03 0:18 ` Tennis Smith
2004-02-03 9:14 ` Joakim Hove
0 siblings, 1 reply; 11+ messages in thread
From: Tennis Smith @ 2004-02-03 0:18 UTC (permalink / raw)
Eh? :)
All I got was this:
Joakim Hove <hove@bccs.no> wrote in message news:<4yoeshh65x.fsf@skjellgran.ii.uib.no>...
> Please ask if you have questions.
>
> HTH - Joakim
>
> --
> /--------------------------------------------------------------------\
> / Joakim Hove / hove@bccs.no / (55 5) 84076 | \
> | Unifob AS, Avdeling for Beregningsvitenskap (BCCS) | Stabburveien 18 |
> | CMU | 5231 Paradis |
> \ Thormøhlensgt.55, 5020 Bergen. | 55 91 28 18 /
> \--------------------------------------------------------------------/
>
> --
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Force Reread of "local variables:"
2004-02-03 0:18 ` Tennis Smith
@ 2004-02-03 9:14 ` Joakim Hove
2004-02-03 19:11 ` Reiner Steib
0 siblings, 1 reply; 11+ messages in thread
From: Joakim Hove @ 2004-02-03 9:14 UTC (permalink / raw)
tennis_smith@yahoo.com (Tennis Smith) writes:
> Eh? :)
>
> All I got was this:
>
> Joakim Hove <hove@bccs.no> wrote in message news:<4yoeshh65x.fsf@skjellgran.ii.uib.no>...
>> Please ask if you have questions.
That was weird - I can read my own news-posting alright. Anyway, I
had included two small lisp files which implement functionality which
I use quite a lot to manipulate buffer-variables.
I then tried mailing to: tennis_smith@yahoo.com, but this mail
bounced due to an exceeded quota at yahoo. If you provide me with
another e-mail adress I can mail it to you.
Joakim
--
/--------------------------------------------------------------------\
/ Joakim Hove / hove@bccs.no / (55 5) 84076 | \
| Unifob AS, Avdeling for Beregningsvitenskap (BCCS) | Stabburveien 18 |
| CMU | 5231 Paradis |
\ Thormøhlensgt.55, 5020 Bergen. | 55 91 28 18 /
\--------------------------------------------------------------------/
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Force Reread of "local variables:"
2004-02-03 9:14 ` Joakim Hove
@ 2004-02-03 19:11 ` Reiner Steib
0 siblings, 0 replies; 11+ messages in thread
From: Reiner Steib @ 2004-02-03 19:11 UTC (permalink / raw)
On Tue, Feb 03 2004, Joakim Hove wrote:
> tennis_smith@yahoo.com (Tennis Smith) writes:
[...]
>> All I got was this:
>>
>> Joakim Hove <hove@bccs.no> wrote in message news:<4yoeshh65x.fsf@skjellgran.ii.uib.no>...
>>> Please ask if you have questions.
>
> That was weird [...]
Not really. Tennis read news via the Goggle interface and Google
doesn't archive attachments.
For some reason Google only archives the last part, "<4 text>" in your
article:
,----[ `C-d' on <news:4yoeshh65x.fsf@skjellgran.ii.uib.no> ]
| Joakim Hove <* mixed> Re: Force Reread of "local variables:"
| Joakim Hove <4 text>
| Joakim Hove <3 emacs-lisp>
| Joakim Hove <2 emacs-lisp>
| Joakim Hove <1 text>
`----
You could include lisp code inline and Tennis should get a real
newsreader instead of using Google, preferably Gnus of course. :-)
Bye, Reiner.
--
,,,
(o o)
---ooO-(_)-Ooo--- PGP key available via WWW http://rsteib.home.pages.de/
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2004-02-03 19:11 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-02-01 5:01 Force Reread of "local variables:" Tennis Smith
2004-02-01 5:50 ` Eli Zaretskii
2004-02-02 13:23 ` Oliver Scholz
2004-02-02 23:08 ` Kevin Rodgers
2004-02-03 4:29 ` Oliver Scholz
2004-02-03 17:57 ` Kevin Rodgers
2004-02-03 10:37 ` Reiner Steib
2004-02-02 15:06 ` Joakim Hove
2004-02-03 0:18 ` Tennis Smith
2004-02-03 9:14 ` Joakim Hove
2004-02-03 19:11 ` Reiner Steib
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).