* lisp/emacs-lisp/assoc.el: Remove misleading `sort'.
authorStefan Monnier <monnier@iro.umontreal.ca>
Sat, 26 Feb 2011 21:09:03 +0000 (16:09 -0500)
committerStefan Monnier <monnier@iro.umontreal.ca>
Sat, 26 Feb 2011 21:09:03 +0000 (16:09 -0500)
(aput, adelete, amake): Replace `eval' -> `symbol-value'.
Suggested by Michael Heerdegen <michael_heerdegen@web.de>.

Fixes: debbugs:8126

lisp/ChangeLog
lisp/emacs-lisp/assoc.el

index f5df9a2..8d4ccfb 100644 (file)
@@ -1,3 +1,9 @@
+2011-02-26  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * emacs-lisp/assoc.el: Remove misleading `sort' (bug#8126).
+       (aput, adelete, amake): Replace `eval' -> `symbol-value'.
+       Suggested by Michael Heerdegen <michael_heerdegen@web.de>.
+
 2011-02-25  Teodor Zlatanov  <tzz@lifelogs.com>
 
        * password-cache.el (password-in-cache-p): Convenience function to
index aa85916..31be851 100644 (file)
@@ -1,4 +1,4 @@
-;;; assoc.el --- insert/delete/sort functions on association lists
+;;; assoc.el --- insert/delete functions on association lists
 
 ;; Copyright (C) 1996, 2001-2011  Free Software Foundation, Inc.
 
@@ -35,7 +35,7 @@ head is one matching KEY.  Returns the sorted list and doesn't affect
 the order of any other key-value pair.  Side effect sets alist to new
 sorted list."
   (set alist-symbol
-       (sort (copy-alist (eval alist-symbol))
+       (sort (copy-alist (symbol-value alist-symbol))
             (function (lambda (a b) (equal (car a) key))))))
 
 
@@ -75,7 +75,7 @@ of the alist (with value nil if VALUE is nil or not supplied)."
   (lexical-let ((elem (aelement key value))
                alist)
     (asort alist-symbol key)
-    (setq alist (eval alist-symbol))
+    (setq alist (symbol-value alist-symbol))
     (cond ((null alist) (set alist-symbol elem))
          ((anot-head-p alist key) (set alist-symbol (nconc elem alist)))
          (value (setcar alist (car elem)))
@@ -87,7 +87,7 @@ of the alist (with value nil if VALUE is nil or not supplied)."
 Alist is referenced by ALIST-SYMBOL and the key-value pair to remove
 is pair matching KEY.  Returns the altered alist."
   (asort alist-symbol key)
-  (lexical-let ((alist (eval alist-symbol)))
+  (lexical-let ((alist (symbol-value alist-symbol)))
     (cond ((null alist) nil)
          ((anot-head-p alist key) alist)
          (t (set alist-symbol (cdr alist))))))
@@ -133,7 +133,7 @@ extra values are ignored.  Returns the created alist."
          (t
           (amake alist-symbol keycdr valcdr)
           (aput alist-symbol keycar valcar))))
-  (eval alist-symbol))
+  (symbol-value alist-symbol))
 
 (provide 'assoc)