Function: eshell-get-old-input

eshell-get-old-input is a byte-compiled function defined in esh-mode.el.gz.

Signature

(eshell-get-old-input &optional USE-CURRENT-REGION)

Documentation

Return the command input on the current line.

If USE-CURRENT-REGION is non-nil, return the current region.

Source Code

;; Defined in /usr/src/emacs/lisp/eshell/esh-mode.el.gz
(defun eshell-get-old-input (&optional use-current-region)
  "Return the command input on the current line.
If USE-CURRENT-REGION is non-nil, return the current region."
  (if use-current-region
      (buffer-substring (min (point) (mark))
			(max (point) (mark)))
    (save-excursion
      (let ((inhibit-field-text-motion t))
        (end-of-line))
      (let ((inhibit-field-text-motion)
            (end (point)))
        (beginning-of-line)
        (buffer-substring-no-properties (point) end)))))