aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/comint.el8
1 files changed, 5 insertions, 3 deletions
diff --git a/lisp/comint.el b/lisp/comint.el
index 6c3993d73eb..29e73f13e12 100644
--- a/lisp/comint.el
+++ b/lisp/comint.el
@@ -854,15 +854,17 @@ See `comint-magic-space' and `comint-replace-by-expanded-history-before-point'.
854Returns t if successful." 854Returns t if successful."
855 (interactive) 855 (interactive)
856 (if (and comint-input-autoexpand 856 (if (and comint-input-autoexpand
857 (string-match "[!^]" (funcall comint-get-old-input))) 857 (string-match "[!^]" (funcall comint-get-old-input))
858 (save-excursion (beginning-of-line)
859 (looking-at comint-prompt-regexp)))
858 ;; Looks like there might be history references in the command. 860 ;; Looks like there might be history references in the command.
859 (let ((previous-modified-tick (buffer-modified-tick))) 861 (let ((previous-modified-tick (buffer-modified-tick)))
860 (message "Expanding history references...") 862 (message "Expanding history references...")
861 (comint-replace-by-expanded-history-before-point) 863 (comint-replace-by-expanded-history-before-point silent)
862 (/= previous-modified-tick (buffer-modified-tick))))) 864 (/= previous-modified-tick (buffer-modified-tick)))))
863 865
864 866
865(defun comint-replace-by-expanded-history-before-point () 867(defun comint-replace-by-expanded-history-before-point (silent)
866 "Expand directory stack reference before point. 868 "Expand directory stack reference before point.
867See `comint-replace-by-expanded-history'. Returns t if successful." 869See `comint-replace-by-expanded-history'. Returns t if successful."
868 (save-excursion 870 (save-excursion