Function: cl--parsing-keywords

cl--parsing-keywords is a macro defined in cl-seq.el.gz.

Signature

(cl--parsing-keywords KEYWORDS OTHER-KEYS &rest BODY)

Source Code

;; Defined in /usr/src/emacs/lisp/emacs-lisp/cl-seq.el.gz
;; Keyword parsing.
;; This is special-cased here so that we can compile
;; this file independent from cl-macs.

(defmacro cl--parsing-keywords (keywords other-keys &rest body)
  (declare (indent 2) (debug (sexp sexp &rest form)))
  `(let* ,(mapcar
           (lambda (x)
             (let* ((var (if (consp x) (car x) x))
                    (mem `(car (cdr (memq ',var cl-keys)))))
               (if (eq var :test-not)
                   (setq mem `(and ,mem (setq cl-test ,mem) t)))
               (if (eq var :if-not)
                   (setq mem `(and ,mem (setq cl-if ,mem) t)))
               (list (intern
                      (format "cl-%s" (substring (symbol-name var) 1)))
                     (if (consp x) `(or ,mem ,(cadr x)) mem))))
           keywords)
     ,@(append
        (and (not (eq other-keys t))
             `((let ((cl-keys-temp cl-keys))
                 (while cl-keys-temp
                   (or (memq (car cl-keys-temp)
                             (quote ,(mapcar
                                      (lambda (x)
                                        (if (consp x)
                                            (car x) x))
                                      (append keywords other-keys))))
                       (cadr (memq :allow-other-keys cl-keys))
                       (error "Bad keyword argument %s"
                              (car cl-keys-temp)))
                   (setq cl-keys-temp (cddr cl-keys-temp))))))
        body)))