comparison lisp/comint.el @ 10833:77d7d3990300

Added comint-buffer-maximum-size and comint-truncate-buffer.
author Simon Marshall <simon@gnu.org>
date Sat, 25 Feb 1995 16:24:51 +0000
parents a774e92de39c
children 8c896f45f888
comparison
equal deleted inserted replaced
10832:32d4c4ca1ff8 10833:77d7d3990300
206 "*Controls how interpreter output causes window to scroll. 206 "*Controls how interpreter output causes window to scroll.
207 If non-nil, then show the maximum output when the window is scrolled. 207 If non-nil, then show the maximum output when the window is scrolled.
208 208
209 See variable `comint-scroll-to-bottom-on-output' and function 209 See variable `comint-scroll-to-bottom-on-output' and function
210 `comint-postoutput-scroll-to-bottom'. This variable is buffer-local.") 210 `comint-postoutput-scroll-to-bottom'. This variable is buffer-local.")
211
212 (defvar comint-buffer-maximum-size 1024
213 "*The maximum size in lines for comint buffers.
214 Comint buffers are truncated from the top to be no greater than this number, if
215 the function `comint-truncate-buffer' is on `comint-output-filter-functions'.")
211 216
212 (defvar comint-input-ring-size 32 217 (defvar comint-input-ring-size 32
213 "Size of input history ring.") 218 "Size of input history ring.")
214 219
215 (defvar comint-process-echoes nil 220 (defvar comint-process-echoes nil
1290 (recenter -1))) 1295 (recenter -1)))
1291 (select-window selected))))) 1296 (select-window selected)))))
1292 nil t)) 1297 nil t))
1293 (set-buffer current)))) 1298 (set-buffer current))))
1294 1299
1300 (defun comint-truncate-buffer (&optional string)
1301 "Truncate the buffer to `comint-buffer-maximum-size'.
1302 This function could be on `comint-output-filter-functions' or bound to a key."
1303 (interactive)
1304 (save-excursion
1305 (goto-char (point-max))
1306 (forward-line (- comint-buffer-maximum-size))
1307 (beginning-of-line)
1308 (delete-region (point-min) (point))))
1309
1295 (defun comint-strip-ctrl-m (&optional string) 1310 (defun comint-strip-ctrl-m (&optional string)
1296 "Strip trailing `^M' characters from the current output group. 1311 "Strip trailing `^M' characters from the current output group.
1297 1312 This function could be on `comint-output-filter-functions' or bound to a key."
1298 This function could be in the list `comint-output-filter-functions' or bound to
1299 a key."
1300 (interactive) 1313 (interactive)
1301 (let ((pmark (process-mark (get-buffer-process (current-buffer))))) 1314 (let ((pmark (process-mark (get-buffer-process (current-buffer)))))
1302 (save-excursion 1315 (save-excursion
1303 (goto-char 1316 (goto-char
1304 (if (interactive-p) comint-last-input-end comint-last-output-start)) 1317 (if (interactive-p) comint-last-input-end comint-last-output-start))