Skip to main content
Share Your Experience: Take the 2024 Developer Survey

Questions tagged [lexical-binding]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
16 votes
3 answers

Defun inside let with lexical binding gives byte-compile warning "the function is not known to be defined"

I want to get the effect of a static variable by using defun inside of let with lexical binding to create a closure. However, when byte-compiling the file, I get a warning. Am I doing something wrong, ...
Rose Kunkel's user avatar
6 votes
1 answer

Global lexical-binding setting?

I've seen ;;; -*- lexical-binding: t; -*- at the top of a file and (setq lexical-binding t) as how to turn on lexical binding for elisp code, but is there a way to tell Emacs to simply always do ...
147pm's user avatar
  • 2,969
3 votes
3 answers

How to avoid use of `lexical-let`

I have a macro that intends to creates a closure: ; -*- lexical-binding: t -*- (defmacro repro () (let ((kmap-sym (gensym "kmap-"))) `(let ((,kmap-sym (make-sparse-keymap))) (define-key ,...
erjoalgo's user avatar
  • 873