diff options
| -rw-r--r-- | lisp/comint.el | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lisp/comint.el b/lisp/comint.el index 03cc7d35782..8d8c0623a76 100644 --- a/lisp/comint.el +++ b/lisp/comint.el | |||
| @@ -1081,12 +1081,15 @@ Similarly for Soar, Scheme, etc." | |||
| 1081 | (comint-replace-by-expanded-history) | 1081 | (comint-replace-by-expanded-history) |
| 1082 | (buffer-substring pmark (point)))) | 1082 | (buffer-substring pmark (point)))) |
| 1083 | (history (if (not (eq comint-input-autoexpand 'history)) | 1083 | (history (if (not (eq comint-input-autoexpand 'history)) |
| 1084 | (comint-arguments input 0 nil) | 1084 | input |
| 1085 | ;; This is messy 'cos ultimately the original | 1085 | ;; This is messy 'cos ultimately the original |
| 1086 | ;; functions used do insertion, rather than return | 1086 | ;; functions used do insertion, rather than return |
| 1087 | ;; strings. We have to expand, then insert back. | 1087 | ;; strings. We have to expand, then insert back. |
| 1088 | (comint-replace-by-expanded-history) | 1088 | (comint-replace-by-expanded-history) |
| 1089 | (buffer-substring pmark (point))))) | 1089 | (let ((copy (buffer-substring pmark (point)))) |
| 1090 | (delete-region pmark (point)) | ||
| 1091 | (insert input) | ||
| 1092 | copy)))) | ||
| 1090 | (if comint-process-echoes | 1093 | (if comint-process-echoes |
| 1091 | (delete-region pmark (point)) | 1094 | (delete-region pmark (point)) |
| 1092 | (insert ?\n)) | 1095 | (insert ?\n)) |