# HG changeset patch # User Richard M. Stallman # Date 1104805315 0 # Node ID eb4a4bdb4f0faeeceda1ac04182f81e985e749c7 # Parent 174ad645cbbcdf935967a9255cb667ac3f9be4bc (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. diff -r 174ad645cbbc -r eb4a4bdb4f0f lisp/isearch.el --- a/lisp/isearch.el Tue Jan 04 00:49:57 2005 +0000 +++ b/lisp/isearch.el Tue Jan 04 02:21:55 2005 +0000 @@ -155,6 +155,15 @@ :type 'boolean :group 'isearch) +(defcustom isearch-lazy-highlight t + "*Controls the lazy-highlighting during incremental search. +When non-nil, all text in the buffer matching the current search +string is highlighted lazily (see `lazy-highlight-initial-delay' +and `lazy-highlight-interval')." + :type 'boolean + :group 'lazy-highlight + :group 'isearch) + (defvar isearch-mode-hook nil "Function(s) to call after starting up an incremental search.") @@ -199,6 +208,54 @@ :type 'boolean :group 'isearch) +;;; Lazy highlight customization. +(defgroup lazy-highlight nil + "Lazy highlighting feature for matching strings." + :prefix "lazy-highlight-" + :version "21.1" + :group 'isearch + :group 'replace) + +(defcustom lazy-highlight-cleanup t + "*Controls whether to remove extra highlighting after a search. +If this is nil, extra highlighting can be \"manually\" removed with +\\[isearch-lazy-highlight-cleanup]." + :type 'boolean + :group 'lazy-highlight) + +(defcustom lazy-highlight-initial-delay 0.25 + "*Seconds to wait before beginning to lazily highlight all matches." + :type 'number + :group 'lazy-highlight) + +(defcustom lazy-highlight-interval 0 ; 0.0625 + "*Seconds between lazily highlighting successive matches." + :type 'number + :group 'lazy-highlight) + +(defcustom lazy-highlight-max-at-a-time 20 + "*Maximum matches to highlight at a time (for `lazy-highlight'). +Larger values may reduce isearch's responsiveness to user input; +smaller values make matches highlight slowly. +A value of nil means highlight all matches." + :type '(choice (const :tag "All" nil) + (integer :tag "Some")) + :group 'lazy-highlight) + +(defface lazy-highlight-face + '((((class color) (min-colors 88) (background light)) + (:background "paleturquoise")) + (((class color) (min-colors 88) (background dark)) + (:background "paleturquoise4")) + (((class color) (min-colors 16)) + (:background "turquoise3")) + (((class color) (min-colors 8)) + (:background "turquoise3")) + (t (:underline t))) + "Face for lazy highlighting of matches other than the current one." + :group 'isearch-faces + :group 'lazy-highlight) + ;; Define isearch-mode keymap. (defvar isearch-mode-map @@ -677,7 +734,7 @@ ;; (setq pre-command-hook isearch-old-pre-command-hook) ; for lemacs (setq minibuffer-message-timeout isearch-original-minibuffer-message-timeout) (isearch-dehighlight t) - (isearch-lazy-highlight-cleanup isearch-lazy-highlight-cleanup) + (isearch-lazy-highlight-cleanup lazy-highlight-cleanup) (let ((found-start (window-start (selected-window))) (found-point (point))) (if isearch-window-configuration @@ -2227,46 +2284,6 @@ ;; - the variable `isearch-invalid-regexp' is expected to be true ;; iff `isearch-string' is an invalid regexp. -(defgroup isearch-lazy-highlight nil - "Lazy highlighting feature for incremental search." - :prefix "isearch-lazy-highlight-" - :version "21.1" - :group 'isearch) - -(defcustom isearch-lazy-highlight t - "*Controls the lazy-highlighting during incremental searches. -When non-nil, all text in the buffer matching the current search -string is highlighted lazily (see `isearch-lazy-highlight-initial-delay' -and `isearch-lazy-highlight-interval')." - :type 'boolean - :group 'isearch-lazy-highlight) - -(defcustom isearch-lazy-highlight-cleanup t - "*Controls whether to remove extra highlighting after a search. -If this is nil, extra highlighting can be \"manually\" removed with -\\[isearch-lazy-highlight-cleanup]." - :type 'boolean - :group 'isearch-lazy-highlight) - -(defcustom isearch-lazy-highlight-initial-delay 0.25 - "*Seconds to wait before beginning to lazily highlight all matches." - :type 'number - :group 'isearch-lazy-highlight) - -(defcustom isearch-lazy-highlight-interval 0 ; 0.0625 - "*Seconds between lazily highlighting successive matches." - :type 'number - :group 'isearch-lazy-highlight) - -(defcustom isearch-lazy-highlight-max-at-a-time 20 - "*Maximum matches to highlight at a time (for `isearch-lazy-highlight'). -Larger values may reduce isearch's responsiveness to user input; -smaller values make matches highlight slowly. -A value of nil means highlight all matches." - :type '(choice (const :tag "All" nil) - (integer :tag "Some")) - :group 'isearch-lazy-highlight) - (defgroup isearch-faces nil "Lazy highlighting feature for incremental search." :version "21.1" @@ -2288,19 +2305,7 @@ :group 'isearch-faces) (defvar isearch 'isearch) -(defface isearch-lazy-highlight-face - '((((class color) (min-colors 88) (background light)) - (:background "paleturquoise")) - (((class color) (min-colors 88) (background dark)) - (:background "paleturquoise4")) - (((class color) (min-colors 16)) - (:background "turquoise3")) - (((class color) (min-colors 8)) - (:background "turquoise3")) - (t (:underline t))) - "Face for lazy highlighting of Isearch matches other than the current one." - :group 'isearch-faces) -(defvar isearch-lazy-highlight-face 'isearch-lazy-highlight-face) +(defvar isearch-lazy-highlight-face 'lazy-highlight-face) (defvar isearch-lazy-highlight-overlays nil) (defvar isearch-lazy-highlight-wrapped nil) @@ -2316,11 +2321,11 @@ (defun isearch-lazy-highlight-cleanup (&optional force) "Stop lazy highlighting and remove extra highlighting from current buffer. -FORCE non-nil means do it whether or not `isearch-lazy-highlight-cleanup' +FORCE non-nil means do it whether or not `lazy-highlight-cleanup' is nil. This function is called when exiting an incremental search if -`isearch-lazy-highlight-cleanup' is non-nil." +`lazy-highlight-cleanup' is non-nil." (interactive '(t)) - (if (or force isearch-lazy-highlight-cleanup) + (if (or force lazy-highlight-cleanup) (while isearch-lazy-highlight-overlays (delete-overlay (car isearch-lazy-highlight-overlays)) (setq isearch-lazy-highlight-overlays @@ -2330,7 +2335,7 @@ (setq isearch-lazy-highlight-timer nil))) (defun isearch-lazy-highlight-new-loop () - "Cleanup any previous `isearch-lazy-highlight' loop and begin a new one. + "Cleanup any previous `lazy-highlight' loop and begin a new one. This happens when `isearch-update' is invoked (which can cause the search string to change or the window to scroll)." (when (and (null executing-kbd-macro) @@ -2361,7 +2366,7 @@ isearch-lazy-highlight-wrapped nil) (unless (equal isearch-string "") (setq isearch-lazy-highlight-timer - (run-with-idle-timer isearch-lazy-highlight-initial-delay nil + (run-with-idle-timer lazy-highlight-initial-delay nil 'isearch-lazy-highlight-update)))))) (defun isearch-lazy-highlight-search () @@ -2382,7 +2387,7 @@ (defun isearch-lazy-highlight-update () "Update highlighting of other matches for current search." - (let ((max isearch-lazy-highlight-max-at-a-time) + (let ((max lazy-highlight-max-at-a-time) (looping t) nomore) (with-local-quit