;;; comint.el --- general command interpreter in a window stuff -*- lexical-binding: t -*-
-;; Copyright (C) 1988, 1990, 1992-2014 Free Software Foundation, Inc.
+;; Copyright (C) 1988, 1990, 1992-2015 Free Software Foundation, Inc.
;; Author: Olin Shivers <shivers@cs.cmu.edu>
;; Simon Marshall <simon@gnu.org>
(define-key map "\C-c\C-\\" 'comint-quit-subjob)
(define-key map "\C-c\C-m" 'comint-copy-old-input)
(define-key map "\C-c\C-o" 'comint-delete-output)
+ (define-key map "\C-c\M-o" 'comint-clear-buffer)
(define-key map "\C-c\C-r" 'comint-show-output)
(define-key map "\C-c\C-e" 'comint-show-maximum-output)
(define-key map "\C-c\C-l" 'comint-dynamic-list-input-ring)
;; the initial comint prompt.
(if (overlayp comint-history-isearch-message-overlay)
(move-overlay comint-history-isearch-message-overlay
- (save-excursion (forward-line 0) (point))
- (comint-line-beginning-position))
+ (save-excursion
+ (goto-char (field-beginning))
+ (forward-line 0)
+ (point))
+ (field-beginning))
(setq comint-history-isearch-message-overlay
- (make-overlay (save-excursion (forward-line 0) (point))
- (comint-line-beginning-position)))
+ (make-overlay (save-excursion
+ (goto-char (field-beginning))
+ (forward-line 0)
+ (point))
+ (field-beginning)))
(overlay-put comint-history-isearch-message-overlay 'evaporate t))
(overlay-put comint-history-isearch-message-overlay
- 'display (isearch-message-prefix c-q-hack ellipsis))
+ '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))
(goto-char (field-beginning pos))
(set-window-start (selected-window) (point))))))
+(defun comint-clear-buffer ()
+ "Clear the comint buffer."
+ (interactive)
+ (let ((comint-buffer-maximum-size 0))
+ (comint-truncate-buffer)))
(defun comint-interrupt-subjob ()
"Interrupt the current subjob.