commit 82a5e4dc889ecbfa35374616fe9c5edfa23f4504 (HEAD, refs/remotes/origin/master) Author: Noam Postavsky Date: Sat Jan 14 01:47:52 2017 -0500 Fix free var FOO-mode-{syntax,abbrev}-table warnings * lisp/emacs-lisp/derived.el (define-derived-mode): Unconditionally defvar the syntax and abbrev tables so that the compiler will know that they are dynamically bound variables (Bug#25446). diff --git a/lisp/emacs-lisp/derived.el b/lisp/emacs-lisp/derived.el index 762c762457..fffe972460 100644 --- a/lisp/emacs-lisp/derived.el +++ b/lisp/emacs-lisp/derived.el @@ -216,6 +216,7 @@ No problems result if this variable is not bound. (purecopy ,(format "Keymap for `%s'." child)))) ,(if declare-syntax `(progn + (defvar ,syntax) (unless (boundp ',syntax) (put ',syntax 'definition-name ',child) (defvar ,syntax (make-syntax-table))) @@ -224,6 +225,7 @@ No problems result if this variable is not bound. (purecopy ,(format "Syntax table for `%s'." child)))))) ,(if declare-abbrev `(progn + (defvar ,abbrev) (unless (boundp ',abbrev) (put ',abbrev 'definition-name ',child) (defvar ,abbrev commit 9c4e3097b595c739bb29261759b9ba631431329e Author: Philipp Stephani Date: Wed Jan 18 19:49:58 2017 +0100 Check that variable lists are actually lists 'let' and 'let*' document that their first argument has to be a list, but don't check for that; instead, they allow (and silently ignore) other types. Introduce an explicit type check. * src/eval.c (Flet, FletX): Check that the variable list is indeed a list. * test/src/eval-tests.el: Add unit tests. diff --git a/src/eval.c b/src/eval.c index 1f8d409932..c05c8d8f8d 100644 --- a/src/eval.c +++ b/src/eval.c @@ -857,6 +857,7 @@ usage: (let* VARLIST BODY...) */) lexenv = Vinternal_interpreter_environment; varlist = XCAR (args); + CHECK_LIST (varlist); while (CONSP (varlist)) { QUIT; @@ -917,6 +918,7 @@ usage: (let VARLIST BODY...) */) USE_SAFE_ALLOCA; varlist = XCAR (args); + CHECK_LIST (varlist); /* Make space to hold the values to give the bound variables. */ elt = Flength (varlist); diff --git a/test/src/eval-tests.el b/test/src/eval-tests.el index a1fe8ccd7d..95655eac82 100644 --- a/test/src/eval-tests.el +++ b/test/src/eval-tests.el @@ -47,4 +47,14 @@ Bug#24912 and Bug#24913." (let ((byte-compile-debug t)) (should-error (eval `(byte-compile (lambda ,args)) t))))) + +(dolist (form '(let let*)) + (dolist (arg '(1 "a" [a])) + (eval + `(ert-deftest ,(intern (format "eval-tests--%s--%s" form (type-of arg))) () + ,(format "Check that the first argument of `%s' cannot be a %s" + form (type-of arg)) + (should-error (,form ,arg) :type 'wrong-type-argument)) + t))) + ;;; eval-tests.el ends here