From a602033560060cf8b1a7ca2faed46257441047c2 Mon Sep 17 00:00:00 2001 From: "Mark A. Hershberger" Date: Fri, 21 May 2010 01:16:19 +0300 Subject: [PATCH] * isearch.el (isearch-update-post-hook): New hook. (isearch-update): Use the new hook. (Bug#6225) --- etc/NEWS | 4 ++++ lisp/ChangeLog | 5 +++++ lisp/isearch.el | 6 +++++- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/etc/NEWS b/etc/NEWS index 1c7d9268e5d..c5871ebd98a 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -255,6 +255,10 @@ by the Graphic Control Extension of the image. *** `image-extension-data' is renamed to `image-metadata'. +** Isearch + +*** New hook `isearch-update-post-hook' that runs in `isearch-update'. + ** Progress reporters can now "spin". The MIN-VALUE and MAX-VALUE arguments of `make-progress-reporter' can now be nil, or omitted. This makes a "non-numeric" reporter. Each diff --git a/lisp/ChangeLog b/lisp/ChangeLog index b0dbec2f6b2..15dc5d2aa9a 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2010-05-20 Mark A. Hershberger + + * isearch.el (isearch-update-post-hook): New hook. + (isearch-update): Use the new hook. (Bug#6225) + 2010-05-20 Juri Linkov * isearch.el (isearch-mode-map): Bind more keys to isearch-help-map: diff --git a/lisp/isearch.el b/lisp/isearch.el index b3d121512c2..c44238ede24 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -156,6 +156,9 @@ command history." (defvar isearch-mode-hook nil "Function(s) to call after starting up an incremental search.") +(defvar isearch-update-post-hook nil + "Function(s) to call after isearch has found matches in the buffer.") + (defvar isearch-mode-end-hook nil "Function(s) to call after terminating an incremental search. When these functions are called, `isearch-mode-end-hook-quit' @@ -870,7 +873,8 @@ It is called by the function `isearch-forward' and other related functions." (isearch-lazy-highlight-new-loop)) ;; We must prevent the point moving to the end of composition when a ;; part of the composition has just been searched. - (setq disable-point-adjustment t)) + (setq disable-point-adjustment t) + (run-hooks 'isearch-update-post-hook)) (defun isearch-done (&optional nopush edit) "Exit Isearch mode. -- 2.39.2