projects
/
chise
/
xemacs-chise.git-
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
(C3-2E56): Unify U-0002F96A; relate to M-27234.
[chise/xemacs-chise.git-]
/
lisp
/
alist.el
diff --git
a/lisp/alist.el
b/lisp/alist.el
index
4a1fd3a
..
05d1267
100644
(file)
--- a/
lisp/alist.el
+++ b/
lisp/alist.el
@@
-1,13
+1,11
@@
-;;; alist.el --- utility functions about assoc-list
+;;; alist.el --- utility functions about association-list
-;; Copyright (C) 1993,1994,1995,1996 Free Software Foundation, Inc.
+;; Copyright (C) 1993,1994,1995,1996,1998 Free Software Foundation, Inc.
;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
-;; Version:
-;; $Id: alist.el,v 0.0 1997/02/28 02:18:23 tmorioka Exp $
;; Keywords: alist
;; Keywords: alist
-;; This file is part of SEMI (SEMI is Emacs MIME Interfaces).
+;; This file is part of APEL (A Portable Emacs Library).
;; This program is free software; you can redistribute it and/or
;; modify it under the terms of the GNU General Public License as
;; This program is free software; you can redistribute it and/or
;; modify it under the terms of the GNU General Public License as
@@
-24,8
+22,20
@@
;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
;; Boston, MA 02111-1307, USA.
;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
;; Boston, MA 02111-1307, USA.
-;;; Code:
-
+
\f
+;;;###autoload
+(defun vassoc (key valist)
+ "Search VALIST for a vector whose first element is equal to KEY.
+See also `assoc'."
+ ;; by Stig@hackvan.com
+ (let (el)
+ (catch 'done
+ (while (setq el (pop valist))
+ (and (equal key (aref el 0))
+ (throw 'done el))))))
+
\f
+
+;;;###autoload
(defun put-alist (item value alist)
"Modify ALIST to set VALUE to ITEM.
If there is a pair whose car is ITEM, replace its cdr by VALUE.
(defun put-alist (item value alist)
"Modify ALIST to set VALUE to ITEM.
If there is a pair whose car is ITEM, replace its cdr by VALUE.
@@
-40,6
+50,7
@@
return new alist whose car is the new pair and cdr is ALIST.
(cons (cons item value) alist)
)))
(cons (cons item value) alist)
)))
+;;;###autoload
(defun del-alist (item alist)
"If there is a pair whose key is ITEM, delete it from ALIST.
\[tomo's ELIS emulating function]"
(defun del-alist (item alist)
"If there is a pair whose key is ITEM, delete it from ALIST.
\[tomo's ELIS emulating function]"
@@
-59,6
+70,7
@@
return new alist whose car is the new pair and cdr is ALIST.
)
alist))))
)
alist))))
+;;;###autoload
(defun set-alist (symbol item value)
"Modify a alist indicated by SYMBOL to set VALUE to ITEM."
(or (boundp symbol)
(defun set-alist (symbol item value)
"Modify a alist indicated by SYMBOL to set VALUE to ITEM."
(or (boundp symbol)
@@
-67,12
+79,14
@@
return new alist whose car is the new pair and cdr is ALIST.
(set symbol (put-alist item value (symbol-value symbol)))
)
(set symbol (put-alist item value (symbol-value symbol)))
)
+;;;###autoload
(defun remove-alist (symbol item)
"Remove ITEM from the alist indicated by SYMBOL."
(and (boundp symbol)
(set symbol (del-alist item (symbol-value symbol)))
))
(defun remove-alist (symbol item)
"Remove ITEM from the alist indicated by SYMBOL."
(and (boundp symbol)
(set symbol (del-alist item (symbol-value symbol)))
))
+;;;###autoload
(defun modify-alist (modifier default)
"Modify alist DEFAULT into alist MODIFIER."
(mapcar (function
(defun modify-alist (modifier default)
"Modify alist DEFAULT into alist MODIFIER."
(mapcar (function
@@
-82,6
+96,7
@@
return new alist whose car is the new pair and cdr is ALIST.
modifier)
default)
modifier)
default)
+;;;###autoload
(defun set-modified-alist (sym modifier)
"Modify a value of a symbol SYM into alist MODIFIER.
The symbol SYM should be alist. If it is not bound,
(defun set-modified-alist (sym modifier)
"Modify a value of a symbol SYM into alist MODIFIER.
The symbol SYM should be alist. If it is not bound,