comparison lisp/comint.el @ 5476:155472377864

(comint-show-output): Use (point-max) rather than erring when the comint-last-input-end marker points nowhere.
author Roland McGrath <roland@gnu.org>
date Thu, 06 Jan 1994 20:24:06 +0000
parents 51eecae04837
children 73389b4a4a9d
comparison
equal deleted inserted replaced
5475:e723f6be6239 5476:155472377864
1 ;;; comint.el --- general command interpreter in a window stuff 1 ;;; comint.el --- general command interpreter in a window stuff
2 2
3 ;; Copyright (C) 1988, 1990, 1992, 1993 Free Software Foundation, Inc. 3 ;; Copyright (C) 1988, 1990, 1992, 1993, 1994 Free Software Foundation, Inc.
4 4
5 ;; Author: Olin Shivers <shivers@cs.cmu.edu> 5 ;; Author: Olin Shivers <shivers@cs.cmu.edu>
6 ;; Adapted-by: Simon Marshall <s.marshall@dcs.hull.ac.uk> 6 ;; Adapted-by: Simon Marshall <s.marshall@dcs.hull.ac.uk>
7 ;; Keywords: processes 7 ;; Keywords: processes
8 8
1417 (defun comint-show-output () 1417 (defun comint-show-output ()
1418 "Display start of this batch of interpreter output at top of window. 1418 "Display start of this batch of interpreter output at top of window.
1419 Also put cursor there if the current position is not visible." 1419 Also put cursor there if the current position is not visible."
1420 (interactive) 1420 (interactive)
1421 (let ((pos (point))) 1421 (let ((pos (point)))
1422 (goto-char comint-last-input-end) 1422 (goto-char (or (marker-position comint-last-input-end) (point-max)))
1423 (beginning-of-line 0) 1423 (beginning-of-line 0)
1424 (set-window-start (selected-window) (point)) 1424 (set-window-start (selected-window) (point))
1425 (if (pos-visible-in-window-p pos) 1425 (if (pos-visible-in-window-p pos)
1426 (goto-char pos) 1426 (goto-char pos)
1427 (comint-skip-prompt)))) 1427 (comint-skip-prompt))))