diff options
author | Karl Heuer <kwzh@gnu.org> | 1994-04-19 00:51:24 +0000 |
---|---|---|
committer | Karl Heuer <kwzh@gnu.org> | 1994-04-19 00:51:24 +0000 |
commit | 8d3d2a0cddfa96be9fa3f3d9733e6fc1569ea59a (patch) | |
tree | 926862dfafd03e20bde633e954a7e8057bd90ebd | |
parent | 196a7903859d7f25d927e73119d264bca8049b91 (diff) | |
download | emacs-8d3d2a0cddfa96be9fa3f3d9733e6fc1569ea59a.tar.gz emacs-8d3d2a0cddfa96be9fa3f3d9733e6fc1569ea59a.tar.bz2 emacs-8d3d2a0cddfa96be9fa3f3d9733e6fc1569ea59a.zip |
(comint-replace-by-expanded-history): Expand only at prompt.
Pass SILENT flag to comint-replace-by-expanded-history-before-point.
-rw-r--r-- | lisp/comint.el | 8 |
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'. 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 |