aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/comint.el14
1 files changed, 14 insertions, 0 deletions
diff --git a/lisp/comint.el b/lisp/comint.el
index 44b885593e2..e3572ba4003 100644
--- a/lisp/comint.el
+++ b/lisp/comint.el
@@ -1279,6 +1279,20 @@ This function should be in the list `comint-output-filter-functions'."
1279 nil t)) 1279 nil t))
1280 (set-buffer current)))) 1280 (set-buffer current))))
1281 1281
1282(defun comint-strip-ctrl-m (&optional string)
1283 "Strip trailing `^M' characters from the current output group.
1284
1285This function could be in the list `comint-output-filter-functions' or bound to
1286a key."
1287 (interactive)
1288 (let ((pmark (process-mark (get-buffer-process (current-buffer)))))
1289 (save-excursion
1290 (goto-char
1291 (if (interactive-p) comint-last-input-end comint-last-output-start))
1292 (while (re-search-forward "\r+$" pmark t)
1293 (replace-match "" t t)))))
1294(defalias 'shell-strip-ctrl-m 'comint-strip-ctrl-m)
1295
1282(defun comint-show-maximum-output () 1296(defun comint-show-maximum-output ()
1283 "Put the end of the buffer at the bottom of the window." 1297 "Put the end of the buffer at the bottom of the window."
1284 (interactive) 1298 (interactive)