Function: eshell-prepare-splice

eshell-prepare-splice is a byte-compiled function defined in esh-arg.el.gz.

Signature

(eshell-prepare-splice ARGS)

Documentation

Prepare a list of ARGS for splicing, if any arg requested a splice.

This looks for eshell-splice-args as the CAR of each argument, and if found, returns a grouped list like:

  ((list arg-1) (list arg-2) spliced-arg-3 ...)

This allows callers of this function to build the final spliced list by concatenating each element together, e.g. with

   (apply #'append grouped-list)

If no argument requested a splice, return nil.

Source Code

;; Defined in /usr/src/emacs/lisp/eshell/esh-arg.el.gz
(defun eshell-prepare-splice (args)
  "Prepare a list of ARGS for splicing, if any arg requested a splice.
This looks for `eshell-splice-args' as the CAR of each argument,
and if found, returns a grouped list like:

  ((list arg-1) (list arg-2) spliced-arg-3 ...)

This allows callers of this function to build the final spliced
list by concatenating each element together, e.g. with

   (apply #\\='append grouped-list)

If no argument requested a splice, return nil."
  (let* ((splicep nil)
         ;; Group each arg like ((list arg-1) (list arg-2) ...),
         ;; splicing in `eshell-splice-args' args.  This lets us
         ;; apply spliced args correctly elsewhere.
         (grouped-args
          (mapcar (lambda (i)
                    (if (eq (car-safe i) 'eshell-splice-args)
                        (progn
                          (setq splicep t)
                          (cadr i))
                      `(list ,i)))
                  args)))
    (when splicep
      grouped-args)))