Function: eshell-parse-argument

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

Signature

(eshell-parse-argument)

Documentation

Get the next argument. Leave point after it.

Source Code

;; Defined in /usr/src/emacs/lisp/eshell/esh-arg.el.gz
(defun eshell-parse-argument ()
  "Get the next argument.  Leave point after it."
  (let* ((outer (null eshell-nested-argument))
	 (arg-begin (and outer (point)))
	 (eshell-nested-argument t)
	 eshell-current-argument
	 eshell-current-modifiers
	 eshell-arg-listified)
    (catch 'eshell-arg-done
      (while (not (eobp))
	(let ((result
	       (or (run-hook-with-args-until-success
		    'eshell-parse-argument-hook)
		   (prog1
		       (char-to-string (char-after))
		     (forward-char)))))
          (unless (eq result 'eshell-empty-token)
            (if (not eshell-current-argument)
                (setq eshell-current-argument result)
              (unless eshell-arg-listified
                (setq eshell-current-argument
                      (list eshell-current-argument)
                      eshell-arg-listified t))
              (nconc eshell-current-argument (list result)))))))
    (when (and outer eshell-current-argument)
      (add-text-properties arg-begin (1+ arg-begin)
			   '(arg-begin t rear-nonsticky
				       (arg-begin arg-end)))
      (add-text-properties (1- (point)) (point)
			   '(arg-end t rear-nonsticky
				     (arg-end arg-begin))))
    (eshell-resolve-current-argument)
    eshell-current-argument))