Mercurial > hg > xemacs-beta
comparison lisp/cl-extra.el @ 440:8de8e3f6228a r21-2-28
Import from CVS: tag r21-2-28
author | cvs |
---|---|
date | Mon, 13 Aug 2007 11:33:38 +0200 |
parents | 3ecd8885ac67 |
children | abe6d1db359e |
comparison
equal
deleted
inserted
replaced
439:357dd071b03c | 440:8de8e3f6228a |
---|---|
637 ;;; Property lists. | 637 ;;; Property lists. |
638 | 638 |
639 ;; XEmacs: our `get' groks DEFAULT. | 639 ;; XEmacs: our `get' groks DEFAULT. |
640 (defalias 'get* 'get) | 640 (defalias 'get* 'get) |
641 | 641 |
642 (defun getf (plist tag &optional def) | 642 (defun getf (plist property &optional default) |
643 "Search PROPLIST for property PROPNAME; return its value or DEFAULT. | 643 "Search PLIST for property PROPERTY; return its value or DEFAULT. |
644 PROPLIST is a list of the sort returned by `symbol-plist'." | 644 PLIST is a list of the sort returned by `symbol-plist'." |
645 (setplist '--cl-getf-symbol-- plist) | 645 (setplist '--cl-getf-symbol-- plist) |
646 (or (get '--cl-getf-symbol-- tag) | 646 (get '--cl-getf-symbol-- property default)) |
647 (and def (get* '--cl-getf-symbol-- tag def)))) | |
648 | 647 |
649 (defun cl-set-getf (plist tag val) | 648 (defun cl-set-getf (plist tag val) |
650 (let ((p plist)) | 649 (let ((p plist)) |
651 (while (and p (not (eq (car p) tag))) (setq p (cdr (cdr p)))) | 650 (while (and p (not (eq (car p) tag))) (setq p (cdr (cdr p)))) |
652 (if p (progn (setcar (cdr p) val) plist) (list* tag val plist)))) | 651 (if p (progn (setcar (cdr p) val) plist) (list* tag val plist)))) |