comparison lisp/replace.el @ 107417:a24389e7f686

Use query-replace-{from,to}-history-variable in more places. * replace.el (query-replace-history): Give it a doc string. (map-query-replace-regexp): Use query-replace-from-history-variable and query-replace-to-history-variable.
author Glenn Morris <rgm@gnu.org>
date Wed, 17 Mar 2010 23:44:36 -0700
parents 1d1d5d9bd884
children e64817c0ab40
comparison
equal deleted inserted replaced
107416:4e4e25c1fae4 107417:a24389e7f686
31 (defcustom case-replace t 31 (defcustom case-replace t
32 "Non-nil means `query-replace' should preserve case in replacements." 32 "Non-nil means `query-replace' should preserve case in replacements."
33 :type 'boolean 33 :type 'boolean
34 :group 'matching) 34 :group 'matching)
35 35
36 (defvar query-replace-history nil) 36 (defvar query-replace-history nil
37 "Default history list for query-replace commands.
38 See `query-replace-from-history-variable' and
39 `query-replace-to-history-variable'.")
37 40
38 (defvar query-replace-defaults nil 41 (defvar query-replace-defaults nil
39 "Default values of FROM-STRING and TO-STRING for `query-replace'. 42 "Default values of FROM-STRING and TO-STRING for `query-replace'.
40 This is a cons cell (FROM-STRING . TO-STRING), or nil if there is 43 This is a cons cell (FROM-STRING . TO-STRING), or nil if there is
41 no default value.") 44 no default value.")
392 (interactive 395 (interactive
393 (let* ((from (if query-replace-interactive 396 (let* ((from (if query-replace-interactive
394 (car regexp-search-ring) 397 (car regexp-search-ring)
395 (read-from-minibuffer "Map query replace (regexp): " 398 (read-from-minibuffer "Map query replace (regexp): "
396 nil nil nil 399 nil nil nil
397 'query-replace-history nil t))) 400 query-replace-from-history-variable
401 nil t)))
398 (to (read-from-minibuffer 402 (to (read-from-minibuffer
399 (format "Query replace %s with (space-separated strings): " 403 (format "Query replace %s with (space-separated strings): "
400 (query-replace-descr from)) 404 (query-replace-descr from))
401 nil nil nil 405 nil nil nil
402 'query-replace-history from t))) 406 query-replace-to-history-variable from t)))
403 (list from to 407 (list from to
404 (and current-prefix-arg 408 (and current-prefix-arg
405 (prefix-numeric-value current-prefix-arg)) 409 (prefix-numeric-value current-prefix-arg))
406 (if (and transient-mark-mode mark-active) 410 (if (and transient-mark-mode mark-active)
407 (region-beginning)) 411 (region-beginning))