Function: cond*-non-exit-clause-substance

cond*-non-exit-clause-substance is a byte-compiled function defined in cond-star.el.gz.

Signature

(cond*-non-exit-clause-substance CLAUSE)

Documentation

For a non-exit cond* clause CLAUSE, return its substance.

This removes a final keyword if that's what makes CLAUSE non-exit.

Source Code

;; Defined in /usr/src/emacs/lisp/emacs-lisp/cond-star.el.gz
(defun cond*-non-exit-clause-substance (clause)
  "For a non-exit cond* clause CLAUSE, return its substance.
This removes a final keyword if that's what makes CLAUSE non-exit."
  (cond ((or
          ;; Starts with `bind*' pseudo-form.
          (and (consp (car clause))
               (eq (caar clause) 'bind*))
          ;; Or has one element that's a `match*'/`pcase*' pseudo-form.
          (and (null (cdr-safe clause))
               (consp (car clause))
               (memq (caar clause) '(match* pcase*))))
         clause)
        ;; Starts with t or a keyword.
        ;; Include t as the first element of the substance
        ;; so that the following element is not treated as a pattern.
        ((and (cdr-safe clause)
              (or (eq (car clause) t)
                  (keywordp (car clause))))
         ;; Standardize on t as the first element.
         (cons t (cdr clause)))

        ;; Ends with keyword.
        ((eq (car (last clause)) :non-exit)
         ;; Do NOT include the final keyword.
         (butlast clause))))