X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=lisp%2Fcl-seq.el;h=c97378fbfabc49221ca6389a0f4eacc742f4c468;hb=8a6af0ef5f5992de401fdfec5cba3d04b0a3655d;hp=9f1b25607f372b05631ea71f76e7b56f27351068;hpb=6883ee56ec887c2c48abe5b06b5e66aa74031910;p=chise%2Fxemacs-chise.git.1 diff --git a/lisp/cl-seq.el b/lisp/cl-seq.el index 9f1b256..c97378f 100644 --- a/lisp/cl-seq.el +++ b/lisp/cl-seq.el @@ -65,6 +65,23 @@ ;;; this file independent from cl-macs. (defmacro cl-parsing-keywords (kwords other-keys &rest body) + "Helper macro for functions with keyword arguments. +This is a temporary solution, until keyword arguments are natively supported. +Declare your function ending with (... &rest cl-keys), then wrap the +function body in a call to `cl-parsing-keywords'. + +KWORDS is a list of keyword definitions. Each definition should be +either a keyword or a list (KEYWORD DEFAULT-VALUE). In the former case, +the default value is nil. The keywords are available in BODY as the name +of the keyword, minus its initial colon and prepended with `cl-'. + +OTHER-KEYS specifies other keywords that are accepted but ignored. It +is either the value 't' (ignore all other keys, equivalent to the +&allow-other-keys argument declaration in Common Lisp) or a list in the +same format as KWORDS. If keywords are given that are not in KWORDS +and not allowed by OTHER-KEYS, an error will normally be signalled; but +the caller can override this by specifying a non-nil value for the +keyword :allow-other-keys (which defaults to t)." (cons 'let* (cons (mapcar @@ -338,7 +355,7 @@ Also see: `remove*', `delete', `delete*'" (remove* cl-item cl-seq ':test 'equal)) (defun remq (cl-elt cl-list) - "Remove all occurances of ELT in LIST, comparing with `eq'. + "Remove all occurrences of ELT in LIST, comparing with `eq'. This is a non-destructive function; it makes a copy of LIST to avoid corrupting the original LIST. Also see: `delq', `delete', `delete*', `remove', `remove*'."