emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r99402: * emacs-lisp/assoc.el (aput,


From: Chong Yidong
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r99402: * emacs-lisp/assoc.el (aput, adelete, amake): Use lexical-let (Bug#5450).
Date: Sat, 23 Jan 2010 17:44:03 -0500
User-agent: Bazaar (2.0.2)

------------------------------------------------------------
revno: 99402
committer: Chong Yidong <address@hidden>
branch nick: trunk
timestamp: Sat 2010-01-23 17:44:03 -0500
message:
  * emacs-lisp/assoc.el (aput, adelete, amake): Use lexical-let (Bug#5450).
modified:
  lisp/ChangeLog
  lisp/emacs-lisp/assoc.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2010-01-23 12:42:22 +0000
+++ b/lisp/ChangeLog    2010-01-23 22:44:03 +0000
@@ -1,3 +1,7 @@
+2010-01-23  Chong Yidong  <address@hidden>
+
+       * emacs-lisp/assoc.el (aput, adelete, amake): Use lexical-let 
(Bug#5450).
+
 2010-01-23  Stephen Leake  <address@hidden>
 
         * progmodes/ada-mode.el (ada-in-paramlist-p): Pragma syntax

=== modified file 'lisp/emacs-lisp/assoc.el'
--- a/lisp/emacs-lisp/assoc.el  2010-01-13 08:35:10 +0000
+++ b/lisp/emacs-lisp/assoc.el  2010-01-23 22:44:03 +0000
@@ -27,6 +27,7 @@
 ;; fetching off key-value pairs in association lists.
 
 ;;; Code:
+(eval-when-compile (require 'cl))
 
 (defun asort (alist-symbol key)
   "Move a specified key-value pair to the head of an alist.
@@ -71,8 +72,8 @@
 modified, but will be moved to the head of the alist.  If the key-value
 pair cannot be found in the alist, it will be inserted into the head
 of the alist (with value nil if VALUE is nil or not supplied)."
-  (let ((elem (aelement key value))
-       alist)
+  (lexical-let ((elem (aelement key value))
+               alist)
     (asort alist-symbol key)
     (setq alist (eval alist-symbol))
     (cond ((null alist) (set alist-symbol elem))
@@ -86,7 +87,7 @@
 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)
-  (let ((alist (eval alist-symbol)))
+  (lexical-let ((alist (eval alist-symbol)))
     (cond ((null alist) nil)
          ((anot-head-p alist key) alist)
          (t (set alist-symbol (cdr alist))))))
@@ -123,10 +124,10 @@
 this isn't enforced.  If VALUELIST is smaller than KEYLIST, remaining
 keys are associated with nil.  If VALUELIST is larger than KEYLIST,
 extra values are ignored.  Returns the created alist."
-  (let ((keycar (car keylist))
-       (keycdr (cdr keylist))
-       (valcar (car valuelist))
-       (valcdr (cdr valuelist)))
+  (lexical-let ((keycar (car keylist))
+               (keycdr (cdr keylist))
+               (valcar (car valuelist))
+               (valcdr (cdr valuelist)))
     (cond ((null keycdr)
           (aput alist-symbol keycar valcar))
          (t


reply via email to

[Prev in Thread] Current Thread [Next in Thread]