Function: eshell-parse-arg-modifier

eshell-parse-arg-modifier is a byte-compiled function defined in em-pred.el.gz.

Signature

(eshell-parse-arg-modifier)

Documentation

Parse a modifier that has been specified after an argument.

This function is specially for adding onto eshell-parse-argument-hook.

Source Code

;; Defined in /usr/src/emacs/lisp/eshell/em-pred.el.gz
(defun eshell-parse-arg-modifier ()
  "Parse a modifier that has been specified after an argument.
This function is specially for adding onto `eshell-parse-argument-hook'."
  (when (eq (char-after) ?\()
    (forward-char)
    (let ((end (eshell-find-delimiter ?\( ?\))))
      (if (not end)
          (throw 'eshell-incomplete "(")
	(when (eshell-arg-delimiter (1+ end))
	  (save-restriction
	    (narrow-to-region (point) end)
	    (let* ((modifier-string (buffer-string))
                   (modifiers (eshell-parse-modifiers))
		   (preds (car modifiers))
		   (mods (cdr modifiers)))
              (when (or preds mods)
                ;; Has to go near the end (but before
                ;; `eshell-splice-args'), which is only natural since
                ;; syntactically it can only occur at the end.
                (add-hook 'eshell-current-modifiers
                          (lambda (lst)
                            (eshell-apply-modifiers
                             lst preds mods modifier-string))
                          90))))
	  (goto-char (1+ end))
	  (eshell-finish-arg))))))