# HG changeset patch # User Stefan Monnier # Date 1295643384 18000 # Node ID 36dcbf24a6f13699ef4f2cbe4e60d18b86ddf4fb # Parent f7f90410cc52c9ff5a8d4cd8c6a91c63e12b8296 * lisp/comint.el (comint-replace-by-expanded-history-before-point): Fix expansion of !$ and !!:N syntax to pick the indicated word. diff -r f7f90410cc52 -r 36dcbf24a6f1 lisp/ChangeLog --- a/lisp/ChangeLog Fri Jan 21 15:48:20 2011 -0500 +++ b/lisp/ChangeLog Fri Jan 21 15:56:24 2011 -0500 @@ -1,11 +1,17 @@ +2011-01-21 Roland McGrath + + * comint.el (comint-replace-by-expanded-history-before-point): Fix + expansion of !$ and !!:N syntax to pick the indicated word (bug#7883). + 2011-01-21 Stefan Monnier * progmodes/js.el (js--regexp-literal): Count backslashes (bug#7882). 2011-01-21 Jari Aalto - * emacs-lisp/checkdoc.el (checkdoc-this-string-valid-engine): (bug#7705) - Assume foo(bar) is a manpage reference rather than some unquoted symbol. + * emacs-lisp/checkdoc.el (checkdoc-this-string-valid-engine): + Assume foo(bar) is a manpage reference rather than some unquoted + symbol (bug#7705). 2011-01-21 Stefan Monnier diff -r f7f90410cc52 -r 36dcbf24a6f1 lisp/comint.el --- 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^$*-]+\\)?")