diff options
| author | Simon Marshall | 1995-02-25 16:24:51 +0000 |
|---|---|---|
| committer | Simon Marshall | 1995-02-25 16:24:51 +0000 |
| commit | 39a185a95115fd9728d7afb2db162993601a6264 (patch) | |
| tree | c94cb656fa787b01504c2b78ddc1ca1d52949f08 | |
| parent | 4841acc4374b5d44e70355e84db66b2827f39a43 (diff) | |
| download | emacs-39a185a95115fd9728d7afb2db162993601a6264.tar.gz emacs-39a185a95115fd9728d7afb2db162993601a6264.zip | |
Added comint-buffer-maximum-size and comint-truncate-buffer.
| -rw-r--r-- | lisp/comint.el | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/lisp/comint.el b/lisp/comint.el index 045988e8c0a..a056ba51ea0 100644 --- a/lisp/comint.el +++ b/lisp/comint.el | |||
| @@ -209,6 +209,11 @@ If non-nil, then show the maximum output when the window is scrolled. | |||
| 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 | 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'.") | ||
| 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 | ||
| @@ -1292,11 +1297,19 @@ This function should be in the list `comint-output-filter-functions'." | |||
| 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 |