aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/comint.el
diff options
context:
space:
mode:
authorRoland McGrath <[email protected]>1993-07-16 20:30:18 +0000
committerRoland McGrath <[email protected]>1993-07-16 20:30:18 +0000
commit1de80a34eb954f1d64643302f4221dcd72a9aa0f (patch)
tree8758c9a994d22262805a20aa49e9a553ff0d0116 /lisp/comint.el
parentde0748e009060cfcd45f4f6b6a47ef8ddeb2e07b (diff)
(comint-{next,prev}-prompt, comint-send-eof): New functions.
(comint-mode-map): Bind C-c C-n, C-c C-p, and C-c C-d to those. Bind C-c C-y to comint-previous-input, for compatibility with v18 shell.el.
Diffstat (limited to 'lisp/comint.el')
-rw-r--r--lisp/comint.el25
1 files changed, 25 insertions, 0 deletions
diff --git a/lisp/comint.el b/lisp/comint.el
index db45520f59..9f09a738c8 100644
--- a/lisp/comint.el
+++ b/lisp/comint.el
@@ -279,6 +279,10 @@ Entry to this mode runs the hooks on comint-mode-hook"
; (define-key comint-mode-map "\eP" 'comint-msearch-input)
; (define-key comint-mode-map "\eN" 'comint-psearch-input)
; (define-key comint-mode-map "\C-cR" 'comint-msearch-input-matching)
+ (define-key comint-mode-map "\C-c\C-n" 'comint-next-prompt)
+ (define-key comint-mode-map "\C-c\C-p" 'comint-prev-prompt)
+ (define-key comint-mode-map "\C-c\C-d" 'comint-send-eof)
+ (define-key comint-mode-map "\C-c\C-y" 'comint-previous-input) ;v18 binding
)
@@ -899,8 +903,29 @@ Useful if you accidentally suspend the top-level process."
(process-send-eof)
(delete-char arg)))
+(defun comint-send-eof ()
+ "Send an EOF to the current buffer's process."
+ (interactive)
+ (process-send-eof))
+(defun comint-next-prompt (n)
+ "\
+Move to end of next prompt in the buffer (with prefix arg, Nth next).
+See `comint-prompt-regexp'."
+ (interactive "p")
+ (re-search-forward comint-prompt-regexp nil nil n))
+(defun comint-prev-prompt (n)
+ "\
+Move to end of previous prompt in the buffer (with prefix arg, Nth previous).
+See `comint-prompt-regexp'."
+ (interactive "p")
+ (if (= (save-excursion (re-search-backward comint-prompt-regexp nil t)
+ (match-end 0))
+ (point))
+ (setq n (1+ n)))
+ (re-search-backward comint-prompt-regexp nil nil n)
+ (goto-char (match-end 0)))
;;; Support for source-file processing commands.
;;;============================================================================