summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2021-04-12 11:53:25 -0400
committerStefan Monnier <monnier@iro.umontreal.ca>2021-04-12 11:53:25 -0400
commit2ae53db722b64eb5e67ef53de46825b766fba17e (patch)
treeaea6d6910f7e9da52da555753e7f988c70a3a1f5
parent2ec25de5ea1966c2a3ac4ba7180ea57405dba132 (diff)
downloademacs-2ae53db722b64eb5e67ef53de46825b766fba17e.tar.gz
* lisp/comint.el (comint-strip-ctrl-m): Avoid `called-interactively-p`
-rw-r--r--lisp/comint.el8
1 files changed, 4 insertions, 4 deletions
diff --git a/lisp/comint.el b/lisp/comint.el
index 9cbcfc03fa6..2745c5a26f6 100644
--- a/lisp/comint.el
+++ b/lisp/comint.el
@@ -2254,23 +2254,23 @@ This function could be on `comint-output-filter-functions' or bound to a key."
(let ((inhibit-read-only t))
(delete-region (point-min) (point)))))
-(defun comint-strip-ctrl-m (&optional _string)
+(defun comint-strip-ctrl-m (&optional _string interactive)
"Strip trailing `^M' characters from the current output group.
This function could be on `comint-output-filter-functions' or bound to a key."
- (interactive)
+ (interactive (list nil t))
(let ((process (get-buffer-process (current-buffer))))
(if (not process)
;; This function may be used in
;; `comint-output-filter-functions', and in that case, if
;; there's no process, then we should do nothing. If
;; interactive, report an error.
- (when (called-interactively-p 'interactive)
+ (when interactive
(error "No process in the current buffer"))
(let ((pmark (process-mark process)))
(save-excursion
(condition-case nil
(goto-char
- (if (called-interactively-p 'interactive)
+ (if interactive
comint-last-input-end comint-last-output-start))
(error nil))
(while (re-search-forward "\r+$" pmark t)