unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#20763: 24.3.1; eval-buffer ignores lexical-binding in file local variables list
@ 2015-06-07 17:26 Tim Perkins
  2015-06-07 18:02 ` Glenn Morris
  0 siblings, 1 reply; 3+ messages in thread
From: Tim Perkins @ 2015-06-07 17:26 UTC (permalink / raw)
  To: 20763

[-- Attachment #1: Type: text/plain, Size: 745 bytes --]

Doing a M-x eval-buffer on a file containing this:

(funcall
 (let ((a 0))
   (lambda ()
     a)))

;; Local Variables:
;; lexical-binding: t
;; End:

Will result in an error:

funcall: Symbol's value as variable is void: a

But a file containing this:

;; -*- lexical-binding: t -*-

(funcall
 (let ((a 0))
   (lambda ()
     a)))

Will work as expected. No problem.

I was expecting these these to be equivalent. I checked the manual,
"Specifying File Variables" and that seems to say that using either the
first line or variable list should have the same effect.

Seems related to #15070 and #20139.

(I'm not sure about the exact version of Emacs. It's probably old, I'm on
Ubuntu 14.04 at the moment. Dpkg reports 24.3+1-2ubuntu1.)

-- Tim

[-- Attachment #2: Type: text/html, Size: 980 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#20763: 24.3.1; eval-buffer ignores lexical-binding in file local variables list
  2015-06-07 17:26 bug#20763: 24.3.1; eval-buffer ignores lexical-binding in file local variables list Tim Perkins
@ 2015-06-07 18:02 ` Glenn Morris
  2015-06-08  0:56   ` Tim Perkins
  0 siblings, 1 reply; 3+ messages in thread
From: Glenn Morris @ 2015-06-07 18:02 UTC (permalink / raw)
  To: Tim Perkins; +Cc: 20763

Tim Perkins wrote:

> ;; Local Variables:
> ;; lexical-binding: t
> ;; End:
>
> Will result in an error:

C-h v lexical-binding

  Unlike other file local variables, this must be set in the first line of
  a file.





^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#20763: 24.3.1; eval-buffer ignores lexical-binding in file local variables list
  2015-06-07 18:02 ` Glenn Morris
@ 2015-06-08  0:56   ` Tim Perkins
  0 siblings, 0 replies; 3+ messages in thread
From: Tim Perkins @ 2015-06-08  0:56 UTC (permalink / raw)
  To: Glenn Morris; +Cc: 20763

[-- Attachment #1: Type: text/plain, Size: 348 bytes --]

On Sun, Jun 7, 2015 at 2:02 PM, Glenn Morris <rgm@gnu.org> wrote:

> Unlike other file local variables, this must be set in the first line of
>   a file.
>

Then please disregard this bug! My mistake, I think I might have skimmed
over that part.

(I'm still kind of wondering why lexical-binding is an oddball like this,
but anyway...)

Thank you.

[-- Attachment #2: Type: text/html, Size: 832 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-06-08  0:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-07 17:26 bug#20763: 24.3.1; eval-buffer ignores lexical-binding in file local variables list Tim Perkins
2015-06-07 18:02 ` Glenn Morris
2015-06-08  0:56   ` Tim Perkins

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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).