]> git.eshelyaron.com Git - emacs.git/commitdiff
(comint-replace-by-expanded-history): Expand only at prompt.
authorKarl Heuer <kwzh@gnu.org>
Tue, 19 Apr 1994 00:51:24 +0000 (00:51 +0000)
committerKarl Heuer <kwzh@gnu.org>
Tue, 19 Apr 1994 00:51:24 +0000 (00:51 +0000)
Pass SILENT flag to comint-replace-by-expanded-history-before-point.

lisp/comint.el

index 6c3993d73eb8842ba52145fcefbd8fc3f8c75921..29e73f13e120599bc5ff30e5485ae2eb88c099a0 100644 (file)
@@ -854,15 +854,17 @@ See `comint-magic-space' and `comint-replace-by-expanded-history-before-point'.
 Returns t if successful."
   (interactive)
   (if (and comint-input-autoexpand
-          (string-match "[!^]" (funcall comint-get-old-input)))
+          (string-match "[!^]" (funcall comint-get-old-input))
+          (save-excursion (beginning-of-line)
+                          (looking-at comint-prompt-regexp)))
       ;; Looks like there might be history references in the command.
       (let ((previous-modified-tick (buffer-modified-tick)))
        (message "Expanding history references...")
-       (comint-replace-by-expanded-history-before-point)
+       (comint-replace-by-expanded-history-before-point silent)
        (/= previous-modified-tick (buffer-modified-tick)))))
 
 
-(defun comint-replace-by-expanded-history-before-point ()
+(defun comint-replace-by-expanded-history-before-point (silent)
   "Expand directory stack reference before point.
 See `comint-replace-by-expanded-history'.  Returns t if successful."
   (save-excursion