[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/isearch.el
From: |
Richard M . Stallman |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/isearch.el |
Date: |
Mon, 03 Jan 2005 21:35:08 -0500 |
Index: emacs/lisp/isearch.el
diff -c emacs/lisp/isearch.el:1.249 emacs/lisp/isearch.el:1.250
*** emacs/lisp/isearch.el:1.249 Wed Dec 15 10:08:51 2004
--- emacs/lisp/isearch.el Tue Jan 4 02:21:55 2005
***************
*** 155,160 ****
--- 155,169 ----
: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,204 ****
--- 208,261 ----
: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,683 ****
;; (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)
(let ((found-start (window-start (selected-window)))
(found-point (point)))
(if isearch-window-configuration
--- 734,740 ----
;; (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 lazy-highlight-cleanup)
(let ((found-start (window-start (selected-window)))
(found-point (point)))
(if isearch-window-configuration
***************
*** 2227,2272 ****
;; - 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"
--- 2284,2289 ----
***************
*** 2288,2306 ****
: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-overlays nil)
(defvar isearch-lazy-highlight-wrapped nil)
--- 2305,2311 ----
:group 'isearch-faces)
(defvar isearch 'isearch)
! (defvar isearch-lazy-highlight-face 'lazy-highlight-face)
(defvar isearch-lazy-highlight-overlays nil)
(defvar isearch-lazy-highlight-wrapped nil)
***************
*** 2316,2326 ****
(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'
is nil. This function is called when exiting an incremental search if
! `isearch-lazy-highlight-cleanup' is non-nil."
(interactive '(t))
! (if (or force isearch-lazy-highlight-cleanup)
(while isearch-lazy-highlight-overlays
(delete-overlay (car isearch-lazy-highlight-overlays))
(setq isearch-lazy-highlight-overlays
--- 2321,2331 ----
(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 `lazy-highlight-cleanup'
is nil. This function is called when exiting an incremental search if
! `lazy-highlight-cleanup' is non-nil."
(interactive '(t))
! (if (or force lazy-highlight-cleanup)
(while isearch-lazy-highlight-overlays
(delete-overlay (car isearch-lazy-highlight-overlays))
(setq isearch-lazy-highlight-overlays
***************
*** 2330,2336 ****
(setq isearch-lazy-highlight-timer nil)))
(defun isearch-lazy-highlight-new-loop ()
! "Cleanup any previous `isearch-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)
--- 2335,2341 ----
(setq isearch-lazy-highlight-timer nil)))
(defun isearch-lazy-highlight-new-loop ()
! "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,2367 ****
isearch-lazy-highlight-wrapped nil)
(unless (equal isearch-string "")
(setq isearch-lazy-highlight-timer
! (run-with-idle-timer isearch-lazy-highlight-initial-delay nil
'isearch-lazy-highlight-update))))))
(defun isearch-lazy-highlight-search ()
--- 2366,2372 ----
isearch-lazy-highlight-wrapped nil)
(unless (equal isearch-string "")
(setq isearch-lazy-highlight-timer
! (run-with-idle-timer lazy-highlight-initial-delay nil
'isearch-lazy-highlight-update))))))
(defun isearch-lazy-highlight-search ()
***************
*** 2382,2388 ****
(defun isearch-lazy-highlight-update ()
"Update highlighting of other matches for current search."
! (let ((max isearch-lazy-highlight-max-at-a-time)
(looping t)
nomore)
(with-local-quit
--- 2387,2393 ----
(defun isearch-lazy-highlight-update ()
"Update highlighting of other matches for current search."
! (let ((max lazy-highlight-max-at-a-time)
(looping t)
nomore)
(with-local-quit
- [Emacs-diffs] Changes to emacs/lisp/isearch.el,
Richard M . Stallman <=