Function: async--purecopy

async--purecopy is a natively compiled function defined in async.el.

Signature

(async--purecopy OBJECT)

Documentation

Remove text properties in OBJECT.

Argument OBJECT may be a list or a string, if anything else it is returned unmodified.

Source Code

;; Defined in /nix/store/jhxqyr2zk061dl3wd3vm38lw3zin47b9-emacs-packages-deps/share/emacs/site-lisp/elpa/async-20260729.1431/async.el
(defun async--purecopy (object)
  "Remove text properties in OBJECT.

Argument OBJECT may be a list or a string, if anything else it
is returned unmodified."
  (cond ((stringp object)
         (substring-no-properties object))
        ((consp object)
         (cl-loop for elm in object
                  ;; A string.
                  if (stringp elm)
                  collect (substring-no-properties elm)
                  else
                  ;; Proper lists.
                  if (and (consp elm) (null (cdr (last elm))))
                  collect (async--purecopy elm)
                  else
                  ;; Dotted lists.
                  ;; We handle here only dotted list where car and cdr
                  ;; are atoms i.e. (x . y) and not (x . (x . y)) or
                  ;; (x . (x y)) which should fit most cases.
                  if (and (consp elm) (cdr (last elm)))
                  collect (let ((key (car elm))
                                (val (cdr elm)))
                            (cons (if (stringp key)
                                      (substring-no-properties key)
                                    key)
                                  (if (stringp val)
                                      (substring-no-properties val)
                                    val)))
                  else
                  collect elm))
        (t object)))