comparison 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
comparison
equal deleted inserted replaced
112420:f7f90410cc52 112421:36dcbf24a6f1
1290 (message "History item: %d" (1+ number))) 1290 (message "History item: %d" (1+ number)))
1291 (goto-char (match-end 0)) 1291 (goto-char (match-end 0))
1292 (message "Relative reference exceeds input history size")))) 1292 (message "Relative reference exceeds input history size"))))
1293 ((or (looking-at "!!?:?\\([0-9^$*-]+\\)") (looking-at "!!")) 1293 ((or (looking-at "!!?:?\\([0-9^$*-]+\\)") (looking-at "!!"))
1294 ;; Just a number of args from the previous input line. 1294 ;; Just a number of args from the previous input line.
1295 (replace-match (comint-previous-input-string 0) t t) 1295 (replace-match (comint-args (comint-previous-input-string 0)
1296 (match-beginning 1) (match-end 1))
1297 t t)
1296 (message "History item: previous")) 1298 (message "History item: previous"))
1297 ((looking-at 1299 ((looking-at
1298 "!\\??\\({\\(.+\\)}\\|\\(\\sw+\\)\\)\\(:?[0-9^$*-]+\\)?") 1300 "!\\??\\({\\(.+\\)}\\|\\(\\sw+\\)\\)\\(:?[0-9^$*-]+\\)?")
1299 ;; Most recent input starting with or containing (possibly 1301 ;; Most recent input starting with or containing (possibly
1300 ;; protected) string, maybe just a number of args. Phew. 1302 ;; protected) string, maybe just a number of args. Phew.