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)))
	      (if (or preds mods)
		  ;; has to go at the end, which is only natural since
		  ;; syntactically it can only occur at the end
		  (setq eshell-current-modifiers
			(append
			 eshell-current-modifiers
			 (list
			  (lambda (lst)
			    (eshell-apply-modifiers
			     lst preds mods modifier-string))))))))
	  (goto-char (1+ end))
	  (eshell-finish-arg))))))