Function: comint-get-old-input-default

comint-get-old-input-default is a byte-compiled function defined in comint.el.gz.

Signature

(comint-get-old-input-default)

Documentation

Default for comint-get-old-input.

If comint-use-prompt-regexp is nil, then either return the current input field, if point is on an input field, or the current line, if point is on an output field. If comint-use-prompt-regexp is non-nil, then return the current line with any initial string matching the regexp comint-prompt-regexp removed.

Source Code

;; Defined in /usr/src/emacs/lisp/comint.el.gz
(defun comint-get-old-input-default ()
  "Default for `comint-get-old-input'.
If `comint-use-prompt-regexp' is nil, then either
return the current input field, if point is on an input field, or the
current line, if point is on an output field.
If `comint-use-prompt-regexp' is non-nil, then return
the current line with any initial string matching the regexp
`comint-prompt-regexp' removed."
  (let (field-prop bof)
    (if (and (not comint-use-prompt-regexp)
             ;; Make sure we're in an input rather than output field.
             (not (setq field-prop (get-char-property
                                    (setq bof (field-beginning)) 'field))))
	(field-string-no-properties bof)
      (comint-bol)
      (buffer-substring-no-properties (point)
                                      (if (or comint-use-prompt-regexp
                                              (eq field-prop 'output))
					  (line-end-position)
					(field-end))))))