X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=alist.el;h=fbd409addf5d053d54d04d3a154d53abed933455;hb=aa798d204a904b8054634b37c9bcc6e9a7298fd5;hp=288f412ea1391b6ddc35310e4fc651f43aadaa2f;hpb=116d684bcd5054207e89a95cd5d9b5e67faa8e73;p=elisp%2Fapel.git diff --git a/alist.el b/alist.el index 288f412..fbd409a 100644 --- a/alist.el +++ b/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 -;; Version: -;; $Id: alist.el,v 0.0 1997-02-28 02:18:23 tmorioka Exp $ ;; 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 @@ -26,6 +24,7 @@ ;;; Code: +;;;###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. @@ -40,6 +39,7 @@ return new alist whose car is the new pair and cdr is 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]" @@ -59,6 +59,7 @@ return new alist whose car is the new pair and cdr is ALIST. ) alist)))) +;;;###autoload (defun set-alist (symbol item value) "Modify a alist indicated by SYMBOL to set VALUE to ITEM." (or (boundp symbol) @@ -67,12 +68,14 @@ return new alist whose car is the new pair and cdr is ALIST. (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))) )) +;;;###autoload (defun modify-alist (modifier default) "Modify alist DEFAULT into alist MODIFIER." (mapcar (function @@ -82,6 +85,7 @@ return new alist whose car is the new pair and cdr is ALIST. 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,