;;; comint.el --- general command interpreter in a window stuff
-;; Copyright (C) 1988, 90, 92, 93, 94, 95, 96, 97, 98, 99, 2000
+;; Copyright (C) 1988, 90, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001
;; Free Software Foundation, Inc.
;; Author: Olin Shivers <shivers@cs.cmu.edu> then
(defvar comint-input-ring-separator "\n"
"Separator between commands in the history file.")
+(defvar comint-input-history-ignore "^#"
+ "Regexp for history entries that should be ignored when comint initializes.")
+
(defcustom comint-process-echoes nil
"*If non-nil, assume that the subprocess echoes any input.
If so, delete one copy of the input so that only one copy eventually
;; ssh-add prints a prompt like `Enter passphrase: '.
;; Some implementations of passwd use "Password (again)" as the 2nd prompt.
(defcustom comint-password-prompt-regexp
- "\\(\\([Oo]ld \\|[Nn]ew \\|Kerberos \\|'s \\|login \\|^\\)\
+ "\\(\\([Oo]ld \\|[Nn]ew \\|Kerberos \\|'s \\|login \\|CVS \\|^\\)\
[Pp]assword\\( (again)\\)?\\|pass phrase\\|Enter passphrase\\)\
\\( for [^@ \t\n]+@[^@ \t\n]+\\)?:\\s *\\'"
"*Regexp matching prompts for passwords in the inferior process.
This function is useful for major mode commands and mode hooks.
The commands stored in the history file are separated by the
-`comint-input-ring-separator'. The most recent command comes last.
+`comint-input-ring-separator', and entries that match
+`comint-input-history-ignore' are ignored. The most recent command
+comes last.
See also `comint-input-ignoredups' and `comint-write-input-ring'."
(cond ((or (null comint-input-ring-file-name)
(setq start (point-min)))
(setq history (buffer-substring start end))
(goto-char start)
- (if (or (null comint-input-ignoredups)
- (ring-empty-p ring)
- (not (string-equal (ring-ref ring 0) history)))
+ (if (and (not (string-match comint-input-history-ignore history))
+ (or (null comint-input-ignoredups)
+ (ring-empty-p ring)
+ (not (string-equal (ring-ref ring 0) history))))
(progn
(ring-insert-at-beginning ring history)
(setq count (1+ count)))))))
(save-excursion
(let ((toend (- (line-end-position) (point)))
(start (comint-line-beginning-position)))
+ (goto-char start)
(while (progn
(skip-chars-forward "^!^" (- (line-end-position) toend))
(< (point) (- (line-end-position) toend)))
(let ((proc (or (get-buffer-process (current-buffer))
(error "Current buffer has no process"))))
(goto-char (process-mark proc))
- (message "Point is now at the process mark")))
+ (when (interactive-p)
+ (message "Point is now at the process mark"))))
(defun comint-bol-or-process-mark ()
"Move point to beginning of line (after prompt) or to the process mark.