]> git.eshelyaron.com Git - emacs.git/commitdiff
(comint-send-input): Don't call comint-arguments
authorRichard M. Stallman <rms@gnu.org>
Thu, 25 Nov 1993 04:14:10 +0000 (04:14 +0000)
committerRichard M. Stallman <rms@gnu.org>
Thu, 25 Nov 1993 04:14:10 +0000 (04:14 +0000)
to set HISTORY, even if comint-input-autoexpand is not `history'.
When comint-input-autoexpand is `history', undo part of prev change:
do put INPUT back in the buffer in place of expanded hist.

lisp/comint.el

index 03cc7d35782fd8fdabbd5165d0da1c052612d482..8d8c0623a7687a985b731ceda60a0a32b4ce08b4 100644 (file)
@@ -1081,12 +1081,15 @@ Similarly for Soar, Scheme, etc."
                        (comint-replace-by-expanded-history)
                        (buffer-substring pmark (point))))
               (history (if (not (eq comint-input-autoexpand 'history))
-                           (comint-arguments input 0 nil)
+                           input
                          ;; This is messy 'cos ultimately the original
                          ;; functions used do insertion, rather than return
                          ;; strings.  We have to expand, then insert back.
                          (comint-replace-by-expanded-history)
-                         (buffer-substring pmark (point)))))
+                         (let ((copy (buffer-substring pmark (point))))
+                           (delete-region pmark (point))
+                           (insert input)
+                           copy))))
           (if comint-process-echoes
               (delete-region pmark (point))
            (insert ?\n))