From 32763dac46e61cc34e8fe4d19df4905d09c1a27f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20Engdeg=C3=A5rd?= Date: Sat, 1 Feb 2020 18:07:32 +0100 Subject: Replace add-to-list to lexical variable with push (bug#39373) Since 'add-to-list', being a plain function, cannot access lexical variables, such use must be rewritten for correctness. (Some instances actually do work thanks to a compiler macro, but it's not something code should rely on.) * lisp/autoinsert.el (auto-insert-alist): * lisp/cedet/mode-local.el (mode-local-print-bindings): * lisp/net/tramp-cache.el (tramp-flush-connection-properties) (tramp-list-connections): * lisp/net/zeroconf.el (zeroconf-list-service-names) (zeroconf-list-service-types, zeroconf-list-services): * lisp/org/org.el (org-reload): * lisp/whitespace.el (whitespace-report-region): * test/lisp/emacs-lisp/map-tests.el (test-map-do): Replace add-to-list with push. --- test/lisp/emacs-lisp/map-tests.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/lisp/emacs-lisp/map-tests.el') diff --git a/test/lisp/emacs-lisp/map-tests.el b/test/lisp/emacs-lisp/map-tests.el index 06fd55faad3..c52bb83fa33 100644 --- a/test/lisp/emacs-lisp/map-tests.el +++ b/test/lisp/emacs-lisp/map-tests.el @@ -227,7 +227,7 @@ Evaluate BODY for each created map. (with-maps-do map (let ((result nil)) (map-do (lambda (k v) - (add-to-list 'result (list (int-to-string k) v))) + (push (list (int-to-string k) v) result)) map) (should (equal result '(("2" 5) ("1" 4) ("0" 3))))))) -- cgit v1.2.1