aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2011-02-26 16:09:03 -0500
committerStefan Monnier2011-02-26 16:09:03 -0500
commite573299d40e5825584ed9e8bd58f5a8c2deee6fd (patch)
tree7873803e4a6ef421af4de6b2707f8a14d3e4f2ae
parente5c96d21844dab1f1f484e9998cd1a337d1b5013 (diff)
downloademacs-e573299d40e5825584ed9e8bd58f5a8c2deee6fd.tar.gz
emacs-e573299d40e5825584ed9e8bd58f5a8c2deee6fd.zip
* lisp/emacs-lisp/assoc.el: Remove misleading `sort'.
(aput, adelete, amake): Replace `eval' -> `symbol-value'. Suggested by Michael Heerdegen <michael_heerdegen@web.de>. Fixes: debbugs:8126
-rw-r--r--lisp/ChangeLog6
-rw-r--r--lisp/emacs-lisp/assoc.el10
2 files changed, 11 insertions, 5 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index f5df9a26c37..8d4ccfbf652 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,9 @@
12011-02-26 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * emacs-lisp/assoc.el: Remove misleading `sort' (bug#8126).
4 (aput, adelete, amake): Replace `eval' -> `symbol-value'.
5 Suggested by Michael Heerdegen <michael_heerdegen@web.de>.
6
12011-02-25 Teodor Zlatanov <tzz@lifelogs.com> 72011-02-25 Teodor Zlatanov <tzz@lifelogs.com>
2 8
3 * password-cache.el (password-in-cache-p): Convenience function to 9 * password-cache.el (password-in-cache-p): Convenience function to
diff --git a/lisp/emacs-lisp/assoc.el b/lisp/emacs-lisp/assoc.el
index aa85916cc3f..31be851f2dd 100644
--- a/lisp/emacs-lisp/assoc.el
+++ b/lisp/emacs-lisp/assoc.el
@@ -1,4 +1,4 @@
1;;; assoc.el --- insert/delete/sort functions on association lists 1;;; assoc.el --- insert/delete functions on association lists
2 2
3;; Copyright (C) 1996, 2001-2011 Free Software Foundation, Inc. 3;; Copyright (C) 1996, 2001-2011 Free Software Foundation, Inc.
4 4
@@ -35,7 +35,7 @@ head is one matching KEY. Returns the sorted list and doesn't affect
35the order of any other key-value pair. Side effect sets alist to new 35the order of any other key-value pair. Side effect sets alist to new
36sorted list." 36sorted list."
37 (set alist-symbol 37 (set alist-symbol
38 (sort (copy-alist (eval alist-symbol)) 38 (sort (copy-alist (symbol-value alist-symbol))
39 (function (lambda (a b) (equal (car a) key)))))) 39 (function (lambda (a b) (equal (car a) key))))))
40 40
41 41
@@ -75,7 +75,7 @@ of the alist (with value nil if VALUE is nil or not supplied)."
75 (lexical-let ((elem (aelement key value)) 75 (lexical-let ((elem (aelement key value))
76 alist) 76 alist)
77 (asort alist-symbol key) 77 (asort alist-symbol key)
78 (setq alist (eval alist-symbol)) 78 (setq alist (symbol-value alist-symbol))
79 (cond ((null alist) (set alist-symbol elem)) 79 (cond ((null alist) (set alist-symbol elem))
80 ((anot-head-p alist key) (set alist-symbol (nconc elem alist))) 80 ((anot-head-p alist key) (set alist-symbol (nconc elem alist)))
81 (value (setcar alist (car elem))) 81 (value (setcar alist (car elem)))
@@ -87,7 +87,7 @@ of the alist (with value nil if VALUE is nil or not supplied)."
87Alist is referenced by ALIST-SYMBOL and the key-value pair to remove 87Alist is referenced by ALIST-SYMBOL and the key-value pair to remove
88is pair matching KEY. Returns the altered alist." 88is pair matching KEY. Returns the altered alist."
89 (asort alist-symbol key) 89 (asort alist-symbol key)
90 (lexical-let ((alist (eval alist-symbol))) 90 (lexical-let ((alist (symbol-value alist-symbol)))
91 (cond ((null alist) nil) 91 (cond ((null alist) nil)
92 ((anot-head-p alist key) alist) 92 ((anot-head-p alist key) alist)
93 (t (set alist-symbol (cdr alist)))))) 93 (t (set alist-symbol (cdr alist))))))
@@ -133,7 +133,7 @@ extra values are ignored. Returns the created alist."
133 (t 133 (t
134 (amake alist-symbol keycdr valcdr) 134 (amake alist-symbol keycdr valcdr)
135 (aput alist-symbol keycar valcar)))) 135 (aput alist-symbol keycar valcar))))
136 (eval alist-symbol)) 136 (symbol-value alist-symbol))
137 137
138(provide 'assoc) 138(provide 'assoc)
139 139