comparison lisp/comint.el @ 17956:7af8470b665a

Use insert to preserve marker positions (pmark) and delete last.
author Simon Marshall <simon@gnu.org>
date Mon, 26 May 1997 09:53:59 +0000
parents 0d08e67b280f
children 720d1f98ae42
comparison
equal deleted inserted replaced
17955:3140e48262f9 17956:7af8470b665a
1216 input 1216 input
1217 ;; This is messy 'cos ultimately the original 1217 ;; This is messy 'cos ultimately the original
1218 ;; functions used do insertion, rather than return 1218 ;; functions used do insertion, rather than return
1219 ;; strings. We have to expand, then insert back. 1219 ;; strings. We have to expand, then insert back.
1220 (comint-replace-by-expanded-history t) 1220 (comint-replace-by-expanded-history t)
1221 (let ((copy (buffer-substring pmark (point)))) 1221 (let ((copy (buffer-substring pmark (point)))
1222 (delete-region pmark (point)) 1222 (start (point)))
1223 (insert-before-markers input) 1223 (insert input)
1224 (delete-region pmark start)
1224 copy)))) 1225 copy))))
1225 (if comint-process-echoes 1226 (if comint-process-echoes
1226 (delete-region pmark (point)) 1227 (delete-region pmark (point))
1227 (insert-before-markers ?\n)) 1228 (insert-before-markers ?\n))
1228 (if (and (funcall comint-input-filter history) 1229 (if (and (funcall comint-input-filter history)