comparison lisp/replace.el @ 59479:fea2bcedb7bf

(query-replace-lazy-highlight): Add lazy-highlight group. (query-replace-highlight, query-replace-lazy-highlight) (query-replace): Move definitions to the beginning of the file.
author Juri Linkov <juri@jurta.org>
date Tue, 11 Jan 2005 23:04:16 +0000
parents 6ce9207392bc
children 3d6f4d8e0b8b
comparison
equal deleted inserted replaced
59478:f71796591aa0 59479:fea2bcedb7bf
59 :version "20.3") 59 :version "20.3")
60 60
61 (defcustom query-replace-skip-read-only nil 61 (defcustom query-replace-skip-read-only nil
62 "*Non-nil means `query-replace' and friends ignore read-only matches." 62 "*Non-nil means `query-replace' and friends ignore read-only matches."
63 :type 'boolean 63 :type 'boolean
64 :group 'matching
65 :version "21.4")
66
67 (defcustom query-replace-highlight t
68 "*Non-nil means to highlight matches during query replacement."
69 :type 'boolean
70 :group 'matching)
71
72 (defcustom query-replace-lazy-highlight t
73 "*Controls the lazy-highlighting during query replacements.
74 When non-nil, all text in the buffer matching the current match
75 is highlighted lazily using isearch lazy highlighting (see
76 `lazy-highlight-initial-delay' and `lazy-highlight-interval')."
77 :type 'boolean
78 :group 'lazy-highlight
79 :group 'matching
80 :version "21.4")
81
82 (defface query-replace
83 '((t (:inherit isearch)))
84 "Face for highlighting query replacement matches."
64 :group 'matching 85 :group 'matching
65 :version "21.4") 86 :version "21.4")
66 87
67 (defun query-replace-descr (string) 88 (defun query-replace-descr (string)
68 (mapconcat 'isearch-text-char-description string "")) 89 (mapconcat 'isearch-text-char-description string ""))
1255 nil match-data match-data)))) 1276 nil match-data match-data))))
1256 noedit nil))) 1277 noedit nil)))
1257 (set-match-data match-data) 1278 (set-match-data match-data)
1258 (replace-match newtext fixedcase literal) 1279 (replace-match newtext fixedcase literal)
1259 noedit) 1280 noedit)
1260
1261 (defcustom query-replace-highlight t
1262 "*Non-nil means to highlight matches during query replacement."
1263 :type 'boolean
1264 :group 'matching)
1265
1266 (defcustom query-replace-lazy-highlight t
1267 "*Controls the lazy-highlighting during query replacements.
1268 When non-nil, all text in the buffer matching the current match
1269 is highlighted lazily using isearch lazy highlighting (see
1270 `lazy-highlight-initial-delay' and
1271 `lazy-highlight-interval')."
1272 :type 'boolean
1273 :group 'matching
1274 :version "21.4")
1275
1276 (defface query-replace
1277 '((t (:inherit isearch)))
1278 "Face for highlighting query replacement matches."
1279 :group 'matching
1280 :version "21.4")
1281 1281
1282 (defun perform-replace (from-string replacements 1282 (defun perform-replace (from-string replacements
1283 query-flag regexp-flag delimited-flag 1283 query-flag regexp-flag delimited-flag
1284 &optional repeat-count map start end) 1284 &optional repeat-count map start end)
1285 "Subroutine of `query-replace'. Its complexity handles interactive queries. 1285 "Subroutine of `query-replace'. Its complexity handles interactive queries.