Function: comint-history-isearch-message
comint-history-isearch-message is a byte-compiled function defined in
comint.el.gz.
Signature
(comint-history-isearch-message &optional C-Q-HACK ELLIPSIS)
Documentation
Display the input history search prompt.
If there are no search errors, this function displays an overlay with
the Isearch prompt which replaces the original comint prompt.
Otherwise, it displays the standard Isearch message returned from
the function isearch-message(var)/isearch-message(fun).
Source Code
;; Defined in /usr/src/emacs/lisp/comint.el.gz
(defun comint-history-isearch-message (&optional c-q-hack ellipsis)
"Display the input history search prompt.
If there are no search errors, this function displays an overlay with
the Isearch prompt which replaces the original comint prompt.
Otherwise, it displays the standard Isearch message returned from
the function `isearch-message'."
(if (not (and isearch-success (not isearch-error)))
;; Use standard function `isearch-message' when not in comint prompt,
;; or search fails, or has an error (like incomplete regexp).
;; This function displays isearch message in the echo area,
;; so it's possible to see what is wrong in the search string.
(isearch-message c-q-hack ellipsis)
;; Otherwise, put the overlay with the standard isearch prompt over
;; the initial comint prompt.
(if (overlayp comint-history-isearch-message-overlay)
(move-overlay comint-history-isearch-message-overlay
(save-excursion
(goto-char (comint-line-beginning-position))
(forward-line 0)
(point))
(comint-line-beginning-position))
(setq comint-history-isearch-message-overlay
(make-overlay (save-excursion
(goto-char (comint-line-beginning-position))
(forward-line 0)
(point))
(comint-line-beginning-position)))
(overlay-put comint-history-isearch-message-overlay 'evaporate t))
(overlay-put comint-history-isearch-message-overlay
'display (isearch-message-prefix ellipsis isearch-nonincremental))
(if (and comint-input-ring-index (not ellipsis))
;; Display the current history index.
(message "History item: %d" (1+ comint-input-ring-index))
;; Or clear a previous isearch message.
(message ""))))