# HG changeset patch # User Karl Heuer # Date 766716684 0 # Node ID 6962dec6fe55dd669ea8e88961349100c26db107 # Parent 22e3af0deae41a1dd401be6bee79f518a6891131 (comint-replace-by-expanded-history): Expand only at prompt. Pass SILENT flag to comint-replace-by-expanded-history-before-point. diff -r 22e3af0deae4 -r 6962dec6fe55 lisp/comint.el --- a/lisp/comint.el Tue Apr 19 00:43:06 1994 +0000 +++ b/lisp/comint.el Tue Apr 19 00:51:24 1994 +0000 @@ -854,15 +854,17 @@ 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