summaryrefslogtreecommitdiff
path: root/lisp/cedet/mode-local.el
diff options
context:
space:
mode:
authorMattias EngdegÄrd <mattiase@acm.org>2020-02-01 18:07:32 +0100
committerMattias EngdegÄrd <mattiase@acm.org>2020-02-01 22:27:23 +0100
commit32763dac46e61cc34e8fe4d19df4905d09c1a27f (patch)
treee7f831860af5d3a412dc3dcfbdb958fa23cbd5b3 /lisp/cedet/mode-local.el
parentd07f177382b24945e1f579744702908b33605c3e (diff)
downloademacs-32763dac46e61cc34e8fe4d19df4905d09c1a27f.tar.gz
emacs-32763dac46e61cc34e8fe4d19df4905d09c1a27f.tar.bz2
emacs-32763dac46e61cc34e8fe4d19df4905d09c1a27f.zip
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.
Diffstat (limited to 'lisp/cedet/mode-local.el')
-rw-r--r--lisp/cedet/mode-local.el14
1 files changed, 6 insertions, 8 deletions
diff --git a/lisp/cedet/mode-local.el b/lisp/cedet/mode-local.el
index a6e143cfcd6..a1aea30c20d 100644
--- a/lisp/cedet/mode-local.el
+++ b/lisp/cedet/mode-local.el
@@ -819,14 +819,12 @@ META-NAME is a cons (OVERLOADABLE-SYMBOL . MAJOR-MODE)."
)
;; Order symbols by type
(mapatoms
- #'(lambda (s)
- (add-to-list (cond
- ((get s 'mode-variable-flag)
- (if (get s 'constant-flag) 'mc 'mv))
- ((get s 'override-flag)
- (if (get s 'constant-flag) 'fo 'ov))
- ('us))
- s))
+ (lambda (s) (push s (cond
+ ((get s 'mode-variable-flag)
+ (if (get s 'constant-flag) mc mv))
+ ((get s 'override-flag)
+ (if (get s 'constant-flag) fo ov))
+ (t us))))
table)
;; Print symbols by type
(when us