;;; assoc.el --- insert/delete functions on association lists -*- lexical-binding: t -*-
-;; Copyright (C) 1996, 2001-2012 Free Software Foundation, Inc.
+;; Copyright (C) 1996, 2001-2015 Free Software Foundation, Inc.
;; Author: Barry A. Warsaw <bwarsaw@cen.com>
;; Keywords: extensions
-;; Obsolete-since: 24.2
+;; Obsolete-since: 24.3
;; This file is part of GNU Emacs.
If no key-value pair matching KEY could be found in ALIST, or ALIST is
nil then nil is returned. ALIST is not altered."
- (defvar copy)
- (let ((copy (copy-alist alist)))
+ (defvar assoc--copy)
+ (let ((assoc--copy (copy-alist alist)))
(cond ((null alist) nil)
- ((progn (asort 'copy key)
- (anot-head-p copy key)) nil)
- ((cdr (car copy)))
+ ((progn (asort 'assoc--copy key) ; dynamic binding
+ (anot-head-p assoc--copy key)) nil)
+ ((cdr (car assoc--copy)))
(keynil-p nil)
- ((car (car copy)))
+ ((car (car assoc--copy)))
(t nil))))