changeset 9245:b2440a22efc2

(comint-strip-ctrl-m): Renamed from shell-strip-crtl-m and moved here. (shell-strip-ctrl-m): Add defalias.
author Richard M. Stallman <rms@gnu.org>
date Mon, 03 Oct 1994 01:11:15 +0000
parents 853d760cba83
children 35a50669a6a9
files lisp/comint.el
diffstat 1 files changed, 14 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/comint.el	Mon Oct 03 01:10:57 1994 +0000
+++ b/lisp/comint.el	Mon Oct 03 01:11:15 1994 +0000
@@ -1279,6 +1279,20 @@
 	     nil t))
       (set-buffer current))))
 
+(defun comint-strip-ctrl-m (&optional string)
+  "Strip trailing `^M' characters from the current output group.
+
+This function could be in the list `comint-output-filter-functions' or bound to
+a key."
+  (interactive)
+  (let ((pmark (process-mark (get-buffer-process (current-buffer)))))
+    (save-excursion
+      (goto-char
+       (if (interactive-p) comint-last-input-end comint-last-output-start))
+      (while (re-search-forward "\r+$" pmark t)
+	(replace-match "" t t)))))
+(defalias 'shell-strip-ctrl-m 'comint-strip-ctrl-m)
+
 (defun comint-show-maximum-output ()
   "Put the end of the buffer at the bottom of the window."
   (interactive)