diff options
| author | Richard M. Stallman | 2005-01-04 02:21:55 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2005-01-04 02:21:55 +0000 |
| commit | c1bc6bb67e0e01fc17c672ed0f678077f890016e (patch) | |
| tree | 13063aae5eef0422f0f0f3e189a2733b47cd079e | |
| parent | d8ca23a0de8a965e1f72c5c2973f2126e8fd9702 (diff) | |
| download | emacs-c1bc6bb67e0e01fc17c672ed0f678077f890016e.tar.gz emacs-c1bc6bb67e0e01fc17c672ed0f678077f890016e.zip | |
(lazy-highlight): Group renamed from isearch-lazy-...
(lazy-highlight-cleanup, lazy-highlight-initial-delay)
(lazy-highlight-interval, lazy-highlight-max-at-a-time)
(lazy-highlight-face): Renamed from isearch-lazy-...
Change all references to them.
| -rw-r--r-- | lisp/isearch.el | 125 |
1 files changed, 65 insertions, 60 deletions
diff --git a/lisp/isearch.el b/lisp/isearch.el index f94590ded2d..a87097f884e 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el | |||
| @@ -155,6 +155,15 @@ command history." | |||
| 155 | :type 'boolean | 155 | :type 'boolean |
| 156 | :group 'isearch) | 156 | :group 'isearch) |
| 157 | 157 | ||
| 158 | (defcustom isearch-lazy-highlight t | ||
| 159 | "*Controls the lazy-highlighting during incremental search. | ||
| 160 | When non-nil, all text in the buffer matching the current search | ||
| 161 | string is highlighted lazily (see `lazy-highlight-initial-delay' | ||
| 162 | and `lazy-highlight-interval')." | ||
| 163 | :type 'boolean | ||
| 164 | :group 'lazy-highlight | ||
| 165 | :group 'isearch) | ||
| 166 | |||
| 158 | (defvar isearch-mode-hook nil | 167 | (defvar isearch-mode-hook nil |
| 159 | "Function(s) to call after starting up an incremental search.") | 168 | "Function(s) to call after starting up an incremental search.") |
| 160 | 169 | ||
| @@ -199,6 +208,54 @@ Default value, nil, means edit the string instead." | |||
| 199 | :type 'boolean | 208 | :type 'boolean |
| 200 | :group 'isearch) | 209 | :group 'isearch) |
| 201 | 210 | ||
| 211 | ;;; Lazy highlight customization. | ||
| 212 | (defgroup lazy-highlight nil | ||
| 213 | "Lazy highlighting feature for matching strings." | ||
| 214 | :prefix "lazy-highlight-" | ||
| 215 | :version "21.1" | ||
| 216 | :group 'isearch | ||
| 217 | :group 'replace) | ||
| 218 | |||
| 219 | (defcustom lazy-highlight-cleanup t | ||
| 220 | "*Controls whether to remove extra highlighting after a search. | ||
| 221 | If this is nil, extra highlighting can be \"manually\" removed with | ||
| 222 | \\[isearch-lazy-highlight-cleanup]." | ||
| 223 | :type 'boolean | ||
| 224 | :group 'lazy-highlight) | ||
| 225 | |||
| 226 | (defcustom lazy-highlight-initial-delay 0.25 | ||
| 227 | "*Seconds to wait before beginning to lazily highlight all matches." | ||
| 228 | :type 'number | ||
| 229 | :group 'lazy-highlight) | ||
| 230 | |||
| 231 | (defcustom lazy-highlight-interval 0 ; 0.0625 | ||
| 232 | "*Seconds between lazily highlighting successive matches." | ||
| 233 | :type 'number | ||
| 234 | :group 'lazy-highlight) | ||
| 235 | |||
| 236 | (defcustom lazy-highlight-max-at-a-time 20 | ||
| 237 | "*Maximum matches to highlight at a time (for `lazy-highlight'). | ||
| 238 | Larger values may reduce isearch's responsiveness to user input; | ||
| 239 | smaller values make matches highlight slowly. | ||
| 240 | A value of nil means highlight all matches." | ||
| 241 | :type '(choice (const :tag "All" nil) | ||
| 242 | (integer :tag "Some")) | ||
| 243 | :group 'lazy-highlight) | ||
| 244 | |||
| 245 | (defface lazy-highlight-face | ||
| 246 | '((((class color) (min-colors 88) (background light)) | ||
| 247 | (:background "paleturquoise")) | ||
| 248 | (((class color) (min-colors 88) (background dark)) | ||
| 249 | (:background "paleturquoise4")) | ||
| 250 | (((class color) (min-colors 16)) | ||
| 251 | (:background "turquoise3")) | ||
| 252 | (((class color) (min-colors 8)) | ||
| 253 | (:background "turquoise3")) | ||
| 254 | (t (:underline t))) | ||
| 255 | "Face for lazy highlighting of matches other than the current one." | ||
| 256 | :group 'isearch-faces | ||
| 257 | :group 'lazy-highlight) | ||
| 258 | |||
| 202 | ;; Define isearch-mode keymap. | 259 | ;; Define isearch-mode keymap. |
| 203 | 260 | ||
| 204 | (defvar isearch-mode-map | 261 | (defvar isearch-mode-map |
| @@ -677,7 +734,7 @@ is treated as a regexp. See \\[isearch-forward] for more info." | |||
| 677 | ;; (setq pre-command-hook isearch-old-pre-command-hook) ; for lemacs | 734 | ;; (setq pre-command-hook isearch-old-pre-command-hook) ; for lemacs |
| 678 | (setq minibuffer-message-timeout isearch-original-minibuffer-message-timeout) | 735 | (setq minibuffer-message-timeout isearch-original-minibuffer-message-timeout) |
| 679 | (isearch-dehighlight t) | 736 | (isearch-dehighlight t) |
| 680 | (isearch-lazy-highlight-cleanup isearch-lazy-highlight-cleanup) | 737 | (isearch-lazy-highlight-cleanup lazy-highlight-cleanup) |
| 681 | (let ((found-start (window-start (selected-window))) | 738 | (let ((found-start (window-start (selected-window))) |
| 682 | (found-point (point))) | 739 | (found-point (point))) |
| 683 | (if isearch-window-configuration | 740 | (if isearch-window-configuration |
| @@ -2227,46 +2284,6 @@ since they have special meaning in a regexp." | |||
| 2227 | ;; - the variable `isearch-invalid-regexp' is expected to be true | 2284 | ;; - the variable `isearch-invalid-regexp' is expected to be true |
| 2228 | ;; iff `isearch-string' is an invalid regexp. | 2285 | ;; iff `isearch-string' is an invalid regexp. |
| 2229 | 2286 | ||
| 2230 | (defgroup isearch-lazy-highlight nil | ||
| 2231 | "Lazy highlighting feature for incremental search." | ||
| 2232 | :prefix "isearch-lazy-highlight-" | ||
| 2233 | :version "21.1" | ||
| 2234 | :group 'isearch) | ||
| 2235 | |||
| 2236 | (defcustom isearch-lazy-highlight t | ||
| 2237 | "*Controls the lazy-highlighting during incremental searches. | ||
| 2238 | When non-nil, all text in the buffer matching the current search | ||
| 2239 | string is highlighted lazily (see `isearch-lazy-highlight-initial-delay' | ||
| 2240 | and `isearch-lazy-highlight-interval')." | ||
| 2241 | :type 'boolean | ||
| 2242 | :group 'isearch-lazy-highlight) | ||
| 2243 | |||
| 2244 | (defcustom isearch-lazy-highlight-cleanup t | ||
| 2245 | "*Controls whether to remove extra highlighting after a search. | ||
| 2246 | If this is nil, extra highlighting can be \"manually\" removed with | ||
| 2247 | \\[isearch-lazy-highlight-cleanup]." | ||
| 2248 | :type 'boolean | ||
| 2249 | :group 'isearch-lazy-highlight) | ||
| 2250 | |||
| 2251 | (defcustom isearch-lazy-highlight-initial-delay 0.25 | ||
| 2252 | "*Seconds to wait before beginning to lazily highlight all matches." | ||
| 2253 | :type 'number | ||
| 2254 | :group 'isearch-lazy-highlight) | ||
| 2255 | |||
| 2256 | (defcustom isearch-lazy-highlight-interval 0 ; 0.0625 | ||
| 2257 | "*Seconds between lazily highlighting successive matches." | ||
| 2258 | :type 'number | ||
| 2259 | :group 'isearch-lazy-highlight) | ||
| 2260 | |||
| 2261 | (defcustom isearch-lazy-highlight-max-at-a-time 20 | ||
| 2262 | "*Maximum matches to highlight at a time (for `isearch-lazy-highlight'). | ||
| 2263 | Larger values may reduce isearch's responsiveness to user input; | ||
| 2264 | smaller values make matches highlight slowly. | ||
| 2265 | A value of nil means highlight all matches." | ||
| 2266 | :type '(choice (const :tag "All" nil) | ||
| 2267 | (integer :tag "Some")) | ||
| 2268 | :group 'isearch-lazy-highlight) | ||
| 2269 | |||
| 2270 | (defgroup isearch-faces nil | 2287 | (defgroup isearch-faces nil |
| 2271 | "Lazy highlighting feature for incremental search." | 2288 | "Lazy highlighting feature for incremental search." |
| 2272 | :version "21.1" | 2289 | :version "21.1" |
| @@ -2288,19 +2305,7 @@ A value of nil means highlight all matches." | |||
| 2288 | :group 'isearch-faces) | 2305 | :group 'isearch-faces) |
| 2289 | (defvar isearch 'isearch) | 2306 | (defvar isearch 'isearch) |
| 2290 | 2307 | ||
| 2291 | (defface isearch-lazy-highlight-face | 2308 | (defvar isearch-lazy-highlight-face 'lazy-highlight-face) |
| 2292 | '((((class color) (min-colors 88) (background light)) | ||
| 2293 | (:background "paleturquoise")) | ||
| 2294 | (((class color) (min-colors 88) (background dark)) | ||
| 2295 | (:background "paleturquoise4")) | ||
| 2296 | (((class color) (min-colors 16)) | ||
| 2297 | (:background "turquoise3")) | ||
| 2298 | (((class color) (min-colors 8)) | ||
| 2299 | (:background "turquoise3")) | ||
| 2300 | (t (:underline t))) | ||
| 2301 | "Face for lazy highlighting of Isearch matches other than the current one." | ||
| 2302 | :group 'isearch-faces) | ||
| 2303 | (defvar isearch-lazy-highlight-face 'isearch-lazy-highlight-face) | ||
| 2304 | 2309 | ||
| 2305 | (defvar isearch-lazy-highlight-overlays nil) | 2310 | (defvar isearch-lazy-highlight-overlays nil) |
| 2306 | (defvar isearch-lazy-highlight-wrapped nil) | 2311 | (defvar isearch-lazy-highlight-wrapped nil) |
| @@ -2316,11 +2321,11 @@ A value of nil means highlight all matches." | |||
| 2316 | 2321 | ||
| 2317 | (defun isearch-lazy-highlight-cleanup (&optional force) | 2322 | (defun isearch-lazy-highlight-cleanup (&optional force) |
| 2318 | "Stop lazy highlighting and remove extra highlighting from current buffer. | 2323 | "Stop lazy highlighting and remove extra highlighting from current buffer. |
| 2319 | FORCE non-nil means do it whether or not `isearch-lazy-highlight-cleanup' | 2324 | FORCE non-nil means do it whether or not `lazy-highlight-cleanup' |
| 2320 | is nil. This function is called when exiting an incremental search if | 2325 | is nil. This function is called when exiting an incremental search if |
| 2321 | `isearch-lazy-highlight-cleanup' is non-nil." | 2326 | `lazy-highlight-cleanup' is non-nil." |
| 2322 | (interactive '(t)) | 2327 | (interactive '(t)) |
| 2323 | (if (or force isearch-lazy-highlight-cleanup) | 2328 | (if (or force lazy-highlight-cleanup) |
| 2324 | (while isearch-lazy-highlight-overlays | 2329 | (while isearch-lazy-highlight-overlays |
| 2325 | (delete-overlay (car isearch-lazy-highlight-overlays)) | 2330 | (delete-overlay (car isearch-lazy-highlight-overlays)) |
| 2326 | (setq isearch-lazy-highlight-overlays | 2331 | (setq isearch-lazy-highlight-overlays |
| @@ -2330,7 +2335,7 @@ is nil. This function is called when exiting an incremental search if | |||
| 2330 | (setq isearch-lazy-highlight-timer nil))) | 2335 | (setq isearch-lazy-highlight-timer nil))) |
| 2331 | 2336 | ||
| 2332 | (defun isearch-lazy-highlight-new-loop () | 2337 | (defun isearch-lazy-highlight-new-loop () |
| 2333 | "Cleanup any previous `isearch-lazy-highlight' loop and begin a new one. | 2338 | "Cleanup any previous `lazy-highlight' loop and begin a new one. |
| 2334 | This happens when `isearch-update' is invoked (which can cause the | 2339 | This happens when `isearch-update' is invoked (which can cause the |
| 2335 | search string to change or the window to scroll)." | 2340 | search string to change or the window to scroll)." |
| 2336 | (when (and (null executing-kbd-macro) | 2341 | (when (and (null executing-kbd-macro) |
| @@ -2361,7 +2366,7 @@ search string to change or the window to scroll)." | |||
| 2361 | isearch-lazy-highlight-wrapped nil) | 2366 | isearch-lazy-highlight-wrapped nil) |
| 2362 | (unless (equal isearch-string "") | 2367 | (unless (equal isearch-string "") |
| 2363 | (setq isearch-lazy-highlight-timer | 2368 | (setq isearch-lazy-highlight-timer |
| 2364 | (run-with-idle-timer isearch-lazy-highlight-initial-delay nil | 2369 | (run-with-idle-timer lazy-highlight-initial-delay nil |
| 2365 | 'isearch-lazy-highlight-update)))))) | 2370 | 'isearch-lazy-highlight-update)))))) |
| 2366 | 2371 | ||
| 2367 | (defun isearch-lazy-highlight-search () | 2372 | (defun isearch-lazy-highlight-search () |
| @@ -2382,7 +2387,7 @@ Attempt to do the search exactly the way the pending isearch would." | |||
| 2382 | 2387 | ||
| 2383 | (defun isearch-lazy-highlight-update () | 2388 | (defun isearch-lazy-highlight-update () |
| 2384 | "Update highlighting of other matches for current search." | 2389 | "Update highlighting of other matches for current search." |
| 2385 | (let ((max isearch-lazy-highlight-max-at-a-time) | 2390 | (let ((max lazy-highlight-max-at-a-time) |
| 2386 | (looping t) | 2391 | (looping t) |
| 2387 | nomore) | 2392 | nomore) |
| 2388 | (with-local-quit | 2393 | (with-local-quit |