;;; comint.el --- general command interpreter in a window stuff
;; Copyright (C) 1988, 1990, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-;; 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+;; 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
;; Author: Olin Shivers <shivers@cs.cmu.edu>
;; Simon Marshall <simon@gnu.org>
;; ksu prints a prompt like `Kerberos password for devnull/root@GNU.ORG: '.
;; ssh-add prints a prompt like `Enter passphrase: '.
;; plink prints a prompt like `Passphrase for key "root@GNU.ORG": '.
+;; Ubuntu's sudo prompts like `[sudo] password for user:'
;; Some implementations of passwd use "Password (again)" as the 2nd prompt.
+;; Something called "perforce" uses "Enter password:".
(defcustom comint-password-prompt-regexp
- "\\(\\([Oo]ld \\|[Nn]ew \\|'s \\|login \\|\
-Kerberos \\|CVS \\|UNIX \\| SMB \\|^\\)\
+ "\\(\\(Enter \\|[Oo]ld \\|[Nn]ew \\|'s \\|login \\|\
+Kerberos \\|CVS \\|UNIX \\| SMB \\|LDAP \\|\\[sudo] \\|^\\)\
\[Pp]assword\\( (again)\\)?\\|\
pass phrase\\|\\(Enter \\|Repeat \\|Bad \\)?[Pp]assphrase\\)\
\\(?:, try again\\)?\\(?: for [^:]+\\)?:\\s *\\'"
(define-key map "\e\C-l" 'comint-show-output)
(define-key map "\C-m" 'comint-send-input)
(define-key map "\C-d" 'comint-delchar-or-maybe-eof)
+ ;; The following two are standardly aliased to C-d,
+ ;; but they should never do EOF, just delete.
+ (define-key map [delete] 'delete-char)
+ (define-key map [kp-delete] 'delete-char)
(define-key map "\C-c " 'comint-accumulate)
(define-key map "\C-c\C-x" 'comint-get-next-from-history)
(define-key map "\C-c\C-a" 'comint-bol-or-process-mark)
(make-local-variable 'comint-move-point-for-output)
(make-local-variable 'comint-scroll-show-maximum-output)
(make-local-variable 'comint-stored-incomplete-input)
+ ;; Following disabled because it seems to break the case when
+ ;; comint-scroll-show-maximum-output is nil, and no-one can remember
+ ;; what the original problem was. If there are problems with point
+ ;; not going to the end, consider re-enabling this.
+ ;; http://lists.gnu.org/archive/html/emacs-devel/2007-08/msg00827.html
+ ;;
;; This makes it really work to keep point at the bottom.
- (make-local-variable 'scroll-conservatively)
- (setq scroll-conservatively 10000)
+;;; (make-local-variable 'scroll-conservatively)
+;;; (setq scroll-conservatively 10000)
(add-hook 'pre-command-hook 'comint-preinput-scroll-to-bottom t t)
(make-local-variable 'comint-ptyp)
(make-local-variable 'comint-process-echoes)
If there is no previous input at point, run the command specified
by the global keymap (usually `mouse-yank-at-point')."
(interactive "e")
+ (mouse-set-point event)
(let ((pos (posn-point (event-end event)))
field input)
(with-selected-window (posn-window (event-end event))
(last-command last-command)
(regexp (read-from-minibuffer prompt nil nil nil
'minibuffer-history-search-history)))
+ ;; If the user didn't enter anything, nothing is added to m-h-s-h.
+ ;; Use the previous search regexp, if there is one.
(list (if (string-equal regexp "")
- (setcar minibuffer-history-search-history
- (nth 1 minibuffer-history-search-history))
+ (or (car minibuffer-history-search-history)
+ regexp)
regexp)
(prefix-numeric-value current-prefix-arg))))