projects
/
elisp
/
apel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
APEL: Version 10.5 release.
[elisp/apel.git]
/
alist.el
diff --git
a/alist.el
b/alist.el
index
4b656de
..
37522a5
100644
(file)
--- a/
alist.el
+++ b/
alist.el
@@
-40,19
+40,10
@@
return a new alist whose car is the new pair and cdr is ALIST."
(defun del-alist (key alist)
"Delete an element whose car equals KEY from ALIST.
Return the modified ALIST."
(defun del-alist (key alist)
"Delete an element whose car equals KEY from ALIST.
Return the modified ALIST."
- (if (equal key (car (car alist)))
- (cdr alist)
- (let ((pr alist)
- (r (cdr alist)))
- (catch 'tag
- (while (not (null r))
- (if (equal key (car (car r)))
- (progn
- (rplacd pr (cdr r))
- (throw 'tag alist)))
- (setq pr r)
- (setq r (cdr r)))
- alist))))
+ (let ((pair (assoc key alist)))
+ (if pair
+ (delq pair alist)
+ alist)))
;;;###autoload
(defun set-alist (symbol key value)
;;;###autoload
(defun set-alist (symbol key value)