Function: eshell-parse-arguments

eshell-parse-arguments is a byte-compiled function defined in esh-arg.el.gz.

Signature

(eshell-parse-arguments BEG END)

Documentation

Parse all of the arguments at point from BEG to END.

Returns the list of arguments in their raw form. Point is left at the end of the arguments.

Source Code

;; Defined in /usr/src/emacs/lisp/eshell/esh-arg.el.gz
;; Argument parsing

(defun eshell-parse-arguments (beg end)
  "Parse all of the arguments at point from BEG to END.
Returns the list of arguments in their raw form.
Point is left at the end of the arguments."
  (save-excursion
    (save-restriction
      (goto-char beg)
      (narrow-to-region beg end)
      (let ((inhibit-point-motion-hooks t)
	    (args (list t))
	    delim)
        (with-silent-modifications
          (remove-text-properties (point-min) (point-max)
                                  '(arg-begin nil arg-end nil))
          (if (setq
               delim
               (catch 'eshell-incomplete
                 (while (not (eobp))
                   (let* ((here (point))
                          (arg (eshell-parse-argument)))
                     (if (= (point) here)
                         (error "Failed to parse argument `%s'"
                                (buffer-substring here (point-max))))
                     (and arg (nconc args (list arg)))))))
              (throw 'eshell-incomplete (if (listp delim)
                                            delim
                                          (list delim (point) (cdr args)))))
          (cdr args))))))