Subject: bug#23460: 25.1.50; Strange behavior in local variables like start-comment

From: Michael Heerdegen <[email-masked]>
Date: Fri, 06 May 2016 00:29:04 +0200

Kaushal Modi <[email-masked]> writes:

> (1) Evaluate the above in emacs -Q
> (2) You would be in *scratch* buffer and that's alright
> (3) Hit F5 couple of times and you should see
> ‘comment-start’ is undefined, it’s value is: ‘nil’
> (4) Now hit F6 (which just prints the value of comment-start variable) and you will see
> ‘comment-start’ = ‘;’
> (5) Isn't that strange?!

Strange, but, unless I misunderstood what your described, expected:

Reverting is a typical case where all local variable definitions are
cleared (intentionally): Unless arg PRESERVE-MODES is non-nil, this
calls `after-find-file' which calls `normal-mode' that (re)sets the
major mode of the buffer.  Changing the major mode typically always
kills all buffer local bindings.

So to say, it's a feature: `revert-buffer' also reverts local variable
bindings.

Michael.