diff lisp/comint.el @ 112421:36dcbf24a6f1

* lisp/comint.el (comint-replace-by-expanded-history-before-point): Fix expansion of !$ and !!:N syntax to pick the indicated word.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Fri, 21 Jan 2011 15:56:24 -0500
parents 376148b31b5e
children 9f7614f1a892
line wrap: on
line diff
--- a/lisp/comint.el	Fri Jan 21 15:48:20 2011 -0500
+++ b/lisp/comint.el	Fri Jan 21 15:56:24 2011 -0500
@@ -1292,7 +1292,9 @@
 		   (message "Relative reference exceeds input history size"))))
 	      ((or (looking-at "!!?:?\\([0-9^$*-]+\\)") (looking-at "!!"))
 	       ;; Just a number of args from the previous input line.
-	       (replace-match (comint-previous-input-string 0) t t)
+	       (replace-match (comint-args (comint-previous-input-string 0)
+					   (match-beginning 1) (match-end 1))
+			      t t)
 	       (message "History item: previous"))
 	      ((looking-at
 		"!\\??\\({\\(.+\\)}\\|\\(\\sw+\\)\\)\\(:?[0-9^$*-]+\\)?")