From: Lars Ingebrigtsen Date: Sun, 20 Sep 2020 19:30:54 +0000 (+0200) Subject: Make (let ((:key 'foo)) :key) signal an error in lexical elisp, too X-Git-Tag: emacs-28.0.90~5980 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=dc2168ebf25b15a4bc960e17f65ce5117cc77467;p=emacs.git Make (let ((:key 'foo)) :key) signal an error in lexical elisp, too * src/lread.c (intern_sym): Mark keywords as special (bug#38872). --- diff --git a/src/lread.c b/src/lread.c index 8064bf4d0eb..4b788e99407 100644 --- a/src/lread.c +++ b/src/lread.c @@ -4104,6 +4104,9 @@ intern_sym (Lisp_Object sym, Lisp_Object obarray, Lisp_Object index) { make_symbol_constant (sym); XSYMBOL (sym)->u.s.redirect = SYMBOL_PLAINVAL; + /* Mark keywords as special. This makes (let ((:key 'foo)) ...) + in lexically bound elisp signal an error, as documented. */ + XSYMBOL (sym)->u.s.declared_special = true; SET_SYMBOL_VAL (XSYMBOL (sym), sym); }